[Math] How many $4$ digit even numbers have all $4$ digits distinct

combinatorics

How many $4$ digit even numbers have all $4$ digits distinct ?

This question has been asked if we replace even with positive.

I was solving this Problem like: For first position $1-9$ (No $0$) for next $0-9$ (leaving out the digit which has been choose) for next $0-9$ (leaving out $2$ digits), but on last digit I get stuck. From what I should choose. Will it be $0, 2, 4, 6, 8$, because number needs to be even? How should I solve it?

Best Answer

For problems like this one, it is best to start counting with what has the most constraint. Here we need the last digit even, and the first digit to be non-zero. The two central ones don't have any constraints aside from being distinct from everyone else.

We start by dividing the counting depending on whether the last digit is $0$ or not.

  • If the number ends with a $0$ then there are $9$ choices for the first digit, $8$ for the second and $7$ for the third, which makes $1\times 9\times 8\times 7=504 $ possibilities.

  • If the number is even ending with something else than $0$ then there are $4$ choices for the last digit, $8$ choices for the first digit (no $0$ nor the last digit), $8$ for the second digit and $7$ for the third digit, which makes $4\times 8\times 8\times 7=1792$

Together, this gives $2,296$ numbers with $4$ distinct digits that are even. Note that this does not allow leading $0$, as you seem to want it based on the question.