Saturday, 11 March 2017

probability - Roll above target number with n six-sided die?



Couldn't find this on the site, despite the number of die questions.



If I have n six-sided die, how can I find the probability of rolling above x (some target number) with the total sum?



Examples for clarification:





example 1. If I have 3 die, I want to roll equal to or greater than a total sum of 12. What is the probability that I would roll equal to or over it?



example 2. If I have 4 die, I want to roll equal to or greater than a total sum of 5. What is the probability that I would roll equal to or over it?




Just for full disclosure... I am not the most "mathy" person.


Answer



You can use the moment generating function as illustrated nicely in this online document.



Then PMF of the sum of $n$ six-sided fair die can be retrieved like out of a clothesline from:




$$M_X(t)=\frac{1}{6^n}(e^t+e^{2t}+\cdots+e^{6t})^n\tag 1$$



My attempt at giving an intuition of what MGF are can be found here. The way to look at it is ignoring the exponential part, and just regarding it as some sort of placeholder that is intended to give us back (taking advantage of the rules of exponents) all the possible combinations of throws that add up to the value you are interested in in a systematic way. The "magic" is that that number ends up conveniently placed in front of the exponent ready to be culled.



So in the case of $2$ fair dice $(k=2)$ the probability of each possible sum is given by the numbers in red, and the sum ($X=x$) by the blue-coded exponents:



\begin{align}\small M_X(t)&=\color{red}{\frac{1}{36}}(e^t+e^{2t}+\cdots+e^{6t})^2\\&\small=\left(\color{red}{\color{red}{\frac{1}{36}}\,}e^{\color{blue}{2}t} + \color{red}{\frac{2}{36}}e^{\color{blue}{3}t} + \color{red}{\frac{3}{36}}e^{\color{blue}{4}t} + \color{red}{\frac{4}{36}}e^{\color{blue}{5}t} + \color{red}{\frac{5}{36}}e^{\color{blue}{6}t}+ \color{red}{\frac{6}{36}}e^{\color{blue}{7}t}+ \color{red}{\frac{5}{36}}e^{\color{blue}{8}t}+ \color{red}{\frac{4}{36}}e^{\color{blue}{9}t}+ \color{red}{\frac{3}{36}}e^{\color{blue}{10}t}+ \color{red}{\frac{2}{36}}e^{\color{blue}{11}t}+ \color{red}{\frac{1}{36}}e^{\color{blue}{12}t}\right)\end{align}



You can directly read out that the probability of throwing two fair dice and the result adding up to $6$ is the same as the outcomes adding up to $8$, and in both cases it is $\frac{5}{36}.$







Regarding Eq. 1, some details:




  1. MGF of a discrete random variable is:



$$M_X(t)= E\left[e^{tX}\right]=\sum_{i=1}^{\infty}p_i \, e^{tx_i}$$





  1. In the case of a single die, the mgf is:



$$M_X(t)=\mathbb E\left[e^{tX}\right]=\sum_{i=1}^{6}\frac{1}{6} \, e^{tx_i}=\frac{1}{6}(e^t + e^{2t} + e^{3t}+\cdots+e^{6t})$$




  1. The random variable defined on the sum $S$ of $n$ dice will be the multiplication of the mgf for one single die (independent):




$$M_s(t)=\mathbb E\left[e^{t(X_1+\cdots+X_n)}\right]=\prod_{i=1}^n \mathbb E[e^{tX_i}]$$






PARALLEL SOLUTION WITH PROBABILITY GENERATING FUNCTIONS (PGF):



As in the comment, for a single die roll:



$$G(z) =\mathbb E[z^X] =\sum_{x=1}^6 \frac{1}{6}z^x =\frac{1}{6}(z + z^2 + z^3 + z^4 + z^5 + z^6) =\frac{1}{6} z \, \frac {1 - z^6}{1-z} $$




And for $n$ dice the PGF will be:



$$G(z)=\frac{1}{6^n}\,z^n\,(1-z^6)^n\,(1-z)^{-n}$$



... and continuing with the comments:



the probability for a given sum (s) will be found in front of $z^s$ once we expand this expression. However, I get stuck here, and find this resource online, where the pgf is finally expressed as (I'm transcribing what follows to be consistent with the notation so far):



$$G(z)=\frac{1}{6^n}\left(z^n\left[\sum_{s=0}^{n} \binom{n}{s}(-1)^s x^{6s} \right]\color{blue}{\left[\sum_{j\geq 0}\binom{-n}{j} (-1)^j x^j\right]} \right)$$




where the negative exponent part is a Taylor series.



The coefficient for each possible sum $s = m$ will be given by:



$$\sum_{6s+j=m+n}\binom{n}{s}\binom{n+j-1}{j}(-1)^s$$


No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...