# We have a sequence of 10 digits, how many ways are there that the sum of all the digits to this sequence are even

We have a sequence of $$10$$ digits, how many ways are there that the sum of all the digits results into an even number?

Examples: $$2464244482$$, the sum of all the digits is an even number.

My Attempt

I listed out a few trails and saw that I need a even number of odd digits, and a even number of even digits.

\begin{aligned} \text{Odd} && \text{Even} \\ 0 && 10 \\ 2 && 8 \\ 4 && 6 \\ 6 && 4 \\ 8 && 2 \\ 10 && 0 \end{aligned} Now the problem is I don't know how to put this into a combinations and permutations setting: My initial thought was: $$\binom{5}{1}^{10} + \binom{5}{1}^{8}\binom{5}{1}^{2} + \binom{5}{1}^{6}\binom{5}{1}^{4} + \binom{5}{1}^{4}\binom{5}{1}^{6} + \binom{5}{1}^{2}\binom{5}{1}^{8} + \binom{5}{1}^{10}$$ The English to what is above, "Choose an even digit from the group of even digits and we will do this $$10$$ times, or we choose an even number $$8$$ times then choose an odd number $$2$$ times." We keep doing this until we have gone through all the cases.

Is this a correct way of doing this, and is there a more simple way of solving this?

• Pick the first nine digits in a random manner, let us fix such a configuration. Consider the event $A$ of all possibilities to pick now the tenth digit. In the cases $0,2,4,6,8$ we have one parity, in the other cases, $1,3,5,7,9$ the other parity. So constrained by $A$, the (conditional) probability to get an even number is $1/2$. So the wanted probability is $1/2$... Commented Sep 7, 2022 at 16:55
• @dan_fulea Except that leading zeros are usually not allowed. Commented Sep 7, 2022 at 16:56
• @Peter pick them so that they are allowed. (So do not pick the first one randomly among $0,1,2,3,4,5,6,7,8,9$, the second one... but pick them as a whole from the set of all possible first nine digits.) Commented Sep 7, 2022 at 16:59
• @Peter, leading $0$s are allowed. Should of put in OG question. Commented Sep 7, 2022 at 17:05
• Fixing your attempt, $5^{10}+\binom{10}{2}5^{10}+\binom{10}{4}5^{10}+\binom{10}{6}5^{10}+\binom{10}{8}5^{10}+5^{10} = 5^{10}\cdot (\binom{10}{0}+\binom{10}{2}+\dots+\binom{10}{10}) = 5^{10}\cdot 2^9$ where the last simplification relies on this. Commented Sep 7, 2022 at 18:03

(The problem was solved but in comments)

You'll note that everything ultimately matters on the last digit that you choose.

For any $$10$$-digit number that you take, the first $$9$$ numbers will return either an Even or an Odd sum and correspondingly you'll then be left with $$5$$ choices to choose your final, that is, the $$10^{th}$$ digit.

Suppose the sum of the $$1^{st}$$ $$9$$ digits is Odd then you must choose a number from $$\{1,3,5,7,9\}$$ to get an even sum.
Suppose the sum of the $$1^{st}$$ $$9$$ digits is Even then you must choose a number from $$\{0,2,4,6,8\}$$ to get an even sum.

Now we simply have to count the number of ways of choosing the numbers.
For each of the $$1^{st}$$ $$9$$ digits, we have $$10$$ choices - $$\{0,1,2,3,4,5,6,7,8,9\}$$
But the last last digit can only take $$5$$ values for whether we have an Odd or an Even sum of the first $$9$$ digits to get a resultant even sum.
Thus, the total number of ways that the sum of all the digits results into an even number is $$\boxed{5\cdot10^9}$$