There is a random number generator that obeys the standard normal distribution $X \sim N(\mu,\sigma^2)$, and then calculates the sum of the numbers generated until the sum is greater than $r$.
Specifically, it means to generate a random number, and then stop if it exceeds $r$, otherwise generate another random number. Sum all generated random numbers, stop if exceeds $r$, otherwise continue
How to find the expectation of the stop time $\mathbb{E}_r[X]$.
Similar to this question
I have an iterated solution:
If $Z=X+X$ then $Z\sim N(\mu + \mu, \sigma^2+\sigma^2)$. For $Z_n=\sum_{k=1}^n X$ we have $Z_n\sim N(n\times \mu,n\times \sigma^2)$.
$P(X>r)=P_1(Z_1>r)= 1-\Phi\left({{r-\mu}\over{\sigma}}\right)=Q\left({{r-\mu}\over{\sigma}}\right)$ and for $n$:
$$P_n(Z_n>r) = Q\left({{r-n\times\mu}\over{\sqrt n\times\sigma}}\right)\times\left(1-\sum_{k=1}^{n-1}P_{k}\right)$$ or $$P_n(Z_n>r) = \left(1-\Phi\left({{r-n\times\mu}\over{\sqrt n\times\sigma}}\right)\right)\times\prod_{k=1}^{n-1}\Phi\left({r-k\times\mu}\over{\sqrt k\times\sigma}\right)$$
$E_r[X]=\sum_{n=1}^\infty n\times P_n$