You roll a die until you get the number five. What is the expected value of the maximum roll you see(don't include 5, we only consider rolls upto and before the 5). I created a solution to this problem, although I am still confused because of the dependency on the number of rolls. Any commentary would be appreciated
Suppose that it takes $n$ rolls to see a 5. Then $E(n) = \frac{1}{6}^n \cdot 1 + \frac{1}{6} \cdot n \cdot \frac{2}{6}^{n-1} \cdot 2 + \frac{1}{6} \cdot n \cdot \frac{3}{6}^{n-1} \cdot 3 + \frac{1}{6} \cdot n \cdot \frac{4}{6}^{n-1} \cdot 4 + (1-\frac{5}{6}^n) \cdot 6$. The probabilities in the expected value function are computed as the probability that number will be the highest out of n rolls. For instance for 2 being the highest roll, we have to have two appear in the sequence of $n$ rolls, and then have all the other rolls be two or less, which corresponds to probability $\frac{1}{6} \cdot n \cdot \frac{2}{6}^{n-1}$. Now my question is how this depends on the number of rolls. For the overall expected value do we simply use the expected number of flips to roll a five, which is six, and then plug 5 into the equation to get the overall expected value? (when I do I get 4.42)
(as another thought, should i integrate the expected value function from $n=0$ to $\infty$?)
Let $P_k$ be the probability that the first instnace to see a 5 was the kth roll, then $E=\sum_{k=1}^\infty kP_k\ where\ P_k=\frac{1}{6} (\frac{5}{6})^{k-1}$