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?

  • 1
    $\begingroup$ First pick the last digit, (in two cases; case I: 0, case II: 2,4,6,8) then pick the first digit then the middle two digits $\endgroup$
    – user21965
    Sep 14, 2013 at 18:41

2 Answers 2


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.


If we are allowed to put 0 as the first digit, then 4th digit has 5 possibilities (0,2,4,6,8), 3rd - 9 possibilities, 2nd - 8, 1st - 7. This gives 5*9*8*7=2520

Let's count illegal numbers with 0 as the 1st digit. 4 possibilities for the 4th number (2,4,6,8), 8 for 3rd, 7 for 2nd. This gives 4*8*7=224

The answer is 2520-224=2296

  • $\begingroup$ Thanks For fast reply. :-) $\endgroup$ Sep 14, 2013 at 18:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .