The expected value is one of several statistics sometimes referred to as a "measure of central tendency". These are statistics that try to capture the "typical" value of the random variable. Our next statistic tries to measure how spread out a distribution is.
This formula tries to capture some measure of how spread out the distribution is. One way we might hope to measure spread is to calculate how far away \(X\) is from its expected value on average. Squaring the term \(X - \E(X)\) ensures that any difference between the value of the random variable and its expected value contributes positively. ("Distance away from" should be positive.) So, the formula in DefinitionΒ 3.2.1 is conceptually clear. In practice, thereβs another way to structure the formula that makes for cleaner calculation:
Let \(R\) be the value of a fair 6-sided die roll. Weβve seen in ExampleΒ 3.1.2 that \(\E(R) = \frac{7}{2}\text{.}\) To find \(\E\left(R^2\right)\text{:}\)
Notice that in the \(\E\left(R^2\right)\) calculation, weβre just taking the basic structure of the \(\E(R)\) calculation and squaring the \(R\) values. The analogous calculation for a continuous random variable looks similar:
Let \(X\) be uniform on the interval \([a, b]\text{.}\) So \(X\) has the pdf \(f(x) = \frac{1}{b - a}\text{,}\) and we saw in ExampleΒ 3.1.7 that \(\E(X) = \frac{a + b}{2}\text{.}\) Now:
Variance is not linear. In general, you canβt split up variance across plus or minus signs, and you canβt pull multiplied constants out of the variance like you can with expected value. However, there are some properties we can use to do similar manipulations to the variance.
Weβll omit the proofs and just casually observe that these are reasonable properties. \(X + \alpha\) is a shift of \(X\text{,}\) and shifting shouldnβt change how spread out the distribution is. \(\alpha X\) scaled \(X\) by a constant, so it should scale the spread of the distribution by the same constant. But recall that the variance calculation involves squaring; itβs an indirect measure of spread. So itβs reasonable that scaling the distribution by a constant should scale the variance by its square.
Let \(X\) indicate an event \(A\) which has probability \(p\text{.}\) In ExampleΒ 3.1.5, we saw \(\E(X) = p\text{.}\) Notice that \(X\) takes the values 0 and 1 (with probabilities \(1 - p\) and \(p\text{,}\) respectively). But \(0^2 = 0\text{,}\) and \(1^1 = 1\text{,}\) so the expected value calculation for \(X^2\) is precisely the same as for \(X\text{!}\)
\begin{align*}
\E\left(X^2\right) \amp = 0^2 \cdot (1-p) + 1^2 \cdot p = p.
\end{align*}
Recall the setup from ExampleΒ 3.1.11: a binomial random variable \(S\) is the sum \(H_1 + H_2 + \dotsb + H_n\) of \(n\) indicator random variables, each with parameter \(p\text{.}\) The results of different coin flips are independent from each other, so the random variables \(H_1, \dotsc, H_n\) are independent from each other. From ExampleΒ 3.2.6, we know that \(\Var(H_i) = p(1-p)\) for each \(i\text{.}\) Therefore:
Let \(X\) be a random variable taking the values 1, 2, 3, 4, 5. Write a distribution table for \(X\text{,}\) then use your table to write a distribution for \(X^2\text{.}\) Then, find \(\Var(X)\text{.}\)
Suppose we flip a coin \(n = 100\) times, and let \(N\) count the number of heads. If the coin comes up heads on a flip with probability \(p = 0.4\text{,}\) what is \(\Var(N)\text{?}\) What if \(n = 80\) and \(p = 0.6\text{?}\) What if \(n = 200\) and \(p = 0.5\text{?}\)
A continuous random variable \(X\) taking values in \([1, 4]\) has p.d.f. \(f(x) = k(x - \sqrt{x})\) for some constant \(k\text{.}\) In a previous problem, you found the value of \(k\text{.}\) Now, find \(\Var(X)\text{.}\)
A continuous random variable \(X\) taking values in \([1, 2]\) has p.d.f. \(\displaystyle{f(x) = \frac{1}{2}\left(\frac{1}{x^2} + x\right)}\text{.}\) Find \(\Var(X)\text{.}\)