Variance and Standard Deviation

Understanding variability and spread in data through interactive visualizations.

Motivation: Same Mean, Different Risk

Consider three scenarios where you win money, all with expected value of $1000:

Interactive: Spread Visualizer

Scenario A: You get $1000 guaranteed.

Expected Value
$1000
Variance
0
Std. Deviation
$0

Mean as a Balance Point

The expected value (mean) acts as the "balance point" of a distribution. Variance measures how far values deviate from this point.

Interactive: Balance Point Visualizer

Mean: 3.5

Definition

Variance

$$ \text{Var}(X) = E[(X - \mu)^2] = \sum_x (x - \mu)^2 p(x) $$ where \(\mu = E[X]\).

Standard Deviation

$$ \sigma = \sqrt{\text{Var}(X)} $$

Interactive Proof: Computational Formula

We will prove that: \(\text{Var}(X) = E[X^2] - (E[X])^2\)

Step 1: Start with the definition of variance: $$ \text{Var}(X) = E[(X - \mu)^2] $$
Step 2: Expand the square: $$ \text{Var}(X) = E[X^2 - 2\mu X + \mu^2] $$
Step 3: Use linearity of expectation: $$ \text{Var}(X) = E[X^2] - 2\mu E[X] + \mu^2 $$
Step 4: Since \(\mu = E[X]\): $$ \text{Var}(X) = E[X^2] - 2\mu^2 + \mu^2 $$
Step 5: Simplify: $$ \text{Var}(X) = E[X^2] - \mu^2 = E[X^2] - (E[X])^2 \quad \blacksquare $$

Variance Calculator

Enter a custom probability distribution and see its variance computed step-by-step.