How many 9-digit numbers are there with an even digit sum?

1.2k Views Asked by At

How many 9-digit numbers are there with an even digit sum?

How do I approach this task? I know the answer, but want to see how I need to think about solving it.

My approach to solving this was very long, mechanical and error-prone.

I noticed that the number of odd digits has to be even. And considered these scenarios:

  1. 0 odd numbers, 9 even numbers
  2. 2 odd numbers, 7 even numbers
  3. 4 odd numbers, 5 even numbers
  4. 6 odd numbers, 3 even numbers
  5. 8 odd numbers, 1 even number

Then I considered 2 more cases:

  1. The number can start with an odd digit.
  2. The number can start with an even digit.

This amounts to this:

  1. $4\times 5^8$
  2. $5^9\times {8 \choose 1} + 4\times 5^8\times {8 \choose 6}$
  3. $5^9\times {8\choose 3}+4\times5^8\times{8\choose 4}$
  4. $5^9\times {8\choose 5}+4\times5^8\times{8\choose 2}$
  5. $5^9\times {8\choose 7}+4\times5^8\times{8\choose 0}$

After I added them up I got $9\times 5\times 10^7$.

2

There are 2 best solutions below

0
On BEST ANSWER

This is of course just half of all 9-digit numbers!

To see this, think of just the last digit: since half of those are odd and half are even, that means that whatever sum you have for all the digits preceding it, half will be made even by adding the last digit, and half will be made odd.

OK, and how many 9-digit numbers are there?

Well, the first digit is 1 of 9, and for the others you have 10 choices each. Hence:

$$\frac{1}{2}\cdot 9\cdot 10^8$$

1
On

so you've got 4 different even digits you could start with, then you require 1,3,5,7 of any of the 5 evens

so that would be

$4 \times 5 \times 5^7 \times {8\choose 1} + 4 \times 5^3 \times 5^5 \times {8\choose 3} + 4 \times 5^5 \times 5^3 \times {8\choose 5} + 4 \times 5^7 \times 5 \times {8\choose 7}$

= 12500000 + 87500000 + 87500000 +12500000 = 200000000 - or 2oo million

then for starting with the 5 odd digits is

$5 \times (5^8 + 5^2 \times 5^6 * {8 \choose 2} + 5^4 \times 5^4 * {8 \choose 4} + 5^2 \times 5^6 * {8 \choose 6} + 5^8 \times 5^0 * {8 \choose 0} )$

=250000000

so there are 200 million starting with even digits and 250 million making a total of 450million

I included this for completeness, it's obviously not the simplest solution, it was what I was talking about earlier