I came across this interview question recently, but can't quite find a generalized way of setting this up.
Now, we know that if $X$ denotes the minimum value rolled, then $X$ cannot be 6, since the rolls do not finish until a 5 is rolled. Therefore $E[X] = \sum_{i=1}^{5} xP(X=x)$.
For $P(X=5)$, it is required that a 5 appeared before a 1, 2, 3, or a 4. Since the probability of this occurring is $\frac{1}{5}$, we can say that $P(X=5) = \frac{1}{5}$.
How would I go about calculating $P(X=x)$ for the remaining numbers? I have seen the following formula with respect to this question, but cannot understand how it's derived:
$P(X=x) = \frac{1}{x(x+1)}$.
Thanks in advance!
The minimum value is $1$ if and only if the first $1$ comes before the first $5$, and the probability of this is $\frac12$. The minimum value is $2$ if and only if the first $1$, $2$, and $5$ come in the order $2,5,1$ which has probability $\frac1{3!}$ The minimum value is $3$ if and only if the first $1,2,3,5$ come in the order $3,5,1,2$ or the order $3,5,2,1$. Can you continue now?