I roll a fair die 4 times. Let X be the number of different outcomes that I see. Find $\mathbb{E}[X]$ I roll a fair die 4 times. Let X be the number of different outcomes that I see. Find $\mathbb{E}[X]$.
My attempt:
I know that I can write X as a sum of indicator random variables and then I can use the fact that $\mathbb{E}[1_A]=\mathbb{P}(A)$. Thus,
\begin{equation}
I_{A_1}=
\begin{cases}
1 & \text{if only one kind}\\
0 & \text{otherwise}
\end{cases}
\end{equation}
\begin{equation}
I_{A_2}=
\begin{cases}
1 & \text{if two kinds}\\
0 & \text{otherwise}
\end{cases}
\end{equation}
\begin{equation}
I_{A_3}=
\begin{cases}
1 & \text{if three kinds}\\
0 & \text{otherwise}
\end{cases}
\end{equation}
\begin{equation}
I_{A_4}=
\begin{cases}
1 & \text{all different}\\
0 & \text{otherwise}
\end{cases}
\end{equation}
Then the probabilities of event A happening for each is
$$\mathbb{P}(I_{A_1})=\frac{6\cdot1\cdot1\cdot1}{6^4}$$
$$\mathbb{P}(I_{A_2})=\frac{6\cdot5\cdot2\cdot2}{6^4}$$
$$\mathbb{P}(I_{A_3})=\frac{6\cdot5\cdot4\cdot3}{6^4}$$
$$\mathbb{P}(I_{A_4})=\frac{6\cdot5\cdot4\cdot3}{6^4}$$
The sum of these should be my desired expectation.
My question is whether or not I have found the probabilities correctly. This is my thought process for how I counted the number of choices for the numerator, using $I_{A_2}$ as an example:
There are 6 choices for choosing the first number, then we don't want to get that number again so then there are 5 choices. After that, we only want to get the first or second number again, thus there are 2 choices for the third roll and 2 choices for the fourth roll. Hence, $6\cdot5\cdot2\cdot2$.
Is this the correct way of thinking about it? Thanks
 A: Let $(X_i)$ be an indicator r.v. that equals $1$ if face $i$ appears in $4$ rolls, and $0$ otherwise
Let $X$ be the number of distinct faces that have appeared, then
$ X = X_1 + X_2 + ... +X_6$
and $\Bbb E(X) = \Bbb E(X_1) + \Bbb E(X_2) + ... + \Bbb E(X_6) =6\Bbb E(X_i)$ by symmetry
Now the expectation of an indicator variable is just the probability of the event it indicates, so
$\Bbb E(X_i) = \Bbb P(X_i) = 1 - \left(\frac 5 6\right)^4$
and $\Bbb E(X) = 6\Bbb E(X_i) = 6\left(1- \left(\frac 5 6\right)^4\right) = \dfrac{671}{216}, \approx 3.1065$
A: This is a very brute-force-y problem, or at least I have a very brute-force-y solution. If anyone has a more elegant solution, please post it.
I want to start by saying that the sum of your probabilities should equal 1, as they comprise all the possible outcomes, yet they don't. $\mathbb P\left(A_1\right)$ and $\mathbb P\left(A_4\right)$ are correct, but the problem lies in the other two. The issue is that you fail to consider the order in which each number is rolled.
Let's start with $\mathbb P\left(A_3\right)$. Of course, the first roll can take on any of the 6 possible values. However, that does not restrict the second roll to 5 different values. If the first two rolls are the same, it's still possible to end up with 3 distinct values after 4 rolls. The same applies to the third roll. So, we should have:
$$\mathbb P\left(A_3\right)=\frac{1}{6^4}\left(6\cdot1\cdot5\cdot4+6\cdot5\cdot2\cdot4+6\cdot5\cdot4\cdot3\right)$$
There's a similar problem for $\mathbb P\left(A_2\right)$, but this one's a little more involved. We can either have 2 pairs of identical rolls or a set of 3 identical rolls and a single unique roll.
$$\mathbb P\left(A_2\right)=\frac 1{6^4}(\overbrace{6\cdot5\cdot2\cdot1+6\cdot1\cdot5\cdot1+6\cdot1\cdot1\cdot5}^\textrm{3 identical rolls}+\overbrace{6\cdot5\cdot2\cdot1+6\cdot1\cdot5\cdot1}^\textrm{2 pairs})$$
These new probabilities line all add up to 1 now, and they line up with the numerical value found with Python.
