Let $ X $ Be the Number of Faces that Never Showed Up in $ n $ Dice Rolls - What's $ \mathbb{E} \left[ X \right] $? This is a example from a book.
Suppose a fair die is rolled n times, and let X be the number of faces that never show up in these n rolls. $E(X)=?$
The method as suggested in the book is:-
Define $A_i=$ $i^{th}$ face is missing .
$\therefore X= \sum_{i=1}^{6}A_i$.
Here is my problem , According to the method suggested above,$ X$ can take values from {0,1,2...6}.
Then the sample space of $ X={0,1,2,3,4,5}$, since at least 1 face has to show up in the n rolls.
Where am I going wrong?
 A: By way  of enrichment here  is how to  solve it using  EGFs. Supposing
that the die has $q$ faces and  is rolled $n$ times we have from first
principles for the expectation
$$\mathrm{E}[X] = \frac{1}{q^n} \sum_{p=0}^q p {q\choose q-p}
n! [z^n] (\exp(z)-1)^{q-p}
\\ = n! [z^n]  (\exp(z)-1)^q
\frac{1}{q^n} \sum_{p=0}^q p {q\choose p}
(\exp(z)-1)^{-p}
\\ = n! [z^n]  (\exp(z)-1)^q
\frac{q}{q^n} \sum_{p=1}^q {q-1\choose p-1}
(\exp(z)-1)^{-p}
\\ = n! [z^n]  (\exp(z)-1)^{q-1}
\frac{q}{q^n} \left(1+\frac{1}{\exp(z)-1}\right)^{q-1}  
\\ = n! [z^n] \frac{q}{q^n} \exp((q-1)z)
= \frac{q}{q^{n}} (q-1)^n = q\left(1-\frac{1}{q}\right)^n.$$
What we  see here  confirms the result  from linearity  of expectation
with $q$ indicator  variables for each possible  value and $(1-1/q)^n$
the probability of that value not appearing. 
Observe that this technique will produce higher factorial moments
and hence the variance, e.g. we get
$$\mathrm{E}[X(X-1)] = n! [z^n]  (\exp(z)-1)^q
\frac{q(q-1)}{q^n} \sum_{p=2}^q {q-2\choose p-2}
(\exp(z)-1)^{-p}
\\ = n! [z^n]  (\exp(z)-1)^{q-2}
\frac{q(q-1)}{q^n} \left(1+\frac{1}{\exp(z)-1}\right)^{q-2}
\\ = n! [z^n] \frac{q(q-1)}{q^n} \exp((q-2)z)
= \frac{q(q-1)}{q^{n}} (q-2)^n =
q(q-1)\left(1-\frac{2}{q}\right)^n.$$
Recall that
$$\mathrm{Var}[X] = \mathrm{E}[X(X-1)] + \mathrm{E}[X] - \mathrm{E}[X]^2$$
so that we obtain
$$\mathrm{Var}[X] =
q(q-1)\left(1-\frac{2}{q}\right)^n
+ q\left(1-\frac{1}{q}\right)^n
- q^2\left(1-\frac{1}{q}\right)^{2n}.$$
A: The trick is to use the following property of the Indicator Function (Called Indicator Function - Mean, Variance and Covariance):
$$ \boldsymbol{1}_{A} \left( x \right) = \begin{cases}
1 & \text{ if } x \in A \\ 
0 & \text{ if } x \notin A 
\end{cases} \Rightarrow \mathbb{E} \left[ \boldsymbol{1}_{A} \left( x \right) \right] = P \left( A \right) $$
Defining $ {A}_{i} $ as the event of the $ i $ -th face doesn't appear.
The, as indicator function of the set:
$$ {\boldsymbol{1}}_{{A}_{i}} = \begin{cases}
1 & \text{ if } \text{The $ i $ -th face doesn't appear} \\ 
0 & \text{ if } \text{The $ i $ -th face does appear}
\end{cases} $$
This gives the following equality:
$$ X = \sum_{i = 1}^{6} {\boldsymbol{1}}_{{A}_{i}} $$
By the Linearity Property of the Expectation Operator:
$$ X = \sum_{i = 1}^{6} {\boldsymbol{1}}_{{A}_{i}} \Rightarrow \mathbb{E} \left[ X \right] = \mathbb{E} \left[ \sum_{i = 1}^{6} {\boldsymbol{1}}_{{A}_{i}} \right] = \sum_{i = 1}^{6} \mathbb{E} \left[ {\boldsymbol{1}}_{{A}_{i}} \right] $$
Utilizing the property of the Indicator Function:
$$ \mathbb{E} \left[ X \right] = \sum_{i = 1}^{6} \mathbb{E} \left[ {\boldsymbol{1}}_{{A}_{i}} \right] = \sum_{i = 1}^{6} P \left( {A}_{i} \right) = \sum_{i = 1}^{6} {\left( \frac{5}{6} \right)}^{n} = 6 {\left( \frac{5}{6} \right)}^{n} $$
To Do


*

*Add simulation.

