Say I roll a 6-sided die until its sum exceeds $X$. What is E(rolls)?
Roll summing over a long stretch
135 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 4 best solutions below
On
Let $h(s)$ be the expected number of rolls to exceed $X$, starting with a sum of $s$. Then "first step analysis" gives the recursive formula $h(s)=1+{1\over 6}\sum_{j=1}^6 h(s+j)$ for $0\leq s\leq X$, while $h(s)=0$ for $s>X$. You use this equation to calculate $h(s)$ for $s=X,X-1,X-2,\dots$ and eventually work your way back to $h(0)$, the answer to your question.
The answer $h(0)$ will be very close to $X/3.5$ for large $X$.
On
One looks for $n(x+1)$ where, for every integer $k$, $n(k)$ denotes the expected number of rolls needed to exceed $x$ starting from $x+1-k$. Thus, $n(k)=1+\frac16\sum\limits_{i=1}^6n(k-i)$ for every $k\geqslant1$ and $n(k)=0$ for every $k\leqslant0$.
For every $|s|\lt1$, let $N(s)=\sum\limits_{k}n(k)s^k$, then the one-step recursion above yields $$ N(s)=\sum\limits_{k\geqslant1}s^k+\frac16\sum\limits_{i=1}^6s^i\sum\limits_{k\geqslant1}n(k)s^k, $$ that is, $$ N(s)=\frac{\frac{s}{1-s}}{1-\frac16\sum\limits_{i=1}^6s^i}=\frac{6s}{(1-s)^2Q(s)}, $$ where $$ Q(s)=6+5s+4s^2+3s^3+2s^4+s^5. $$ This shows that $n(x+1)\sim\nu x$ when $x\to\infty$, with $$ \nu=\lim_{s\to1}(1-s)^2N(s)=\frac6{Q(1)}=\frac27. $$ To go further, consider $\bar n(k)=n(k)-\nu k$ and $\bar N(s)=\sum\limits_{k\geqslant1}\bar n(k)s^k$, then $$ (1-s)\bar N(s)=\frac{6s}{Q(s)Q(1)}\,\frac{Q(1)-Q(s)}{1-s}\to\mu,\qquad \mu=\frac{6Q'(1)}{Q(1)^2}, $$ hence $\bar n(k)\to\mu$ with $\mu=10/21$. Finally, $$ n(x+1)=\frac27(x+1)+\frac{10}{21}+o(1), $$ where $o(1)$ is geometrically small when $x\to\infty$.
On
Let $L(x)$ be the expected number of rolls to reach $x$. Clearly $L(x)=0$ for $x\le 0$, and for $x\ge 1$ the expected number is one more than the expected number remaining after the next roll. That is, $$ L(x)=I_{+}(x) + \frac{1}{6}\sum_{k=1}^{6}L(x-k), $$ where $I_{+}(x)$ is $1$ for positive $x$ and zero otherwise. Now consider the Z-transform of $L(x)$, defined by $\tilde{L}(z)=\sum_{x}L(x)z^{-x}$. Multiplying both sides of the previous equation by $z^{-x}$ and summing over $x$ gives $$ \tilde{L}(z)=\sum_{x=1}^{\infty}z^{-x}+\tilde{L}(z)\left(\frac{1}{6}\sum_{k=1}^{6}z^{-k}\right)=\frac{1}{z-1}+\frac{z^5+z^4+z^3+z^2+z+1}{6z^6}\tilde{L}(z), $$ or $$ \tilde{L}(z)=\frac{6z^6}{6z^7-7z^6+1}. $$ The inverse Z-transform is then $$ L(x)=\frac{1}{2\pi i}\oint\tilde{L}(z)z^{x-1}dz, $$ or the sum of the residues of ${6z^6}/(6z^7-7z^6+1)$. It turns out that $\tilde{L}(z)$ has a second-order pole at $z=1$ and simple poles at five other locations: $$ \tilde{L}(z)= \frac{\frac{2}{7} + \frac{16}{21}(z-1)}{(z-1)^2} + \sum_{j=1}^{5}\frac{R_{j}}{z-\omega_j}, $$ where $R_j$ are the residues and $\omega_j$ are the locations of the respective poles (the largest $|\omega_j|$ is about $0.73$, and the residues are $0.1$ or so). The result is then $$ L(x)=\frac{2}{7}x + \frac{10}{21} + \sum_{j=1}^{5}R_{j}\omega_j^{x-1}. $$ The corrections to the leading (linear and constant) terms are exponentially decaying with $x$; for $x=10$, they sum to about $-0.01$.
Let $X$ be a random variable with discrete uniform distribution in $[1, 6]$, and let n be a number. If m is the number of trials needed to exceed n, we can conclude:
-sum of m trials is more than n.
-sum of m-1 trial is less than n.
So the question is: Let $Y_n$ be a sum of n independent variables with distribution as $X$. What is the probability of $Y_n<r$ for any r given?
I assume it can be solved, but the solution might involve scary integrals I doesn't like. Maybe someone else can continue from here.