# How many even three-digit numbers have distinct digits and have no digit $5$?

How many even three-digit numbers have distinct digits and have no digit $$5$$?

The answer my teacher gave was $$252$$, but I don't see how she got that. I thought it would be $$6\times 8 \times 5=240$$ because the $$3\text{rd}$$ digit must be even $$(0,2,4,6,8)$$, the $$2\text{nd}$$ digit can't be $$5$$ or the $$3\text{rd}$$ digit $$(10-2=8$$ options) and the first digit can't be $$0$$, $$5$$, the $$2\text{nd}$$ digit, or the $$3\text{rd}$$ digit ($$10-4=6$$ options). Any way I look at it, the last digit has to be even and there are $$5$$ options for even digits, so the final answer must end in a $$5$$ or a $$0$$, not a $$2$$. Please help!

• You have to add those cases where $0$ is used up as the third digit and can't be there at the first digit. It would be better to split into 2 cases, one with last digit as $0$ and other with last digit as non-zero. – gemspark Aug 24 '20 at 4:11
• Looks like they're counting 024 as a three digit number. – David Aug 24 '20 at 4:13
• @ L_M Quite... while your logic is sound for the ones-place digit and the tens-place digit, your hundreds-place digit might have $6$ options (in the event the ones-digit was not zero) or it might have had $7$ options (in the event the ones-digit was zero). Your mistake is that you forgot to consider what happens if the list "zero, 5, 2nd digit, 3rd digit" had some overlap. – JMoravitz Aug 24 '20 at 4:14

No. ending with non-zero digit = $$4 .7.7=196$$.

No. ending with zero digit = $$1 .8.7=56$$

P.S. The product above is (third digit options) x (first digit) x (second digit)

I figured out a different way to do it actually. I see that you have to account for when the third digit is zero and non-zero because it changes the criteria for the first digit, but I considered this for the second digit as well. What I did was split it into three cases:

Last digit is zero: $$7 \times 8 \times 1=56$$ (second digit cannot be $$5$$ or $$0$$ : the first digit cannot be $$5$$, the second digit or the third digit)

Last digit is nonzero and second digit is zero: $$7 \times 1 \times 4=28$$ (first digit cannot be $$5$$, the second digit or the third digit)

Second and last digits are nonzero: $$6 \times 7 \times 4=168$$ (the second digit cannot be $$5, 0$$, or the last digit: the first digit cannot be $$5,0$$, the second digit or the third digit)

Addition principle:$$56+28+168=252$$

It gives the right answer, but is this reasoning sound?

• Looks sensible. – Henno Brandsma Aug 24 '20 at 6:39
• You have just subdivided the non-zero last digit case of my answer into 2 subcases. – gemspark Aug 24 '20 at 7:27

So, one is asking for the number of injections $$f:\{1,2,3\} \to \{0,1,2,3,4,6,7,8,9\}$$ where $$f(1) \neq 0$$ and $$f(3) \in \{0,2,4,6,8\}$$.

Ignoring the last two conditions, one gets $$_{9}P_{3}=504$$ possible numbers (possibly odd and/or having a leading zero).

If one requires the first digit to be nonzero, then one would then need to subtract the number of injections $$\{2,3\} \to \{1,2,3,4,6,7,8,9\}$$ to get $$504-{_{8}P_{2}}=504-56=448$$.

Odd numbers still have not been eliminated yet. We have to eliminate the cases where the last digit is $$1, 3, 7,$$ or $$9$$.

Suppose that the last two digits ($$f(2)$$ and $$f(3)$$) are $$0$$ and $$1$$ respectively. Then, one must have $$f(1) \in \{2,3,4,6,7,8,9\}$$, eliminating $$7$$ odd numbers to reduce the count to $$441$$.

Similar considerations apply when the middle digit is still $$0$$, but the last digit is now $$3, 7,$$ or $$9$$. This eliminates $$3 \cdot 7=21$$ more odd numbers, reducing the count to $$420$$.

Now, let's move on to the case where the middle digit is nonzero. Fixing a last digit $$d \in \{1,3,7,9\}$$, one would then need to subtract the number of injections $$\{1,2\} \to \{1,2,3,4,6,7,8,9\} \setminus \{d\}$$.

Suppose that $$d=1$$. Then, subtracting the number of injections $$\{1,2\} \to \{2,3,4,6,7,8,9\}$$ gives $$420-{_{7}P_{2}}=420-42=378$$. Forty-two odd numbers with the last digit equal to $$1$$ have now been eliminated.

Similar considerations apply when $$d$$ is $$3,7,$$ or $$9$$. This eliminates $$3 \cdot 42=126$$ more odd numbers, giving a final count of $$252$$.