1. ## Question of Variance

To be complete I'll just post everything about the problem.

Q: Each brand of candy bar has one coupon in it. There are n different coupons in total; getting at least one coupon of each type entitles you to a prize. Each candy bar you eat can have any one of the coupons in it, with all being equally likely. Let X be the (random) number of candy bars you eat before you have all coupons. What are the mean and variance of X?

A. So the expected value of X is a sum of geometric discrete random variables.

$X_1 = geom(1)$
so you have one coupon on the first trial.
let $X_2$ denote the number of bars needed to get the 2nd coupon

$E[X_2] = geom(\frac{n-1}{n}) = \frac{n}{n-1}$

$E[X_n] = geom(\frac{1}{n}) = n$

$E[X] = E[\sum_{i=1}^{n} X_i] = \sum_{i=1}^{n} E[X_i]$

The part Im having trouble on is the variance. From my definition:
$Var(X) = E[(X-E[X])^2]$
so does that mean...

$Var(X) = E[(\sum_{i=1}{n} X_i - \sum_{i=1}{n}E[X_i])^2]$

Any help is appreciated

2. Hello,

There is an easier formula for the variance, derived from the one you have.

Recall two properties of the expectancy :
$E[aX+Y]=aE[X]+E[Y] \quad (1)$ (where a is a real number)
$E[a]=a \quad (2)$ (again, where a is a real number)

$var(X)=E \bigg[(X-E[X])^2\bigg]$

$var(X)=E \bigg[X^2+(E[X])^2-2XE[X]\bigg]$

By (1), we have $var(X)=E[X^2]+E \left[(E[X])^2\right]-2 E[XE[X]]$

Note that $E[X]$ is a value, a number. It is not a variable anymore.

By (2), we have $var(X)=E[X^2]+(E[X])^2-2 E[X]E[X]$

$\boxed{var(X)=E[X^2]-(E[X])^2}$

Note that $E[f(X)]=\sum_{x \in \chi} f(x) P(X=x)$
(here, f(x)=x² and $\chi$ is the set of all possible values for X)