Two players $A$ and $B$ play a series of games that ends when one of them has won $n$ games.
Suppose that each game played is, independently, won by player $A$ with probability $p$. Let $X$ be the number of games that are played. Compute the distribution of $X $ when $n = 2$ and $n = 3$.
How would one solve this?