I roll 6-sided dice until the sum exceeds 50. What is the expected value of the final roll? I roll 6-sided dice until the sum exceeds 50. What is the expected value of the final roll? 
I am not sure how to set this one up. This one is not homework, by the way, but a question I am making up that is inspired by one. I'm hoping this will help me understand what's going on better.
 A: Let $u(n)$ be the expected value of the first roll that makes the total $\ge n$.
Thus $u(n) = 7/2$ for $n \le 1$.  But for $2 \le n \le 6$, conditioning on the first roll
we have $$u(n) = \left( \sum_{j=1}^{n-1} u(n-j)
+ \sum_{j=n}^{6} j \right)/6$$
That makes 
$$ u_{{2}}={\frac {47}{12}},u_{{3}}={\frac {305}{72}},u_{{4}}={\frac {1919}{432}},u_{{5}}={\frac {11705}{2592}},u_{{6}}={\frac {68975}{15552
}}$$
And then for $n > 6$, again conditioning on the first roll,
$$u(n) = \frac{1}{6} \sum_{j=1}^6 u(n-j)$$
The result is 
$$u(51) = \frac {7005104219281602775658473799867927981609}{1616562554929528121286279200913072586752} \approx 4.333333219$$
It turns out that as $n \to \infty$, $u(n) \to 13/3$.  
EDIT: Note that the 
general solution to the recurrence 
$\displaystyle u(n) = \frac{1}{6} \sum_{j=1}^6 u(n-j)$
 is
$$ u(n) = c_0 + \sum_{j=1}^5 c_j r_j^n$$
where $r_j$ are the roots of
$$\dfrac{6 r^6 - (1 + r + \ldots + r^5)}{r - 1} = 6 r^5 + 5 r^4 + 4 r^3 + 3 r^2 + 2 r + 1 = 0$$
Those all have absolute value $< 1$, so $\lim_{n \to \infty} u(n) = c_0$.  Now
$6 u(n+5) + 5 u(n+4) + \ldots + u(n) = (6 + 5 + \ldots + 1) c_0 = 21 c_0$
because the terms in each $r_j$ vanish.  Taking $n = 1$ with the values of 
$u_1$ to $u_6$ above gives us
$c_0 = 13/3$. 
A: This should be a comment to Robert Israel's answer, but it is too long.
Here is a simpler way to see that, with a $d$-sided die, as $n\to\infty$, the expected last roll to meet or exceed $n$ is $\frac{2d+1}{3}$.
Since we have rolled the die an arbitrarily large number of times, each of $n{-}d,\dots,n{-}1$ are equally likely to be hit. If we hit $n{-}k$, there are $d{-}k{+}1$ ways for the next roll to total at least $n$ and the average roll that hits or exceeds $n$ is $\frac{d+k}{2}$. Thus, the probability that $n{-}k$ is the last total before we hit $n$ or above is $\frac{d-k+1}{(d+1)d/2}$. Thus, the expected last roll would be
$$
\begin{align}
\sum_{k=1}^d\frac{d+k}{2}\frac{d-k+1}{(d+1)d/2}
&=\sum_{k=1}^d\frac{d(d+1)-k(k-1)}{d(d+1)}\\
&=\frac{2d+1}{3}
\end{align}
$$
For $d=6$, this yields $\frac{13}{3}$, as Robert Israel shows.

Another way of looking at this, and this may be the simplest, is that there are $k$ ways for a $k$ to be the last roll. For a $d$-sided die, the mean of the last roll would be
$$
\begin{align}
\frac{\displaystyle\sum_{k=1}^dk^2}{\displaystyle\sum_{k=1}^dk}
&=\dfrac{\dfrac{2d^3+3d^2+d}{6}}{\dfrac{d^2+d}{2}}\\
&=\frac{2d+1}{3}
\end{align}
$$
A: The purpose of this answer here is to convince readers that the distribution of the roll 'to get me over $50$' is not necessarily that of the standard 6=sided die roll.
Recall that a stopping time is a positive integer valued random variable $\tau$ for which $\{\tau \leq n \} \in \mathcal{F}_n$, where $\mathcal{F}_n = \sigma(X_0, X_1, \cdots, X_n)$ is the canonical filtration with respect to the (time-homogeneous) markov chain $X_n$.
The Strong Markov Property asserts (in this case) that conditioned on the event $\tau < \infty$, the random variables $X_1$ and $X_{\tau + 1} - X_{\tau}$ are equidistributed. Letting $\tau = -1 + \min\{k \mid X_k > 50\}$ ought to prove the equidistribution with a regular die roll, right?
Well, no. What happens is that $\tau + 1$ is a stopping time, but $\tau$ is not, because it looks into the future one timestep. This is just enough to throw off the SMP.
