0

Find the number of n-digit numbers whose sum of the digits is 11.

How do I go about approaching this question, using P.I.E?

This is what I tried.

n = 11, when 1 + 1 + 1 + ... + 1 n = 2 when 5 + 6

hilh
  • 83

1 Answers1

0

This is just stars and bars over the digits of the $n$-digit number, under the condition that the highest digit is non-zero.

So, the question is equivalent to asking how many ways are there to pick non-negative solutions to $$x_1+x_2+...+x_n=10$$To which the answer is $$n+9\choose 10$$

The issue is that we need to ensure that $x_1<9$, $x_2,...,x_n<10$. So, that is a total of $2n-1$ cases to remove. So our final answer is $$\color{red}{{n+9\choose10}-2n+1}$$

Rushabh Mehta
  • 13,663
  • I get that the n + 9 comes from n + 10 - 1, but where does the 10 come from? Using stars and bars shouldn't it be $$ {10 + n -1 \choose n -1}$$ – hilh Nov 25 '19 at 03:49
  • hilh: ${n\choose k}={n\choose n-k}$, Don: I think you are missing that $x_n$ is a digit, so $x_n<10$. Also, it is $11$ not $10$. – farruhota Nov 25 '19 at 03:51
  • Shouldn't it be n - 1? Not 2n - 1 because there's a total of n numbers? – hilh Nov 25 '19 at 04:07
  • @hilh There are $n$ cases where one of them is non-zero and the rest are $0$. But, there are $n-1$ cases where the first one is $9$ and one of the others is $1$, and the rest $0$. – Rushabh Mehta Nov 25 '19 at 04:10
  • So the final answer should be $$ {n + 10 \choose 11} - 2n + 1$$. Since it's 11 not 10 – hilh Nov 25 '19 at 04:15
  • No, @farruhota was incorrect. The first digit has to be at least $1$, so we can only allocate $10$. – Rushabh Mehta Nov 25 '19 at 04:23
  • 1
    Originally: $x_1+x_2+\cdots+x_n=11, 1\le x_1\le 9,0\le x_i\le 9,2\le i\le n$. – farruhota Nov 25 '19 at 04:29
  • @farruhota I made $x_1=$ the highest digit $-1$. – Rushabh Mehta Nov 25 '19 at 04:30