[Math] The digit 0,2,4,6,8 are used to form four digit codes

combinatorics

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.

My answer:
i) 8642
ii)2046

Best Answer

Your answers to i) and ii) are correct.

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