# How many $6$-digit numbers contain exactly two even digits

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.

• I understand why you have four options for the leading digit if the leading digit is even, but why do you have four options for the other digits? – N. F. Taussig Aug 23 '17 at 11:28
• because there is 4 even numbers 2,4,6,8 am i worng ? – NedyLearing Aug 23 '17 at 11:35
• The number $0$ is even since $0 = 2 \cdot 0$. Also, there are five odd digits, $1$, $3$, $5$, $7$, and $9$. – N. F. Taussig Aug 23 '17 at 11:36

How many six-digit positive integers contain exactly two even digits?

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$$

In how many five-digit positive integers are there digits that appear more than once?

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.

The total number of five-digit positive integers is $$9 \cdot 10 \cdot 10 \cdot 10 \cdot 10 = 90000$$ since the leading digit can be chosen in nine ways (as $0$ is prohibited) and each of the remaining digits can be selected in $10$ ways. Alternatively, the largest five-digit number is $99999$ and the largest number with fewer than five digits is $9999$, so the number of five-digit positive integers is $$99999 - 9999 = 90000$$ The number of five-digit positive integers with distinct digits is $$9 \cdot 9 \cdot 8 \cdot 7 \cdot 6 = 27216$$ since we have nine choices for the leading digit (as $0$ is prohibited), nine choices for the thousands digit (since we cannot use the leading digit), eight choices for the hundreds digit (since we cannot use the tens thousands or thousands digits), seven choices for the tens digit, and six choices for the units digit. Therefore, the number of five-digit positive integers that do contain a digit that appears more than once is $$9 \cdot 10 \cdot 10 \cdot 10 \cdot 10 - 9 \cdot 9 \cdot 8 \cdot 7 \cdot 6 = 90000 - 27216 = 62784$$

• thank you very much :) i understund it finaly! :) for the second one i will try it right away :) – NedyLearing Aug 23 '17 at 15:34
• for the second quation is my way of getting the answer is correct ? all the posibalits (10^5) to get five digit numbers - posibalits with no repeation at all = my answer ? – NedyLearing Aug 23 '17 at 16:42
• You did not take into account the fact that the leading digit cannot be zero. I have added a solution to the second problem. You can read it by hovering over the shadow box. – N. F. Taussig Aug 23 '17 at 16:59
• oh god .. i allways do mistakes like that .. =\ but i think now i get it i must say realy thank you for all your help youre awsome ! – NedyLearing Aug 23 '17 at 17:06