# How Many 4-Digit Positive Even Numbers Use Only Digits 0 Through 4, With No Digits Repeating?

I am currently working on this problem:

How many 4-digit multiples of 2 use only digits 0 through 4, with no digits repeating?

I understand/know the basic idea of how to solve this kind of problem:

You multiply the number of possible numbers that could be in each place, for example, for How many 4 digit numbers use only digits 0 through 3, with no digits repeating?, the answer would be 3 * 3 * 2 * 1, or 18.

In my problem, the last digit of any even number is either 0, 2, or 4. That gives us this current multiplication equation:

_ * _ * _ * 3

The reason I am stuck on this problem is because, in the first space, there could either be 4 possibilities(1, 2, 3, 4) or 3 possibilities(1, 3, 4 OR 1, 2, 3), depending on if 2 or 4 is used in the ones column. And depending on the 1st column, the following numbers of possibilities will be one minus the last number.

Now, because there can be two possible number of possibilities in the left-most/4th space, there can be two multiplication problems, which makes this problem confusing for me:

4 * 3 * 2 * 3

OR

3 * 2 * 1 * 3

So my question is: How would you solve this problem?

• They are $60$, namely $$(1024, 1032, 1034, 1042, 1204, 1230, 1234, 1240, 1302, 1304, 1320, 1324, 1340, 1342, 1402, 1420, 1430, 1432, 2014, 2034, 2104, 2130, 2134, 2140, 2304, 2310, 2314, 2340, 2410, 2430, 3012, 3014, 3024, 3042, 3102, 3104, 3120, 3124, 3140, 3142, 3204, 3210, 3214, 3240, 3402, 3410, 3412, 3420, 4012, 4032, 4102, 4120, 4130, 4132, 4210, 4230, 4302, 4310, 4312, 4320)$$ – Raffaele Jan 23 at 21:15
• Consider cases, depending on whether the units digit is $0$. – N. F. Taussig Jan 23 at 21:16

The answer can be written as

$$1\cdot4\cdot3\cdot2+2\cdot3\cdot3\cdot2$$

The idea is to split the count into two cases, according to whether the ones digit (which makes the number even) is $$0$$ or not. There's only one way to choose $$0$$, after which the remaining digits can be chosen in $$4\cdot3\cdot2$$ ways. There are two ways to choose nonzero ones digit (either $$2$$ or $$4$$), but that means there are only three choices for the lead digit, since you have to avoid the $$0$$. But after that, the two interior digits can be chosen in $$3\cdot2$$ ways.

Added later: The heart of this solution is the calculation of $$1\cdot4+2\cdot3$$, which amounts to counting the number of two-digit even numbers out of the digits $$0$$ to $$4$$; the remaining $$3\cdot2$$ is routine. I was bemused by the observation that $$1\cdot4+2\cdot3=10={5\choose2}$$, where the latter counts the number of (unordered) choices of $$2$$ of the $$5$$ digits, and wondered if this could be attributed to anything more than numerical coincidence (aka, Richard Guy's Strong Law of Small Numbers). It turns out it can:

Note that each odd digit can be paired with a distinct nonzero even digit, e.g., $$1$$ with $$2$$ and $$3$$ with $$4$$. Now pick any pair of digits, which can be done in $$5\choose2$$ ways. If one of the chosen digits is $$0$$, put it in the ones digit and use the other as the lead digit. If both are even but neither is $$0$$, put the smaller in the ones digit and use the larger as the lead digit. If both are odd, replace each one with the even digit it's been paired with and then put the larger of these in the ones digit and use the smaller as the lead digit.

This works as long as each odd digit can be paired with a nonzero even digit, i.e., if the set of available digits consists of $$0$$, $$k$$ odd digits, and $$k$$ nonzero even digits, giving a count of $$2k+1\choose2$$ two-digit even numbers. (It also works without the $$0$$, the count being simply $$2k\choose2$$ in that case.)

You can choose one's place in $$3$$ ways $$(0, 2, 4)$$.

Once you do that, you now have $$4$$ digits left for the second place (ten's), $$3$$ for the third (hundred) and $$2$$ for the $$4$$th (thousand).

That gives you $$3 \times 4 \times 3 \times 2 = 72 \$$ numbers.

But this also counts numbers that have $$0$$ in thousand place. We need to remove them as they are not $$4$$ digit numbers really.

So if I fix $$0$$ in thousand place, I have $$2$$ choices for one's place ($$2, 4$$), $$3$$ remaining for the ten's and $$2$$ remaining for the hundred place, which is $$12$$ numbers in total (= $$2 \times 3 \times 2$$).

So the count of numbers you are interested in $$= 72 - 12 = 60$$.