1

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?

James
  • 742
  • 5
    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$... – dan_fulea Sep 07 '22 at 16:55
  • @dan_fulea Except that leading zeros are usually not allowed. – Peter Sep 07 '22 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.) – dan_fulea Sep 07 '22 at 16:59
  • @Peter, leading $0$s are allowed. Should of put in OG question. – James Sep 07 '22 at 17:05
  • @James Well , then there is nothing to add to dan fuleas comment. – Peter Sep 07 '22 at 17:08
  • @dan_fulea, picking the first nine digits in random order can be done in $10^9$ ways? When it comes to the last digit, we have $5$ ways to choose an even and $5$ ways to choose an odd, and the probability is $\frac{1}{2}$? Do we multiply this together if I am thinking of this in the correct manner? – James Sep 07 '22 at 17:10
  • You do not even need conditional probabilities : The numbers with starting digits $0,2,4,6,8$ correspond $1-1$ with the numbers starting with $1,3,5,7,9$ with all other digits equal. And every pair has different digitsum parity. Hence the number of numbers with even digitsum coincides with the number of numbers with odd digitsum. – Peter Sep 07 '22 at 17:13
  • @OP No, no multiplication... Imagine a big space separated / partitioned in pieces (of possibly different sizes - not our case, the "pieces" have same size, five) so that for each "good" piece $A_1$ there is a (bijectively associated) "bad" piece $A_2$ with the same probability. Then the probability of the good pieces is the same as the probability of the bad pieces. Since we have a partition, each piece being either good or bad, the good pieces cover half the total probability. (As the bad ones do.) – dan_fulea Sep 07 '22 at 17:29
  • @dan_fulea, so we are saying that $|A_{1}| = |A_{2}| = 5$, leading to that we have $5^{10}$ good pieces or $5^{10}$ bad pieces? – James Sep 07 '22 at 17:44
  • "Yes", but let us count carefully, for each (telephone) number $A$ with nine digits, associate $A_1$ to be the set of the five even sum ten digits (phone) numbers starting with $A$. There are $10^9$ choices for $A$. Then the union of the associated $A_1$'s has$$5\cdot 10^9$$ elements. The half of the whole set. – dan_fulea Sep 07 '22 at 17:53
  • Dan is saying that $|A_1|=|A_2|=$we don't actually care to take the time to calculate, and that $A_1\cap A_2=\emptyset$ and $A_1\cup A_2=S$ our sample space, with $|S|=$we don't actually care to take the time to calculate... so it follows that the probability is $\frac{1}{2}$. If we did care to calculate, we would find following from the earlier comments that $|A_1|=10^9\cdot 5 = |A_2|$ and that $|S|=10^{10}$, again finding that $\frac{|A_1|}{|S|}=\frac{10^9\cdot 5}{10^{10}}=\frac{1}{2}$ – JMoravitz Sep 07 '22 at 17:55
  • As for your attempt in the initial post... a few comments... Do not ever bother writing a binomial coefficient with the bottom number being a $1$ if it appears by itself. It looks messy. Since $\binom{n}{1}=n$ you can get away with much less writing by just writing $n$. Next, your attempt had counted incorrectly since the numbers you wrote did not take into consideration the pattern in which odds and evens appeared. You effectively only counted those where the leading numbers were all odds and the ending numbers were all evens. – JMoravitz Sep 07 '22 at 18:00
  • 1
    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. – JMoravitz Sep 07 '22 at 18:03
  • @dan_fulea I wonder why you didn't post an answer? – InanimateBeing Sep 08 '22 at 16:05
  • @InanimateBeing It is in my eyes always a good idea to help OP find a better path, possibly answering the own question. In such cases, i always comment on the answer - if details are maybe not close to rigour, and give credit to a well written answer and/or to the effort to write the answer. Also, the discussion in the comments would not exist after a quick answer... I am still encouraging the OP to answer the own question... – dan_fulea Sep 08 '22 at 16:20
  • @dan_fulea you could have dropped a hint too as an answer and that's not seen in bad light, rather appreciated. Many find them helpful. Currently, the question is simply open despite solved and I didn't write one as you already solved it, so asked. – InanimateBeing Sep 08 '22 at 16:25
  • Ummm... half are even, half are odd.... no? – David G. Stork Sep 12 '22 at 17:10

1 Answers1

1

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