от nevrodermit » 23 Апр 2016, 20:39
Clearly, the generation function is [tex](x^1+x^2+...+x^F)^N[/tex] because when we roll a F-faced dice we can get the points in the set [tex]\{1,2,..,F\}[/tex] and we roll [tex]N[/tex] such dices.
In order to calculate the probability of getting a sum of [tex]P[/tex] we have to find the coefficient infront of [tex]P[/tex] in the expansion of the expression above.
Th expression is [tex]x^N(\frac{1-x^{F}}{1-x})^N=x^N(1-x^F)^N(1-x)^{-N}=x^N\sum_{i=0}^N(-1)^i{N\choose i}x^{Fi}\sum_{j=0}^{\infty}{N+j-1 \choose i}x^i[/tex]. So the we need [tex]N+Fi+j=P[/tex] and the coefficent is [tex]\sum_{i=0}^N(-1)^i{N\choose i}{P-Fi-1 \choose P-Fi-N}[/tex].