1

Calculate the probability that when we roll $4$ fair $6$−sided die, the sum of their upfaces is $20$.

My Solution:

There exist only the following $5$ possible cases where the sum is $20$ in case of $4$ die rolled:

$ 2666, 3665, 4664, 4565, 5555$

Hence to get the probability, we multiply the number of different arrangements corresponding to each case with its probability: $$P = \frac1{6^4} \cdot \big[{4 \choose 1} + {2\cdot{4 \choose 2}} + {4 \choose 2} + {2\cdot{4 \choose 2}} + 1 \big] = \frac{35}{1296}$$

Question: Is there a better way than the above brute force method to get the answer? This will surely become tedious to solve as the number of die that are rolled increases. For instance, say, we want to calculate the probability that the sum is $50$ when we roll $18$ fair $6$-sided die. How would we go about it then?

Follow up: Is there a generalisation for this? What is the probability that the sum is $k$ when $n$ fair $6$-sided die are rolled?

  • 1
    If you can use wolframalpha you can do something like this for the sum $20$ and $4$ dice example https://www.wolframalpha.com/input?i=20th+derivative+%28%281-z%5E7%29%2F%286%281-z%29%29%29%5E4%2F20%21+where+z%3D0 or for the sum $50$ and $18$ dice problem this https://www.wolframalpha.com/input?i=50th+derivative+%28%281-z%5E7%29%2F%286%281-z%29%29%29%5E18%2F50%21+where+z%3D0 although this isn't very efficient :) –  May 05 '24 at 21:36
  • 1
    For small numbers of dice, if I have a computer algebra system handy, I'd use generating functions. For example, the coefficient of $x^{50}$ in $\left(\frac{x+x^2+x^3+x^4+x^5+x^6}{6}\right)^{18}$ is $126513483013/11284439629824 \approx 0.011211$. For larger numbers of dice, I'd use the normal approximation to the binomial distribution. The sum of $18$ dice has a mean of $63$ and a variance of $105/2$, which yields a standard deviation of about $7.2457$. Applying the continuity correction, the probability of getting a $50$ is about $0.011030$, an error of less than $2$ percent. – Brian Tung May 05 '24 at 21:37
  • @underflow can you explain how did you get that expression? Did you use generating functions as well just as suggested by the other comment? – Devansh Agarwal May 05 '24 at 21:39
  • @BrianTung I'm not very comfortable with generating functions. Can you write an answer explaining the definition of x and how you got that expression from scratch? – Devansh Agarwal May 05 '24 at 21:40
  • @DevanshAgarwal Yes it's the same, I actually made a small mistake in the above links it should be https://www.wolframalpha.com/input?i=20th+derivative+%28z%281-z%5E6%29%2F%286%281-z%29%29%29%5E4%2F20%21+where+z%3D0 and https://www.wolframalpha.com/input?i=50th+derivative+%28z%281-z%5E6%29%2F%286%281-z%29%29%29%5E18%2F50%21+where+z%3D0 –  May 05 '24 at 21:47
  • Can either of you please explain the intuition behind using generating functions in the present context? What exactly does x represent? How do you get the expression? Why do we want to know the coefficient of $x^{50}$? – Devansh Agarwal May 05 '24 at 21:50
  • Think of $x$ just as a symbol. Let's look at $2$ dice. Now look at $\frac{x+x^2+x^3+x^4+x^5+x^6}{6}$, each exponent corresponds to the number the let's say first dice rolls, each $x^k$ has coefficient $\frac{1}{6}$ which is the probability the dice will roll that way. now for two dice you have $\frac{x+x^2+x^3+x^4+x^5+x^6}{6}\frac{x+x^2+x^3+x^4+x^5+x^6}{6}$ and you multiply it out and then let's say the $7$-th coefficient will correspond to the probability/number of ways a $7$ will roll. Maybe best to see it yourself, if you multiply it out you should be able to connect the two things. –  May 05 '24 at 22:12
  • Okay so if I want to get the probability of sum being, say, 9 in the case of 2 die. Then that would be the coefficient of $x^9$ in the expression, right? – Devansh Agarwal May 05 '24 at 22:17
  • 1
    Yes. Like let's say the first dice is $3$ and the second is $6$. This would correspond to $x^3\cdot x^6=x^9$ where $x^3$ is from the first sum and $x^6$ is from the second, so it contributes $\frac{1}{36}$ to the coefficient of $x^9$. –  May 05 '24 at 22:19
  • Got it, just to confirm one more thing: In the wolfram link, you took the $20$th derivative of the expression and have divided the expression by $20!$ as well. This is so that both $20!'s$ cancel out and you are left with just the coefficient of $x^{20}$ from the original expression, correct? – Devansh Agarwal May 05 '24 at 22:21
  • 1
    @DevanshAgarwal Exactly! Need to cancel out the $20!$ which comes from differentiating $x^{20}$ $20$ times. –  May 05 '24 at 22:22
  • This comment thread was very helpful, thank you. Just for closure purposes, can you write a short answer about this method? I'd prefer to accept an answer rather than close the question with no answers, in case someone finds themself at this question in the future. – Devansh Agarwal May 05 '24 at 22:24
  • 1
    Or nevermind, I'll write one on my own. It might be better for me – Devansh Agarwal May 05 '24 at 22:26
  • Sounds like a good idea! –  May 05 '24 at 22:29
  • @underflow If you get time, please have a look through the answer and let me know if there are any conceptual errors. – Devansh Agarwal May 05 '24 at 22:48
  • 1
    Yeah, seems good! I'd add a phrase or two why the coefficient $x^9$ is the probability (you've written correspond which I wouldn't write there, it is the probability). I would add something like "this is because $x^3\cdot x^6$ corresponds to the first dice rolling $3$ and the second $6$" or something like that, but that's just something minor. –  May 05 '24 at 22:53
  • Good point, added that as well. – Devansh Agarwal May 05 '24 at 22:57

1 Answers1

1

Thanks to @underflow for their explanations in the comments:

This generalisation can be done using generating functions.

Let $x$ be some symbol. Consider the expression $\frac{+^2+^3+^4+^5+^6}6$, each exponent corresponds to a number rolled on the die. Here, each $x^k$ has coefficient $\frac16$, which is the probability the dice will roll that way.

Now, consider the case of rolling $2$ die. In this case the expression becomes, $\frac{+^2+^3+^4+^5+^6}6 \cdot \frac{+^2+^3+^4+^5+^6}6$. Multiply it out and then let's say we want to calculate the probability of getting the sum to be 9. For example when we get a $3$ on the first die and $6$ on the second, it is represented by $x^3 \cdot x^6$. Hence, it is becomes evident that the coefficient of $x^9$ in the final expression will correspond to the required probability of getting the sum as 9.

Similarly, in the case of the problem asked: calculate the probability that the sum is 50 when we roll 18 fair 6-sided die, it is given by:

the coefficient of $x^{50}$ in the expression ${\big(\frac{+^2+^3+^4+^5+^6}6}\big)^{18} $; which is found here


Generalising to answer the follow-up:

The probability that the sum is $k$ when $n$ fair $6$-sided die are rolled is given by:

the coefficient of $x^k$ in the expression ${\big(\frac{+^2+^3+^4+^5+^6}6}\big)^{n}$