<s>[INST] Expected value to get all possible outcomes for coin flipping trials Consider the experiment where we keep flipping two fair coins. If the random variable X is defined to be the number of trials to get all possible outcomes, find E(X) and Var(X). Since the coins are distinct (H,T) and (T,H) would count as distinct outcomes.
I've been trying to think about a solution to this problem by possibly defining X in terms of 4 different random variables representing the expected number of trials for each individual outcome. I don't know how I would structure this solution however, any help would be appreciated.
 [/INST] For one coin
Let's call the number of flips as $n$.
$$
P(X=1) = 0 \\
P(X=n) = \dfrac{1}{2^{n-1}}; n = 2,3,\cdots
$$
$$
\begin{align}
\text{E}[X] &= \sum_{n=2} n\times P(n) = \sum_{n=2} \dfrac{n}{2^{n-1}} = 3 \\
\text{var}[X] &= \text{E}[X^2] - \text{E}[X]^2 \\
&= \sum_{n=2} n^2\times P(n) - 3^2 \\
&= \sum_{n=2} \dfrac{n^2}{2^{n-1}} - 9 \\
&= 2 \\
\end{align}
$$
For two coins
Let's call the number of flips of the first and second coin together as $n$.
$$
P(X = 1,2,3) = 0 \\
P(X = n) = \dfrac{3}{4^{n-3}}, n = 4,5,6,\cdots
$$
$$
\begin{align}
\text{E}[X] &= \sum_{n=4} n\times P(n) = \sum_{n=2} \dfrac{3n}{4^{n-3}} = \dfrac{13}{3} \\
\text{var}[X] &= \text{E}[X^2] - \text{E}[X]^2 \\
&= \sum_{n=4} n^2\times P(n) - \left( \dfrac{13}{3} \right) ^2 \\
&= \sum_{n=4} \dfrac{3n^2}{4^{n-3}} - \dfrac{169}{9} \\
&= \dfrac{4}{9} \\
\end{align}
$$
</s>