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?