How many allowable codes are there?

This topic has expert replies
Senior | Next Rank: 100 Posts
Posts: 79
Joined: Wed Feb 06, 2008 7:52 am
Thanked: 2 times
GMAT Score:620

How many allowable codes are there?

by yalanand » Sun Feb 01, 2009 12:24 am
A combination lock can be set so that it opens with a 4-digit code--subject to the restriction that the code number cannot contain adjacent even digits. All the digits from 0 to 9 may be used. How many allowable codes are there?

(A) 9^4
(B) 9x9x8x8
(C) 8(5^4)
(D) 10x9x8x5
(E) 9x8x7x6
Source: — Problem Solving |

Master | Next Rank: 500 Posts
Posts: 424
Joined: Sun Dec 07, 2008 5:15 pm
Location: Sydney
Thanked: 12 times

Re: How many allowable codes are there?

by piyush_nitt » Sun Feb 01, 2009 1:09 am
yalanand wrote:A combination lock can be set so that it opens with a 4-digit code--subject to the restriction that the code number cannot contain adjacent even digits. All the digits from 0 to 9 may be used. How many allowable codes are there?

(A) 9^4
(B) 9x9x8x8
(C) 8(5^4)
(D) 10x9x8x5
(E) 9x8x7x6
E - Even
O - ODD

Even numbers - 0,2,4,6,8 - 5total
Odd numbers - 1,3,5,7,9 - 5 Total

here are the diff sets

OOOO - 5*5*5*5
OEOO
OOEO
OOOE
OEOE
EOOO - 4*5*5*5 (cannot start with 0)
EOEO
EOOE

5(5*5*5*5) + 3 (4*5*5*5)

?????

Senior | Next Rank: 100 Posts
Posts: 79
Joined: Wed Feb 06, 2008 7:52 am
Thanked: 2 times
GMAT Score:620

by yalanand » Sun Feb 01, 2009 1:16 am
It can start wid 0...

Master | Next Rank: 500 Posts
Posts: 424
Joined: Sun Dec 07, 2008 5:15 pm
Location: Sydney
Thanked: 12 times

by piyush_nitt » Sun Feb 01, 2009 1:36 am
yalanand wrote:It can start wid 0...
Why ??? If the digit starts with 0 it is no longer a 4 digit number.

Am I missing something?

User avatar
Legendary Member
Posts: 535
Joined: Fri Jun 08, 2007 2:12 am
Thanked: 87 times
Followed by:5 members
GMAT Score:730

by hardik.jadeja » Sun Feb 01, 2009 4:09 am
Answer is 8(5^4) ..

Piyush, the first digit can be 0 because its a lock combination..
you can use 0975 as a four digit lock code..

Master | Next Rank: 500 Posts
Posts: 260
Joined: Sun Oct 12, 2008 8:10 pm
Thanked: 4 times

by PAB2706 » Sun Feb 01, 2009 5:43 am
@ Hardik..
Please explain.... :?


Even i got the same ansewer....but my answer was more of logical guess by POE

User avatar
Legendary Member
Posts: 535
Joined: Fri Jun 08, 2007 2:12 am
Thanked: 87 times
Followed by:5 members
GMAT Score:730

by hardik.jadeja » Sun Feb 01, 2009 5:59 am
Let O = Odd Digit
and E = Even Digit
We have 5 odd digits {1,3,5,7,9} and 5 even digits {0,2,4,6,8}

These are the possible combination where no two even digits are adjacent

Possible combination of codes starting with an odd digit
OOOO - 5*5*5*5 = 5^4
OEOO - 5*5*5*5 = 5^4
OOEO - 5*5*5*5 = 5^4
OOOE - 5*5*5*5 = 5^4
OEOE - 5*5*5*5 = 5^4

Possible combination of codes starting with an even digit
EOOO - 5*5*5*5 = 5^4 (not 4*5*5*5 as 0 can be the first digit)
EOEO - 5*5*5*5 = 5^4
EOOE - 5*5*5*5 = 5^4

The only mistake piyush did was that he thought 0 cant be used as the first digit. But actually we can use 0 as the first digit because here what we are looking for is a lock combination and not a normal math number.

Imagine you have a briefcase and you have to use a four digit lock code to open it. Here you can set the first digit 0 in your combination. So in this scenario 0975 is a four digit lock code, not a 3 digit one.

when you add up all the possible combination that i have listed above to get the total possible combination, you get 8(5^4)

HTH..

Master | Next Rank: 500 Posts
Posts: 424
Joined: Sun Dec 07, 2008 5:15 pm
Location: Sydney
Thanked: 12 times

by piyush_nitt » Sun Feb 01, 2009 12:26 pm
hardik.jadeja wrote:Let O = Odd Digit
and E = Even Digit
We have 5 odd digits {1,3,5,7,9} and 5 even digits {0,2,4,6,8}

These are the possible combination where no two even digits are adjacent

Possible combination of codes starting with an odd digit
OOOO - 5*5*5*5 = 5^4
OEOO - 5*5*5*5 = 5^4
OOEO - 5*5*5*5 = 5^4
OOOE - 5*5*5*5 = 5^4
OEOE - 5*5*5*5 = 5^4

Possible combination of codes starting with an even digit
EOOO - 5*5*5*5 = 5^4 (not 4*5*5*5 as 0 can be the first digit)
EOEO - 5*5*5*5 = 5^4
EOOE - 5*5*5*5 = 5^4

The only mistake piyush did was that he thought 0 cant be used as the first digit. But actually we can use 0 as the first digit because here what we are looking for is a lock combination and not a normal math number.

Imagine you have a briefcase and you have to use a four digit lock code to open it. Here you can set the first digit 0 in your combination. So in this scenario 0975 is a four digit lock code, not a 3 digit one.

when you add up all the possible combination that i have listed above to get the total possible combination, you get 8(5^4)

HTH..
Ahhhh...got it mate ! Thanks !

Newbie | Next Rank: 10 Posts
Posts: 5
Joined: Thu Jan 01, 2009 10:17 am
Thanked: 1 times

by deep2002 » Mon Feb 02, 2009 10:19 am
So on a test, the only way to answer this is to litearlly take every single situation and analyze it? To try and look at all scenario would be very time consuming...is there another way?

User avatar
Legendary Member
Posts: 535
Joined: Fri Jun 08, 2007 2:12 am
Thanked: 87 times
Followed by:5 members
GMAT Score:730

by hardik.jadeja » Mon Feb 02, 2009 10:35 am
I think i got the answer without spending much time..

Listing out 8 possible scenarios is the only major thing.. Once you have understood the problem correctly i don't think it would take more than 30-50 secs to list out 8 possible scenarios.. and then remaining part is simple addition..

Tricky part is not to miss scenarios where 0 is the first digit.