# Question of Variance

• Oct 7th 2008, 11:05 AM
sixstringartist
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.

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

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

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

$\displaystyle 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:
$\displaystyle Var(X) = E[(X-E[X])^2]$
so does that mean...

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

Any help is appreciated
• Oct 7th 2008, 11:38 AM
Moo
Hello,

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

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

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

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

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

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

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

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

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