# How many even numbers less than $500$ can be formed using the digits $1$, $2$, $3$, $4$ and $5$?

How many even numbers less than $$500$$ can be formed using the digits $$1$$, $$2$$, $$3$$, $$4$$ and $$5$$?

Each digit may be used only once in any number.

I first tried by using the formula for permutations:

$$3P1 \times 6 = 18$$

But the answer is $$28$$.

So I tried again, this time by listing all of the possible permutations:

1. $$132$$
2. $$142$$
3. $$152$$
4. $$124$$
5. $$134$$
6. $$154$$
7. $$214$$
8. $$234$$
9. $$254$$
10. $$312$$
11. $$342$$
12. $$352$$
13. $$314$$
14. $$324$$
15. $$354$$
16. $$412$$
17. $$432$$
18. $$452$$

I still get $$18$$.

What am I doing wrong?

• You haven't considered numbers with 1 or 2 digits. Commented Jan 7, 2022 at 18:18
• What's the difference between "possible permutations" and "permutations"? Commented Jan 7, 2022 at 18:42

Case $$1$$: The number is a single digit.

In this case, the only even numbers are $$2$$ and $$4$$, giving a total of $$2$$.

Case $$2$$: The number has exactly two digits.

In this case, the last digit must be either $$2$$ or $$4$$, and the first digit must be one of the other four digits allowed, giving a total of $$2 \cdot 4=8$$.

Case $$3$$: The number has exactly three digits.

In this case, the last digit must be either $$2$$ or $$4$$ and the middle digit must be one of the other four digits allowed.

If the middle digit is $$5$$, then the first digit must be one of the other three digits allowed, giving a total of $$2 \cdot 3=6$$.

If the middle digit is not $$5$$, then the first digit must be one of two digits other than the last two digits and $$5$$, giving a total of $$2 \cdot 3 \cdot 2=12$$.

So, there are $$2+8+6+12=28$$ even numbers less than $$500$$ with distinct digits $$\in \{1,2,3,4,5\}$$.

Draw three boxes to represent an arbitrary three digit number, and then write in each box the number of digits that can be placed there. When there are restrictions, fill the restricted places first. $$\begin{array}{|c|l|c|r|} \hline \text{step 2} & \text{step 3} & \text{step 1} \\ \hline & & \\ \hline \end{array}$$ The first step is to indicate the number of choices for the units column. The number is even so we place either a 2 or a 4 in the units column. We may fill this box in $$\binom{2}{1}$$ ways. When this has been done, the second step is to fill the hundreds column. If a 4, for example, was placed in the units column, we could place either a 1 or a 2 or a 3 here. We may fill this box in $$\binom{3}{1}$$ ways. When this has been done, the third step is to fill the tens column. If a 4, for example, was placed in the units column and a 3 was placed in the hundreds column, we could place either a 1 or a 2 or a 5 here. We may fill this box in $$\binom{3}{1}$$ ways.
$$\begin{array}{|c|l|c|r|} \hline \text{step 2} & \text{step 3} & \text{step 1} \\ \hline \binom{3}{1} & \binom{3}{1} & \binom{2}{1} \\ \hline \end{array}$$ By The Multiplication Principle, the number of ways of doing step1 and step 2 and step 3 is $$\binom{3}{1} \times \binom{3}{1} \times \binom{2}{1}$$. The number of three digit numbers is 3.3.2 =18.

Now draw two boxes to represent an arbitrary two digit number and then write in each box the number of digits that can be placed there. Again fill the restricted places first. $$\begin{array}{|c|r|} \hline \text{step 2} & \text{step 1} \\ \hline \binom{4}{1} & \binom{2}{1} \\ \hline \end{array}$$ By The Multiplication Principle, the number of ways of doing step1 and step 2 is $$\binom{4}{1} \times \binom{2}{1}$$. There are 4.2=8 two digit numbers.

Next draw one box to represent an arbitrary one digit number, and then write in that box the number of digits that can be placed there. $$\begin{array}{|c|} \hline \text{step 1} \\ \hline \binom{2}{1} \\ \hline \end{array}$$ As this is a restricted place, it can only be filled in $$\binom{2}{1}$$ or 2 ways.

By The Addition Principle, the number of even numbers less than 500 is $$\binom{3}{1} \times \binom{3}{1} \times \binom{2}{1} + \binom{4}{1} \times \binom{2}{1} + \binom{2}{1}= 18+8+2=28$$

You haven't considered numbers with 1 or 2 digits. – Robbie Jan 7 at 18:18

Thanks to @Robbie for helping my realise my mistake.

I retried using the same method and was successful:

\begin{align} \text{3-digit numbers} = 3P1 \times 3P1 \times 2 &= 18 \\ \text{2-digit numbers} = 4P1 \times 2 &= 8 \\ \text{1-digit numbers} &= 2 \\ \therefore \text{Answer} = 18 + 8 + 2 &= 28 \end{align}