Number of nine digits numbers whose sum of the digits is even I am reading Mathematical Circle. Problem $48$ in chapter two says that 

How many nine-digit numbers have an even sum of their digits?

I am trying in this way, that we can divide the problem in four cases. 


*

*$1$ even digit and $8$ odd digits

*$3$ even digits and $6$ odd digits

*$5$ even digits and $4$ odd digits

*$7$ even digits and $2$ odd digits


For the first case we get $4 \cdot 5^8 +5\cdot 5^7 \cdot 5$ number of solution. Because if the even digit is placed in first place (left to right) then we get $4\cdot 5^8$ ways to write the number and if an odd digit is placed in first place then we get $5\cdot 5^7 \cdot 5$ ways to write the number. Similarly for the second case we get $4\cdot 5^8+5^9$ , for the third case we get $4\cdot 5^8+5^9$ and for the fourth case we get $4\cdot 5^8+5^9$ ways to write the number. So total number is $ 4 \cdot (4\cdot 5^8+5^9)$. 
The answer is different. So Where I have made a mistake?
Thanks.

This is an unnecessarily complex solution but shows some combinatorial techniques.
First, we'll count the number of (ordered) sequences of 9 digits where the sum of the digits is even. Then we will subtract the number of such sequences whose first digit is zero.
If the sum of the digits in the 9-digit sequence is even, then we must have an even number of odd digits (which can be 0, 2, 4, or 8). The number of such sequences is:
$$\sum_{n=0,2,4,6,8} {9 \choose n}\times{5^n}\times{5^{9-n}} =\sum_{n=0,2,4,6,8} {9 \choose n}\times{5^9}$$
Among these sequences, the number of the ones that start with $0$ making them non-9-digit numbers is:
$$\sum_{n=0,2,4,6,8} {8 \choose n}\times{5^8} $$
So the total number of 9-digit numbers whose sum of digits is even is:
$${5^8}\times\sum_{n=0,2,4,6,8} 5{9 \choose n}-{8 \choose n} = 450000000$$
