Worked ExampleStatisticsIntroExpected Value Calculator

Calculate the expected value and variance of a discrete random variable

Expected value is the probability-weighted average of a distribution's outcomes. Variance measures how spread out those outcomes are around that average. Both are computed from the same probability table.

Primary Tool

Expected Value Calculator

Open calculator

The expected value calculator takes the full probability table and reports , , and in one step. That makes it easy to check each formula and to try variations by changing a single weight.

Problem

Let be the number of heads in three fair coin flips. Compute , , and .

Three coin flips produce a binomial distribution with and . Every outcome has a known probability from the binomial formula, which makes this a clean worked example for the general definitions.

The distribution table

List each outcome and its probability before computing anything.

  • : all tails.
  • : one head, two tails.
  • : two heads, one tail.
  • : all heads.

Step-by-step walkthrough

Work through expected value first, then use a second weighted sum to reach variance.

  1. 1Compute .
  2. 2Compute .
  3. 3Apply the shortcut formula: .
  4. 4Take the square root to get the standard deviation: .
  5. 5Confirm with the binomial formula: and . Both match.

What variance is measuring

Variance says the outcomes are, on average, squared units away from the mean. Standard deviation puts that in the original units: a typical outcome lands less than one head away from the mean of .

For a three-flip experiment that matches intuition: most outcomes cluster around one or two heads, and exact zero or three heads each occur only of the time.

Common Pitfall

The formula is a computational shortcut for . Both definitions give the same number, but the shortcut avoids computing each squared deviation by hand.

Try a Variation

Change the coin to one that lands heads with probability instead of . Update the probability table and recompute and . Do the results still match and ?

Related Pages

Keep moving through the cluster

Back to Learn Math →