0

How many positive integers less than $1,000,000$ have the sum of their digits equal to $19?$

In the solution they have assumed number of digit to be $6$ HOW? as $d_1,d_2,d_3,d_4,d_5,d_6$ and proceeded as $d_1+d_2+d_3+d_4+d_5+d_6=19$ here by using counting theorem we get number of solution to be $C(19+6-1,19)=42504$ ..now how to find the number of solutions in which the restriction is violated.??

  • 1
    Isn't this the same thing than your last question http://math.stackexchange.com/questions/1909525/counting-using-permutation-and-combination/1909548#1909548 but with $d_i \leq 9$? – Vincent Aug 31 '16 at 11:25
  • Show your attempt? – Mithlesh Upadhyay Aug 31 '16 at 11:30
  • Here 0 ≤ di ≤ 9 ,i=1,2,...9 but in the solution why they have selected 6 digit ?that's my 1s't question @vincent – sourav_anand Aug 31 '16 at 11:31
  • My attempt -:As per the solution let us take 6 digit contributing to make the sum 19 (which i want to know why?) now we have equation as d1+d2+d3+d4+d5+d6=19 so number of possible solution is C(19+6-1,19)=42504 in this many number of soution there must be some number which violates the rule (of sum not equal to 19) we need to find it and subtract it from 42540 to get the solution(this my second doubt) @MithleshUpadhyay – sourav_anand Aug 31 '16 at 11:39
  • There are $6$ "boxes", so to say, to accommodate $6$ digits:(numbers $000000-999999$), and apply inclusion-exclusion to eliminate rule violations. – true blue anil Aug 31 '16 at 14:36

1 Answers1

1

$C(24,5)$ counts the number of weak integer compositions of $19$ into $6$ parts. You can think of this as taking $19$ sticks and throwing in $5$ more sticks to represent partitions. With those $24$ sticks in a row, you choose $5$ of them to be the partitions and the ones between the sticks represent the sum. For example, if we let "|" represent the partition and let each integer represent the number of sticks between, 6|3|4|0|1|5 is a composition of 19.

From there, we want a bijection between integer compositions and numbers less than $1,000,000$ through the obvious way- that is, each place in the composition represents a place in the base $10$ representation. For example, the above composition would go to $634,015$. However, there is a problem: you could have, for example, a composition like $19|0|0|0|0|0$, but $19$ is not a digit, so you'll need to eliminate the compositions with parts greater than or equal to $10$.

It's here that you're grateful to the creator of the problem that they used $19$ instead of $20$, which was a kind, and likely intentional choice, as you can only have at most one part greater than $10$. Now you only have to assume that one part is at least $10$ and split the remaining $9$ among the six parts. The number of ways to do that is the number of "bad" compositions that you need to remove. Try to see what you can come up with from here.

Kevin Long
  • 5,159