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?
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}.$$