You flip a coin until you get a total of n heads. What is the expected number of flips this will take? In terms of Expectation, E[x] and Variance Var(x).
Edit: The heads don't have to be consecutive.
You flip a coin until you get a total of n heads. What is the expected number of flips this will take? In terms of Expectation, E[x] and Variance Var(x).
Edit: The heads don't have to be consecutive.
Let $X_1$ be the number of coin tosses until the first head, $X_2$ be the number of coin tosses after that until the second head, and so on. We want $E[X]$ where $X = X_1 + X_2 + \dots + X_k$. By linearity of expectation, we have $E[X] = E[X_1] + E[X_2] + \dots + E[X_k]$.
For any $i$, $E[X_i]$ is the expected number of coin tosses until a head appears which is equal to $\dfrac{1}{p}$.
Therefore, we have $E[X] = \dfrac1p + \dfrac1p + \dots + \dfrac1p = \dfrac{k}p$. Put $k=n$ to get your answer.