Lottery Combinations – Sum of All Numbers

combinationscombinatoricslotteries

In the 6/49 lottery game, there are 13,983,816 total combinations. My question is, how many combinations are there of a particular sum when adding all 6 of the 49 numbers together. For example:

6, 16, 22, 29, 36, 43 = 152 when adding all 6 numbers together.

5, 17, 22, 29, 36, 43 = 152 also.

4, 16, 21, 28, 35, 42 = 146. Therefore, this combination would be excluded from the total as its sum isn't 152.

Going with the example above, is there a way to calculate the total number of combinations for a specific sum (in this case 152)? Please let me know what the total number of combinations are and how the calculation is done to easily calculate combinations with other sums.

Thank you!

Best Answer

You want to count the integer solutions to $$x_1+x_2+\dots+x_6=152$$ with $$1 \le x_1 < x_2 < \dots < x_6 \le 49.$$ The generating function is $$\prod_{k=1}^{49} (1+x^k y),$$ and you want the coefficient of $x^{152} y^6$, which turns out to be $165490$.


Alternatively, let $f(n,k,p)$ be the number of integer solutions to $$x_1+x_2+\dots+x_k=n$$ with $$1 \le x_1 < x_2 < \dots < x_k \le p.$$ You want to compute $f(152,6,49)$. Conditioning on $x_k=j$ yields recurrence $$f(n,k,p)=\sum_{j=1}^p f(n-j,k-1,j-1)$$

Related Question