*Variance of binomial distro

OK, what's that "*" doing up there? Well that means that if you look down the page and you start to feel like you might lose your lunch, just skip to eqn. 1.54 at the end of this section to see the final result.

Now let's do a simple variation on this. as in problem 1.5.5, you get 0 for tails, and 1 for heads. So the mean for 1 trial is ${1\over 2}$. What's the variance?

\begin{displaymath}
\sigma^2 = (0-{1\over 2})^2 {1\over 2}+ (1-{1\over 2})^2 {1\over 2}= {1\over 4}
\end{displaymath} (1.45)

This is a standard deviation $\sigma = {1\over 2}$. This makes sense, because it's the same as the previous example except the peaks are now separated by half the distance, so you expect half the width.

Now let's consider what you get with 10 tosses. What happens is now $\sigma^2 \rightarrow 10 \sigma^2$. For $N$ tosses $\sigma^2 = N {1\over 4}$. The mean we found out was $N/2$. So they are both proportional to $N$.

How do I know this is the answer? What, you think I looked it up? You can do this following the methods we used in section 1.5.6.

We can write down the variance directly from the binomial distribution, just like we did for the mean (eqn. 1.37).


$\displaystyle \langle (X-\langle X\rangle)^2 \rangle = \sum_{X=0}^n (X-\langle ...
...ft(\!\!\!
\begin{array}{c}
n \\
X
\end{array}\!\!\!\right)
(p)^X (1-p)^{n-X}
=$     (1.46)
$\displaystyle \sum_{X=0}^n (X-np)^2 {n!\over (n-X)!X!}
(p)^X (1-p)^{n-X}$      

As with the mean, you can do a bad-ass differentiation trick to get the answer, it's a bit messy, but it works. However I'll follow the same kind of reasoning we talked about for the mean to get the answer.

So you use the same variable as we did before $X = \sum_{i=1}^n x_i $. Now we want to calculate the variance, so let's see how far we can get:

\begin{displaymath}
\sigma^2 = \langle (X-\langle X\rangle)^2\rangle = \langle (...
...=
\langle (\sum_{i=1}^n [x_i -\langle x_i \rangle])^2\rangle
\end{displaymath} (1.47)

Well we've got pretty far, but not quite far enough. Now we have the square of a sum. How do you handle that? Think of the case $n=2$, $(x_1+x_2)^2 =
x_1 x_1 + x_1 x_2 + x_2 x_1 + x_2 x_2$. This looks like a double summation of two indices. So generalizing this, we see that that summation in the above equation can be written as a double sum:
\begin{displaymath}
\sigma^2 =
\langle \sum_{i=1}^n \sum_{j=1}^n [x_i -\langle x_i \rangle] [x_j -\langle x_j \rangle] \rangle
\end{displaymath} (1.48)

But the average of a sum is the sum of the average (even for a double sum) so

\begin{displaymath}
\sigma^2 =
\sum_{i=1}^n \sum_{j=1}^n \langle (x_i -\langle x_i \rangle) ( x_j -\langle x_j \rangle) \rangle
\end{displaymath} (1.49)

Now there are two kinds of terms in this double sum; ones with $i=j$ and with $i\neq j$. If $i\neq j$, for example $\langle [x_1 -\langle x_1 \rangle] [x_2 -\langle x_2 \rangle] \rangle$ then we can use independence to figure out the answer. In that case

\begin{displaymath}
\langle (x_1 -\langle x_1 \rangle) (\langle x_2 -\langle x_2...
...le x_1 \rangle\rangle \langle x_2 -\langle x_2 \rangle \rangle
\end{displaymath} (1.50)

Because as we saw in section 1.5.6 for independent variables, the average of the product is the product of the average. But $\langle x_1 \rangle$ is just a constant so averaging that gives doesn't change it. So
\begin{displaymath}
\langle x_1 -\langle x_1 \rangle\rangle
= \langle x_1 \rangle -\langle x_1 \rangle = 0
\end{displaymath} (1.51)

So all terms with $i\neq j$ vanish. We're only left with the terms $i=j$ in other words a single sum:

\begin{displaymath}
\sigma^2 =
\sum_{i=1}^n \langle (x_i -\langle x_i \rangle)^2 \rangle
\end{displaymath} (1.52)

Well each term in the sum is just the variance for a single trial. Let's compute that, say for $x_1$:
$\displaystyle \langle (x_1 -\langle x_1 \rangle)^2 \rangle =
\langle (x_1 -p)^2 \rangle =
(0 -p)^2 P(0) + (1-p)^2 P(1) =$     (1.53)
$\displaystyle p^2 (1-p) + (1-p)^2 p = p(1-p)(p+(1-p) = p(1-p)$      

Good, you're still awake! Must have had some pretty strong coffee. Well we're almost there. Now we sum over all $n$ terms and obtain
\begin{displaymath}
\sigma^2 = n p(1-p)
\end{displaymath} (1.54)

That's a pretty simple answer. I could've just written it down and left it that. But that would've taken away all the fun!

Josh Deutsch 2009-03-05