# The digit 0,2,4,6,8 are used to form four digit codes

I'm trying to do this exercise and I'm stuck at 3 and 4 part. Is there any website or some youtube video can someone recommend to me, so I can understand how to do this kind of questions. With question three should I take the largest number and the smallest and subtract them to get an answer? Thanks.

The digits 0,2,4,6,8 are used to form four-digit codes. A code cannot begin with 0 and no digit is repeated in any code.

i) Write down the largest possible four digit code. ii) Write down the smallest possible four digit code. iii) How many four digit codes can be formed. iv) How many of the four digit codes are greater than 4000.

• I agree with i) and (ii). That is not counting but understanding the decimal place system under these constraints. (iii) is the product rule for independent choices: $4 \times 4 \times 3 \times 2$, the last one too but there we haves to start with 4 or more, so 3 options for the first digit etc. So $3 \times 4 \times 3 \times 2$ this time. – Henno Brandsma May 7 '17 at 20:53

iii)

One way to do this one is to first determine all 4 digit numbers, which we can generate one digit at a time:

First, there are 5 choices for first digit:

0...

2...

4...

6...

8...

Now let's add the second digit, which has to be different from the first:

02.. ; 04 .. ; 06.. ; 08 .. ;

20.. ; 24 .. ; 26.. ; 28 .. ;

40.. ; 42 .. ; 46.. ; 48 .. ;

60.. ; 62 .. ; 64.. ; 68 .. ;

80.. ; 82 .. ; 84.. ; 86 .. ;

Notice you get 20 of them, because for each of the 5 first digits, you have 4 options left for the second digit, so that is 5*4 = 20.

OK, so to continue, you have 3 options left for the third, and 2 for the second, giving you a grand total of 5*4*3*2 = 120 4-digit numbers.

OK, but we don;t want any umber to start with the 0 digit, so we need to subtract all them and there are 4*3*2=24 of those.

So, the number of valid 4-digit codes is 120-24 =96

iv)

Similarly to 3, from the total of 5 digit numbers, subtract the ones that start with 0 or 2, so that is 5*4*3*2 - 4*3*2 - 4*3*2 = 120-24-24 = 72

• Sorry for asking stupid questions, can you explain why we have to multiply 5*4*3*2? I am starting learning maths after 10 years and this is new for me. – BloodySandwich May 7 '17 at 18:35
• @BloodySandwich OK, I'll add something to my post – Bram28 May 7 '17 at 18:36
• @BloodySandwich OK, updated my post .. see if this makes sense ... – Bram28 May 7 '17 at 18:44
• Thanks a million for you explanation, there is the only thing I don't understand when you say "you have 3 options left for the third, and 2 for the second" the rest I get. – BloodySandwich May 7 '17 at 19:41
• @BloodySandwich OK, when you have the first two digits placed (say you have 02..), then you have only 3 possibilities left for the third digit (in this case 4,6, or 8). So, there are 3 possibilities dor the third digit. And once you have placed your third digit (say you now have 024.), then there are only two digits left to use for the fourth digit (6 or 8). .... Oh! I now see your confusion: I misspoke when I said '.. 2 for the second'.. That should be '2 for the fourth'! – Bram28 May 7 '17 at 21:05

If the code number is greater than 4, the first digit is either 4 6 or 8.

You have 3 choices for the first number.

You have 4 choices for the second number (one option exhausted)

You have 3 choices for the third number (two options exhausted)

You have 2 choices for the final number (three options exhausted)

3 x 4 x 3 x 2 = 72 codes greater than 4000

You have 4 choices for your first digit. No zero

You have 4 choices for your next digit. (You can use zero now, one option exhausted)

You have 3 choices for your next digit (Two choices exhausted)

You have 2 choices for your last digit (Three choices exhausted)

4 x 4 x 3 x 2 = 96 codes.