How many 6 digit numbers contain exactly two even digits?
I try to solve it by separating it into two cases:
case a: no zero in the beginning (and I assume that the first digit is even number)
-there are $4$ options for the first digit
-for the next digit is $\binom{5}{4}$
-and I assume that in some place there is the next is the next even number
$$4 \binom{5}{4} \cdot 4 \cdot 4 \cdot 4 \cdot 4$$
case b: zero is not allowed to be in the opening digit and I place there an odd number
-there are $4$ options for the odd number (no zero and no even number)
-and for the rest of the digits ($5$ left), I need to place the rest of the numbers so
$$4 \cdot \binom{5}{4} 4 \cdot 4 \cdot 4 \cdot \binom{4}{4}$$
To be honest, I think I really screwed up in this question. Can you help me here?
And explain how to solve this question and this kind of question?
In how many $5$ digit numbers are there digits that appear more than once?
I do not have any idea how to solve this.
Best Answer
Remember that an integer $n$ is said to be even if there exists an integer $m$ such that $n = 2m$. An integer that is not even is said to be odd. Hence, there are five even digits: $$0, 2, 4, 6, 8$$ and five odd digits: $$1, 3, 5, 7, 9$$
Your strategy of breaking the problem into two cases is correct. Let's correct your calculations for those cases.
Case 1: The leading digit is even.
Since the leading cannot be zero, there are four ways to fill the leading digit. There are five ways to choose the position of the other even digit and five ways to fill that position with an even digit. There are five ways to fill each of the four remaining positions with an odd digit.
$$4 \binom{5}{1} \cdot 5 \cdot 5^4 = 4 \binom{5}{1} 5^5$$
Case 2: The leading digit is odd.
Two of the remaining five positions must be filled with even digits. There are $\binom{5}{2}$ ways to select the positions of the even digits and five ways to fill each of those positions with an even digit. There are five ways to fill each of the four other positions with an odd digit.
$$\binom{5}{2} \cdot 5^2 \cdot 5^4 = \binom{5}{2} 5^6$$
Total: Since the above cases are mutually exclusive and exhaustive, the number of six-digit positive integers that contain exactly two even digits is $$4 \binom{5}{1} 5^5 + \binom{5}{2} 5^6$$
Hint: Subtract the number of five-digit positive integers in which all the digits are distinct from the total number of five-digit positive integers.