Will you count the numbers?

How many positive 4-digit integers are there such that the sum of digits is odd?


The answer is 4500.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Zee Ell
Aug 3, 2016

It is easy to see, that the sum of the digits (Sd) can only be odd, if we have an odd number of odd digits.

In the case of the four digit numbers, this means, that we either have one or three odd digits and the rest of the digits are even.

We can choose both the odd {1,3,5,7,9} and the even digits {0,2,4,6,8} from the sets with 5 elements each, with repetition. We have to be careful with the 0 though, as it cannot be our first digit (as e.g. 0654 is not a four digit number).

1.) case: we have 3 odd digits and 1 even digit:

We can choose the 3 odd digits 5 × 5 × 5 = 125 ways and the non-zero even digits 4 ways, plus the 0 one way. Now, we can put the non-zero even digits to all four places, but the 0 can be one of the last three digits only.

Hence, the number of odd-Sd integers in this case:

5 3 × ( 4 × 4 + 1 × 3 ) = 125 × 19 = 2375 5^3 ×(4 × 4 + 1 × 3) = 125 × 19 = 2375

2.) case: We have 1 odd and 3 even digits:

Once again, it makes sense to separate 2 possibilities (sub-cases):

a) In this case, the odd digit is our first digit, which gives us a convenient choice from 5 for each digit, meaning the number of relevant values is:

5 × 5 × 5 × 5 = 625 5 × 5 × 5 × 5 = 625

b) The odd digit is not the first digit of our number:

This means, that the first digit is even and cannot be 0, so we can choose it 4 ways, the other 3 digits 5 ways (each) and the place of the odd digit 3 ways:

4 × 5 × 5 × 5 × 3 = 1500 4 × 5 × 5 × 5 × 3 = 1500 odd-Sd numbers here.

Therefore, our solution should be

2375 + 625 + 1500 = 4500 2375 + 625 + 1500 = \boxed {4500}

Anubhav Tyagi
Dec 22, 2016

Let the number be x 1 x 2 x 3 x 4 9 x 1 1 ; 9 x 2 , x 3 , x 4 , 0 , where x 1 , x 2 , x 3 , x 4 N Number of ways of choosing x 1 = ( 9 1 ) Number of ways of choosing x 2 = ( 10 1 ) Number of ways of choosing x 3 = ( 10 1 ) CASE 1:If the sum of the 3 digits is odd, then x 4 can be chosen in ( 5 1 ) i.e. any odd digit to make sum even. CASE 2:If the sum of the 3 digits is even, then x 4 can be chosen in ( 5 1 ) i.e. any even digit to make sum even. Thus in any case there are 5 ways of choosing x 4 Thus total 4-digit numbers with sum of digits even is = 9 × 10 × 10 × 5 = 4500 \begin{aligned} &\text{Let the number be } x_1 x_2 x_3 x_4\\ & 9\geq x_1 \geq 1 ;9\geq x_2, x_3, x_4, \geq 0, \text{where } x_1, x_2, x_3, x_4 \in N \\ &\text{Number of ways of choosing } x_1 = {9\choose 1}\\ &\text{Number of ways of choosing } x_2 = {10\choose 1}\\ &\text{Number of ways of choosing } x_3 = {10\choose 1}\\ &\text{CASE 1:If the sum of the 3 digits is odd, then } x_4 \text{ can be chosen in }{5\choose 1} \text{i.e. any odd digit to make sum even.}\\ &\text{CASE 2:If the sum of the 3 digits is even, then } x_4 \text{ can be chosen in }{5\choose 1} \text{i.e. any even digit to make sum even.}\\ &\text{Thus in any case there are 5 ways of choosing } x_4 \\ &\text{Thus total 4-digit numbers with sum of digits even is } = 9\times10\times10\times5 = \text{ 4500} \\ \end{aligned}

@Zee Ell , @Aman Dubey - Here is an easy solution to the problem.

Anubhav Tyagi - 4 years, 5 months ago

@Pi Han Goh - Check this one as well

Anubhav Tyagi - 4 years, 5 months ago

Log in to reply

Very neat!!

Pi Han Goh - 4 years, 5 months ago

Log in to reply

Thanks. Can you do something to add me to slack team again. Actually I accidentally deleted my account.

Anubhav Tyagi - 4 years, 5 months ago

Log in to reply

@Anubhav Tyagi Go here

Pi Han Goh - 4 years, 5 months ago

Log in to reply

@Pi Han Goh It says unknown user_user diabled

Anubhav Tyagi - 4 years, 5 months ago

Log in to reply

@Anubhav Tyagi Register with another account then....

Pi Han Goh - 4 years, 5 months ago

Log in to reply

@Pi Han Goh I do not have any other email-ID. What should I do then?

Anubhav Tyagi - 4 years, 5 months ago

Log in to reply

@Anubhav Tyagi Create another account, it's free...

Pi Han Goh - 4 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...