A coin is thrown until two heads and two tails appears. Let $Y$ be the number of throws until this happens. What is the cumulative distribution function of $Y$?
What I have gotten so far:
The last throw can end up being either head or tail. Let's look at this situations separately.
Last throw is tail: $$\sum^n_{k=2}P(Y=k)k=0,5^k\cdot k(k-1), \qquad n\ge4.$$
This happens to also be the probability mass function when the last throw is head. Now summing up the two cases, we get
$$0,5^k\cdot k(k-1)+0,5^k\cdot k(k-1)=2k(k-1)\cdot0,5^k$$
which is the probability mass function of the situation. Does this seem correct?
Hint:
The probability that the $k$-th throw is the last one is the probability of the event that
and
either
or
This is: $$ \binom{k-1}1\frac1{2^{k-1}}\cdot\frac12+\binom{k-1}1\frac1{2^{k-1}}\cdot\frac12=\binom{k-1}1\frac1{2^{k-1}}, $$ where $\binom{k-1}1$ is the number of ways to order 1 T(H) and $k-2$ H(T).
Particularly this consideration proves: $$ \sum_{k=3}^\infty\frac k{2^k}=1. $$