I found this puzzle online. Before my question gets flagged or on hold, I know the question has already been answered here but since I tried to solve it on my own I want to check if it's correct or not.
The puzzle is "What is the expected Number of Coin Tosses to Get Five Consecutive Heads".
My answer is the following:
Because a coin has two sides, one for tails and one for heads, let $p$ be the probability of getting heads. Then the probability of getting tails is $1-p$. For obvious reasons I shall assume that the coin is fair, thus the probability of getting heads is $\dfrac{1}{2}$ and tails $\dfrac{1}{2}$ as well.
Let $X_i$ be a random variable indicating the number of flips required to get heads, when $i-1$ was heads.
What we are looking for is the number of tries for a single success, thus we shall assume the random variable $X_i$ is following the Geometric Distribution with Probability $P(X_i = x) = p (1-p)^{x-1}$.
The expected number of coin flips to get 5 consecutive heads is given by the expected average $E(X) = \dfrac{1}{p}$.
The probability of the random variable $X_i$ is $\dfrac{1}{2^{i}}$ since the coin is fair.
Thus for $5$ consecutive heads $E(X) = E(X_1) + ... + E(X_5) = \sum_{i=1}^{5}E(X_i) = \sum_{i=1}^{5}2^i = 62$
So the expected number of coin flips to get $5$ consecutive heads is $62$.