We first count the number of ways to produce an even number. The last digit can be any of $2$, $4$, or $6$. So the last digit can be chosen in $3$ ways.
For each such choice, the first digit can be chosen in $6$ ways. So there are $(3)(6)$ ways to choose the last digit, and then the first.
For each of these $(3)(6)$ ways, there are $5$ ways to choose the second digit. So there are $(3)(6)(5)$ ways to choose the last, then the first, then the second.
Finally, for each of these $(3)(6)(5)$ ways, there are $4$ ways to choose the third digit, for a total of $(3)(6)(5)(4)$.
Similar reasoning shows that there are $(4)(6)(5)(4)$ odd numbers. Or else we can subtract the number of evens from $840$ to get the number of odds.
Another way: (that I like less). There are $3$ ways to choose the last digit. Once we have chosen this, there are $6$ digits left. We must choose a $3$-digit number, with all digits distinct and chosen from these $6$, to put in front of the chosen last digit. This can be done in $P(6,3)$ ways, for a total of $(3)P(6,3)$.
You say you have $9000$ four-digit numbers.
To count numbers with no consecutive repeat digits is quite easy: you say you have $9$ choices for the first digit; given the first you have $10-1=9$ choices for the second; given the second you have $9$ choices for the third; given the third you have $9$ choices for the fourth.
$$\dfrac{9^4}{9 \times 10^3} = 0.729$$ so if this is what you were trying to do then you have made a mistake.
(Added) If alternatively you are looking for the numbers which do not have any consecutive $5$s, the easiest way to count is to look at those which do, as you attempted.
There are three possible patterns of the forms 55AA
, B55A
or CD55
where A
is any digit , B
is any digit except $0$ or $5$, C
is any digit except $0$, and D
is any digit except $5$. So there are $10\times 10 + 8 \times 10 + 9\times 9 = 261$ four-digit numbers which have consecutive $5$s and so $9000-261 = 8739$ which do not.
$$\dfrac{8739}{9000} = 0.971$$ so again you have an error, but much closer this time. You might try to spot how you have over counted the second two patterns
Best Answer
You made two errors:
First, we observe that there are $9 \cdot 10 \cdot 10 \cdot 10 = 9000$ four-digit positive integers.
Let $A_1$ be the set of four-digit positive integers in which the thousands place and hundreds place contain equal even digits. Let $A_2$ be the set of four-digit positive integers in which the hundreds place and tens place contain equal even digits. Let $A_3$ be the set of four-digit positive integers in which the tens place and units place contain equal even digits. Then $A_1 \cup A_2 \cup A_3$ is the set of four-digit positive integers that do contain consecutive equal even digits. By the Inclusion-Exclusion Principle, the number of four-digit positive integers that do contain consecutive even digits is $$|A_1 \cup A_2 \cup A_3| = |A_1| + |A_2| + |A_3| - |A_1 \cap A_2| - |A \cap A_3| - |A_2 \cap A_3| + |A_1 \cap A_2 \cap A_3|$$
$|A_1|$: Since we cannot use zero, there are four ways of choosing the even digit that occupies both the thousands and hundreds place. There are ten choices for each of the remaining digits. Hence, $|A_1| = 4 \cdot 10 \cdot 10 = 400$.
$|A_2|$: Since we cannot use zero, the thousands place can be filled in nine ways. There are five ways to choose the even digit that fills both the hundreds and tens places. There are ten ways to fill the units place. Hence, $|A_2| = 9 \cdot 5 \cdot 10 = 450$.
$|A_3|$: We can fill the thousands place in nine ways and the hundreds place in ten ways. There are five ways to choose the even digit that occupies both the tens and units places. Hence, $|A_3| = 9 \cdot 10 \cdot 5 = 450$.
$|A_1 \cap A_2|$: Since we cannot use zero, there are four ways to choose the even digit that occupies the thousands, hundreds, and tens places. There are ten ways to fill the units place. Hence, $|A_1 \cap A_2| = 4 \cdot 10 = 40$.
$|A_1 \cap A_3|$: There are four ways to choose the even digit that occupies both the thousands and hundreds places and five ways to choose the even digit that occupies both the tens and units places. Hence, $|A_1 \cap A_3| = 4 \cdot 5 = 20$.
$|A_2 \cap A_3|$: There are nine ways to fill the thousands place. There are five ways to choose the even digit that occupies the hundreds, tens, and units places. Hence, $|A_2 \cap A_3| = 9 \cdot 5 = 45$.
$|A_1 \cap A_2 \cap A_3|$: Since we cannot use zero, there are four ways to choose the even digit that occupies the thousands, hundreds, tens, and units places. Hence, $|A_1 \cap A_2 \cap A_3| = 4$.
Therefore, the number of four-digit positive integers that do contain consecutive even equal digits is \begin{align*} |A_1 \cup A_2 \cup A_3| & = |A_1| + |A_2| + |A_3| - |A_1 \cap A_2| - |A \cap A_3| - |A_2 \cap A_3| + |A_1 \cap A_2 \cap A_3|\\ & = 400 + 450 + 450 - 40 - 20 - 45 + 4\\ & = 1199 \end{align*} Therefore, the number of four-digit positive even integers that do not contain consecutive equal even digits is $9000 - 1199 = 7801$.