Distribution of Stopping Value Suppose we have $X_i \stackrel{\text{i.i.d}}{\sim} U(0,1)$ and we define a stopping time $N =\min \{n \mid X_1+\dots +X_n >1\}.$ How can one find the distribution of $X_N$?
I have seen how to find the distribution of $N$ using the renewal function $m(t)$ (in particular, $E[N]=e$) but I cannot figure out how to see the distribution of $X_N$. Through bootstrap methods, I see it is not just uniform, but I don't see why.
 A: (This answer is not fully satisfying since it does not give a nice formula for the distribution. Not sure whether there is a nice formula. Perhaps someboy else has a better approach and/or some idea how to simplify the formula in my answer.)
Set $S_n := \sum_{i=1}^n X_i$. For each $r \in (0,1)$ we have
\begin{align*} \mathbb{P}(X_N<r) &= \sum_{n=2}^{\infty} \mathbb{P}(X_N<r, N=n) \\ &= \sum_{n=2}^{\infty} \mathbb{P}(X_n<r, N=n) \\ &= \sum_{n=2}^{\infty} \mathbb{P}(X_n<r, X_n>1-S_{n-1}, S_{n-1} \in (1-r,1)). \tag{1}\end{align*}
From the independence of $S_{n-1}$ and $X_n$, we find that
\begin{align*} &\mathbb{P}(X_n<r, X_n>1-S_{n-1}, S_{n-1} \in (1-r,1)) \\ &\quad\mathbb{E} \left( \mathbb{P}(1-s < X_n < r) \bigg|_{s=S_{n-1}} 1_{(1-r,1)}(S_{n-1}) \right).\end{align*}
Since $X_n$ is uniformly distributed on $(0,1)$, we have
$$\mathbb{P}(1-s < X_n < r) = r-(1-s) = r+s-1$$
for each $s \in (1-r,1)$, and so
$$\mathbb{P}(X_n<r, X_n>1-S_{n-1}, S_{n-1} \in (1-r,1)) = \mathbb{E}((r+S_{n-1}-1) 1_{(1-r,1)}(S_{n-1})).$$
To proceed, we need to compute expectation on the right-hand side. By definition, $S_{n-1} = X_1+\ldots+X_{n-1}$ is the sum of $(n-1)$ independent $U(0,1)$-distributed random variables, and therefore its distribution is the Irwin-Hall distribution, i.e. its density function $f_{S_{n-1}}$ is given by
$$f_{S_{n-1}}(x) = \frac{1}{2(n-2)!} \sum_{k=0}^{n-1} (-1)^k {n -1 \choose k} (x-k)^{n-2} \text{sgn}(x-k).$$
We need the density function only for $x \in (0,1)$; for any such $x$ we have
$$f_{S_{n-1}}(x) = \frac{1}{2(n-2)!} \left( x^{n-2} - \sum_{k=1}^{n-1} (-1)^k {n -1 \choose k} (x-k)^{n-2}\right).$$
Thus,
\begin{align*}& \mathbb{E}((r+S_{n-1}-1) 1_{(1-r,1)}(S_{n-1}))\\ &= \frac{1}{2(n-2)!}\int_{1-r}^1 (r+x-1) x^{n-2} \, dx \\ &\quad -\frac{1}{2(n-2)!} \sum_{k=1}^{n-1} (-1)^k {n-1 \choose k} \int_{1-r}^1 (r+x-1) (x-k)^{n-2} \, dx \\ &= \frac{1}{2n!} (nr-1-(1-r)^n) \\ &\quad - \frac{1}{2n!} \sum_{k=1}^{n-1} (-1)^k {n \choose k-1} (rn(1-k)^{n-1}-(1-k)^n - (1-r-k)^n) \end{align*}
Plugging this into $(1)$ gives a formula for $\mathbb{P}(X_N<r)$. If we differentiate the expression with respect to $r$, we get some (nasty-looking) formula for the density of the distribution of $X_N$.
