1

Given an X sided die, and Y throws, what is the probability that the sum of the throws is greater than or equal to Z?

For example, given a 6 sided die and 5 throws, what's the probability that the sum is at least 10?

I tried to do this by trying to figure out the probability of of each individual possible value, but I couldn't get it to work out. What is the approach to this? Is there an easy programmatic way of figuring this out?

1 Answers1

1

Hint

This problem can be attacked via stars and bars analysis analysis.

General procedure.

Focus on the probability that the Y dice sum to exactly Z.

Form a bijection between the constraints of the problem and the # of non-negative integer solutions to

$$x_1 + x_2 + \cdots + x_Y = (Z - Y).$$


Edit
You have the additional constraint that in the bijected equation, each of the $x_i$ must be $\leq (X-1).$ Here, the two ways of handling the additional constraint are either Inclusion-Exclusion or generating functions.

For an illustration of both methods applied to a single mathSE query, see this.


Recognize that each solution represents an event from the sample space of $X^Y$ equally likely events.

user2661923
  • 35,619
  • 3
  • 17
  • 39
  • So in the example, my target is 10 and above and I know my max value is 30 (throws * max single value). Maybe I'm not understanding this, is this showing me how to get 1 of those numbers? My initial idea was to find the probability of getting a 10, then 11,12, up to 30 and so forth. – Khachatur Mirijanyan Nov 25 '20 at 02:00
  • @KhachaturMirijanyan Yes, if (for example) you wanted to know the probability of getting at least 15, you would calculate separately, the chance of getting exactly $k \in {15, 16, \cdots, 30}.$ Then, for a specific value of $k$ (for example $k = 15$), you would first consider the # of non-negative integer solutions to $x_1 + \cdots + x_Y = (15 - Y).$ Then you would adjust for the fact that each of $x_1, \cdots, x_Y$ must be $\leq (X-1)$ [in the bijected equation]. – user2661923 Nov 25 '20 at 02:10
  • Thanks. I also read the link. It looks very useful. The major difference between what is presented and my problem is that the position of the "bars" is constrained so that there must at least 1 "star" and at most 6 "stars" between 2 "bars". – Khachatur Mirijanyan Nov 25 '20 at 02:16
  • @KhachaturMirijanyan If I were doing this, I would hope to find the general formula as a function of $k$, and then let $k$ range (for example) through ${15, 16, \cdots, 30}.$ Such a general formula may be difficult. I might also add that I strongly suspect that generating functions is the superior approach here (vs Stars and Bars : Inclusion-Exclusion). However, I am unfamiliar with generating functions and I suspect that it has something of a learning curve (unlike Stars and Bars, which is immediate). – user2661923 Nov 25 '20 at 02:17
  • @KhachaturMirijanyan Re your last comment, this is why you have to see this article. This teaches you how to handle the constraint of the max value on any one die. – user2661923 Nov 25 '20 at 02:19
  • I was reading your part of the answer for the article you linked. Why is the multiplication alternating from negative to positive as you move from 0 out of bounds variables to 1 out of bounds variable to 2 out of bounds variables? If you were picking numbers such that you could be doing the computation or up to 5 out of bounds variables, would you be constantly switching back and forth from addition to subtraction? – Khachatur Mirijanyan Nov 25 '20 at 05:05
  • @KhachaturMirijanyan "Why is the multiplication alternating from negative to positive as you move from 0 out of bounds variables to ...". I am assuming that you intend - why is the addition alternating from negative to positive, re my computation of $T_1 - (T_2 + T_3 + T_4) + (T_5 + T_6 + T_7)$? To understand this alternation, first see this. ...see next comment – user2661923 Nov 25 '20 at 05:34
  • @KhachaturMirijanyan The backbone of Inclusion-Exclusion, as I used it in the linked answer, is that each [out of bounds category] is subtracted then added then subtracted then added ... so that the net effect is that the out of bounds category is subtracted once. For example, the out of bounds category of the first constraint and the second both being violated is subtracted (by $T_2$), subtracted by ($T_3$), and then added back (by $T_5$). – user2661923 Nov 25 '20 at 05:35
  • The reason I ask is because I tried to programmatically solve the problem programmatically using the example given above with a 6 sided die and 5 throws for different target values. The problem is that at some point I start getting negative values. I establish I have dice d1, d2, d3, d4, and d5 all with the equation 1 <= dn <= 6. If I were trying to find all ways to get to the sum of 22, I would have equation d1 + d2 + d3 + d4 + d5 = 22. I then transform the equations down to 0 <= dn <= 5 and d1 + d2 + d3 + d4 + d5 = 17. Would all that be correct? – Khachatur Mirijanyan Nov 25 '20 at 05:46
  • If it is then I do nCr with 0 out of bounds using the stars and bars equation which would be 21C4. Then with 1 out of bounds value, I would have 15C4 since we do 21 - 6, which is out of bounds of the equation 0 <= d1 <= 5. Since the equations for all the dice are the same I would do 21C4 - (5 * 15C4). Then due to the inclusion-exclusion principle I would then add (5 * 9C4). The resulting equation is 21C4 - (5 * 15C4) + (5 * 9C4) = -210. But this can't be right since you can't end up with a negative number. Which means the math is off somewhere. – Khachatur Mirijanyan Nov 25 '20 at 05:57