0

I am doing some practice in counting, and came to this question:

For how many integers from $1$ through $99999$ is the sum of their digits equal to $10?$

I am unsure, how to handle this question - anyone that got a idea of, how to do this kind of questions?

TheFermat
  • 365
  • 1
  • 5
  • 15

6 Answers6

2

Since you ask for the numbers $1$ through $99999$, you are interested in at most $5$-digit integers. An equivalent formulation of this problem is as following: the number of integer solutions to the equation: $$x_1 + x_2 + x_3 + x_4 + x_5 = 10,$$ where $0 \leqslant x_i \leqslant 9$. If we take out the restriction $x_i \leqslant 9$, we have, by the basic formula, $${10 + 5 - 1 \choose 10} = {14 \choose 10} = {14 \choose 4} = 1001.$$ This restriction is responsible for exactly $5$ solutions since each $x_i < 10$. Then the number of solutions with keeping our restriction is $1001 - 5 = 996$.

I acknowledge N. F. Taussig for pointing out to my carelessness.

1

Count the number of ways of assigning values (any values) to non-negative integers $x,y,z,u,v$ that add up to $10$, using the algorithm in this answer of mine (with $14$ instead of $20$, and four instead of three). Then subtract $5$ to discard the extraneous solutions $(x,y,z,u,v) = (10,0,0,0,0),(0,10,0,0,0)$ etc.

TonyK
  • 68,059
1

You can easily count for $1-100$ that is $a+b=10$ so solutions with stars and bars are $9$ they are $19,...,91$ then for $100-199$ we have $109$ from $110-999$ we have $a+b+c=10$ but three have 10 as one variable so its $66-3=63$ then for $1000-9999$ we can see that $a+b+c+d=10$ with restriction $c\neq 0$ and you can fix a and see solutions for $b+c+d$ same for $5$ digit ones . thats the safest and a neat way to not miss any number

  • The equation $a + b + c = 10$ has $\binom{12}{2} = 66$ solutions in the non-negative integers, but they include those in which one of the variables is equal to $10$. – N. F. Taussig Feb 15 '16 at 16:06
0

It is known in Combinatorics that the number of non-negative solutions of the equation $$x_1+x_2+….+x_k=n$$ is equal to $$\binom {n+k-1}{k-1}$$ Hence for $x_1+x_2=10$ there are $\binom {11}{1}=11$ solutions and we must subtract $(0,10),(10,0)$ so we have the nine solutions $19,91,28,82,37,73,46,64,55$.

For $x_1+x_2+x_3=10$ there are $\binom {10+3-1}{3-1}=66$ so $63$ solutions to be considered since we have to discard the solutions $(10,0,0),(0,10,0),(0,0,10)$.

For $x_1+x_2+x_3+x_4=10$ there are $\binom {13} {3}=715$ so $711$ solutions.

For $x_1+x_2+x_3+x_4+x_5=10$ there are $\binom {14}{4}=1001$ so $996$ solutions.

Thus there are in total $9+63+711+996=\color{red}{1779}$ solutions.

Ataulfo
  • 32,657
0

You can write $10$ as $1+1+1+1+1+1+1+1+1+1$. from 1 through 99,999, the highest number of digits would be 5. Therefore, you can imagine putting these 10 ones into 5 bins. However, some bins are allowed to be empty so they can be 2/3/4/...-digit numbers.

In this case, we are using balls in bins. $C(10+5-1, 10) = 1001$. However, it's possible that a bin might contain 10 balls which are not okay. When a bin contains 10 ones, the others contain nothing. The number of ways that any of the bins contains 10 balls is 6. Therefore, the final answer is $1001 - 6 = 995$.

-1

Hint: There are $5$ digits - So, $a+b+c+d+e = 10$ That is .. there are $5$ boxes and $10$ balls to be put in them. The only condition is that all the balls cannot go into the same box.

Win Vineeth
  • 3,574