0

Is there an efficient way of calculating the sum of multiple die $\ge x$? For example, if we rolled $12$ fair $6$-sided die, what is the probability the sum is at least $45$?

My only approach as of now is using central limit theorem to approximate this however, I am not sure if a number like $12$ is large enough.

shrizzy
  • 784
  • 4
  • 17
  • 1
    For small numbers, recursive means are good (having solved it for $N-1$ dice, you just consider the $6$ possible cases for the $N^{th}$). Beyond that, I'd use a normal approximation, as you propose. – lulu Apr 01 '23 at 14:04
  • Using recursive methods as @lulu suggests, 64-bit integers can directly handle all sums for up to 24 dice. The processing time required is on the order of a few microseconds. Double-precision floating-point arithmetic can handle nearly 400 dice in a few milliseconds, with results that are likely more accurate than you would ever need. – Daniel Mathias Apr 01 '23 at 19:15
  • With regard to the use of a normal approximation based on the Central Limit Theorem, you might take a look at this question: https://math.stackexchange.com/questions/4623008/probability-for-total-score-after-rolling-a-die-n-times/4623656#4623656 – awkward Apr 02 '23 at 23:16

1 Answers1

1

If you want an exact computation, can use generating functions like here.

In our case, you have to expand :

$$\left(\frac16(x+x^2+x^3+x^4+x^5+x^6)\right)^{12}\tag{1}$$

$$=\frac{1}{6^{12}}\left(x^{12}+12x^{13}+ \cdots +12x^{71}+ x^{72}\right)^{12}$$

and sum the coefficients that are $\ge 45$, a task that must be done with a computer.

I have done it and I find this sum equal to :

$$P(S \ge 45)=\frac{735884981}{6^{12}}\approx 0.3381$$

(Thanks to Daniel Mathias who spotted an error, now corrected).

Here is the Matlab program I have written for this purpose ; please note the use of the convolution operation :

 n=12; % number of throws
 t=45; % threshold
 C=[1]; % initialisation of the list of coeff.
 U=[0,ones(1,6)]; % list of coeff. of x+x^2+...+x^6
 for k=1:n;
    C=conv(C,U); % convolution
 end;
 sum(C((t+1):end))/6^(n)
Jean Marie
  • 88,997
  • The normal approximation with continuity correction would be about $0.3363$ using 1-pnorm(44.5,42,sqrt(35)) in R. So quite close with an absolute error of about $0.0018$. The largest absolute error with $12$ dice is about $0.0022$, worst when you are looking at at least $38$ or $47$ – Henry Apr 01 '23 at 17:29
  • @Henry How does it compare with 24 dice? $P(S>=90)\approx 0.2565504665$ – Daniel Mathias Apr 01 '23 at 18:50
  • @Daniel Mathias : No comparison possible, because there is no reason that there is linearity. – Jean Marie Apr 01 '23 at 19:00
  • I meant to compare the result from normal approximation applied to 24 dice, how good is such approximation then? – Daniel Mathias Apr 01 '23 at 19:08
  • @DanielMathias 1-pnorm(90-0.5,24*3.5,sqrt(24*35/12)) gives 0.2554697 so an absolute error of about $0.0011$, very close to the worst absolute error with $24$ dice when you are looking at at least $78$ or $91$ – Henry Apr 01 '23 at 20:02
  • Any comment ?... – Jean Marie Apr 02 '23 at 12:33