How many positive integers $<1,000,000,000$ have exactly one digit equal to $9$ and have the sum of digits equal to $13$?
I have:
$x_1 + x_2 + x_3 + x_4 + x_5 + x_6 + x_7 + x_8 + 9 = 13$
$x_1 + x_2 + x_3 + x_4 + x_5 + x_6 + x_7 + x_8 = 4$
Then I use ${{n+k-1}\choose k}$:
${11\choose 4}$ = 330
Then $330*9 = 2970$.
So there are $2970$ integers that satisfy the problem.
My questions:
First, is this correct?
Second, why/when should I use ${{n+k-1}\choose k}$ over ${{n+k-1}\choose k-1}$
Third, when using the stars and bars approach, would this be a correct example for this problem:
.|...|..|..