# Combinatorics and elementary probability

$1$) Using the numbers $0,1,2,...,9$ as digits, how many $4$-digit numbers exist in which all digit are different with two digits as even numbers and two as odd numbers?

(Note: $0$ is an even number, and that $4$-digit number do not start with $0$)

-

First pick 2 odd numbers and 2 even numbers. There are $\binom{5}{2}^2$ ways to do this. Now order them. There are $4!$ ways. So there are $4!\binom{5}{2}^2$ total numbers, but we have included 4-digit numbers that start with 0. Now let's count the number that start with $0$. There are $4$ choices for the other even digit, $\binom{5}{2}$ choices for the odd digits, and $3!$ orders. So for our final answer we have: $$4!\binom{5}{2}^2-3!(4)\binom{5}{2}$$

-
You mean $\begin{pmatrix} 5 \\ 2 \end{pmatrix}$ instead of $10$ ; there's only $5$ possible odd/even digits : 1,3,5,7,9 for odd and 0,2,4,6,8 for even. For the same reason there are only $4$ choices for the other even digit when $0$ is included. – Patrick Da Silva Mar 14 '12 at 1:43
Indeed. I'll fix that now. (Nevermind, you beat me to it. Thanks!) – Brett Frankel Mar 14 '12 at 1:44
I fixed it. It's just fine now – Patrick Da Silva Mar 14 '12 at 1:45
I added another approach in my answer. See it if you feel like it. – Patrick Da Silva Mar 14 '12 at 1:58

Another possibility would be this : consider the $4$-digit numbers without $0$ in them. There is $4$ possible even numbers and $5$ possible odd numbers, so $\binom 52 \binom 42 = 60$ possibilities. There are $4! = 24$ ways to place them, hence you have $60 \times 24 = 1440$ such numbers.

Now consider those with $0$ in them. The zero must be one of the $3$ first digits. Now for the number possibilities, there are $4$ choices for the even number and $\binom 52 = 10$ choices for the odd numbers, hence $40$ choices for the numbers. Afterwards, there are $3$ possibilities for the position of $0$ and $3!=6$ choices for the position of the three other digits, hence $18$ possibilities in total. Therefore there is $40 \times 18 = 720$ such digits.

Summing up gives $1440 + 720 = 2160 = 4! \binom 52^2 - 3!(4) \binom 52$ possibilities.

Hope that helps,

-
Do you mean that the zero must be one of the last 3 digits? – JakeR Mar 14 '12 at 2:01
Um, in the number $1240$ I consider $2$, $4$ and $0$ to be the first $3$ digits. Does that help? – Patrick Da Silva Mar 14 '12 at 4:02
Ah, that strikes me as unusual but certainly valid. Though looking again, I'm not sure that you meant to write $40 \times 18 = 180$. – JakeR Mar 14 '12 at 4:05
Um, yes I had made the computation mistake of writing $10 \times 18$ before because I didn't take in account the "$4$ choices" when calculating explicitly. The result is meant to be $720$ there, obviously. – Patrick Da Silva Mar 14 '12 at 4:07
@JakeR : I edited it. Thanks for noticing. – Patrick Da Silva Mar 14 '12 at 4:07