Sum of roll of N dice
|
05-05-2018, 06:38 PM
(This post was last modified: 05-06-2018 05:24 PM by Dieter.)
Post: #31
|
|||
|
|||
RE: Sum of roll of N dice
(05-04-2018 06:35 PM)michaelzinn Wrote: The "shape" of the lookup table is very regular, so maybe there is an easy way to calculate the distribution directly from the random number. There is a way to calculate the distribution, i.e. the probabilty for a sum of n, n+1, n+2, ... 6n. I found this PDF (in German) that shows an interesting approach: Expand (x+x^2+x^3+x^4+x^5+x^6)^n to get a polynomial of degree 6n. Here the coefficient at x^k divided by 6^n is the probability for a sum of k. Example for n=3: (x+x^2+x^3+x^4+x^5)^3 = x^3+3x^4+6x^5+10x^6+15x^7+21x^8+25x^9+27x^10+27x^11+25x^12+21x^13+15x^14+10x^15+6x^16+3x^17+x^18 So the expected frequency for k=9 is 25, and the probability for a sum of 9 is 25/216. I haven't checked the mathematical background, but it can't be too difficult: the PDF is from nibis.de, a web portal for education in the schools of Lower Saxonia, Germany. ;-) Dieter Edit: the expanded polynomial of course has powers up to 6n. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)