BREAKING: Target Test Prep releases Brand New 2026 On Demand GMAT prep course

Redeem

How many allowable codes are there?

Expert replies
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
Join the discussion
Source: — Problem Solving |

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)

?????
Join the discussion

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

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?
Join the discussion

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..
Join the discussion

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
Join the discussion

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..
Join the discussion

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 !
Join the discussion

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?
Join the discussion

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.
Join the discussion