Expected Value and Decision Trees: A Student's Step-by-Step Guide
Calculate expected value, variance and fairness of a game, then draw and roll back a decision tree to choose the best option, with a full business example.

Expected Value and Decision Trees: A Student's Step-by-Step Guide
Expected value answers the question "on average, what will this be worth?" It sits behind casino odds, insurance prices and business choices made under uncertainty. Decision trees extend the idea to problems with several steps, where you decide, then chance plays a part, then you may decide again. This guide covers both and shows how to set out the working. You can build every example here in the expected value and decision tree calculator.
Part 1: Expected value of a single random variable
List every possible outcome, its value x and its probability P(x). Then
E(X) = Σ x·P(x).
Example. A stall charges 3 to roll a die. Rolling a 6 wins 10, rolling a 4 or 5 wins 2, anything else wins nothing.
| Outcome | x | P(x) | x·P(x) |
|---|---|---|---|
| Six | 10 | 1/6 | 1.667 |
| Four or five | 2 | 2/6 | 0.667 |
| Other | 0 | 3/6 | 0 |
E(X) = 2.333. The game costs 3, so the expected gain is 2.333 − 3 = −0.667 per play. Over 100 plays a player should expect to lose about 67. A game is fair when the expected gain is exactly zero.
Always check that the probabilities add up to 1. If they do not, an outcome is missing or a probability is wrong. The calculator flags this straight away, and accepts fractions such as 1/6 so that the total is exact.
Measuring risk: variance and standard deviation
Two games can have the same expected value but very different risk. The variance measures the spread:
Var(X) = E(X²) − [E(X)]², where E(X²) = Σ x²·P(x).
For the dice stall, E(X²) = 100 × 1/6 + 4 × 2/6 = 18, so Var(X) = 18 − 2.333² ≈ 12.56 and the standard deviation is about 3.54.
Part 2: Decision trees
A decision tree uses three symbols:
- Square: a decision you control.
- Circle: a chance event with probabilities on its branches.
- Triangle (or end point): a final payoff.
Costs are written on the branches where they are paid.
Rolling back
Solve the tree from right to left:
- An end point is worth its payoff.
- A chance node is worth Σ probability × value of each branch.
- A decision node is worth the best branch value; mark the rejected branches with a double bar.
- Subtract any cost on a branch as you pass back through it.
A worked business example
A firm can launch a product for 50,000. Demand is strong (probability 0.4, revenue 200,000) or weak (0.6, revenue 20,000). Alternatively it can run a market test for 10,000. The test is positive with probability 0.45, after which strong demand has probability 0.75; if negative, the firm stops.
- Launch now: 0.4 × 200,000 + 0.6 × 20,000 = 92,000, minus 50,000, gives 42,000.
- Launch after a positive test: 0.75 × 200,000 + 0.25 × 20,000 − 50,000 = 105,000; stopping gives 0, so choose to launch.
- Test route: 0.45 × 105,000 + 0.55 × 0 − 10,000 = 37,250.
- Do nothing: 0.
The best plan is to launch immediately, with an expected value of 42,000. The calculator draws this tree, prints the value above every node, thickens the chosen branches and writes the roll-back steps in order.
Cost-minimising trees
Some problems ask for the cheapest option instead, such as choosing a repair strategy. Switch the decision setting to minimise and enter costs as positive payoffs; decision nodes then keep the smallest value.
Common mistakes
- Forgetting to subtract the cost of a test or investment.
- Adding probabilities that should multiply along a path.
- Choosing at a chance node: you only choose at squares.
- Rounding too early; keep fractions until the end.
Limits
Expected value treats a guaranteed 1,000 and a 50 % chance of 2,000 as equal, which many people and businesses do not. Real decisions may need utilities, risk tolerance or non-financial factors. This guide and the calculator also leave Bayesian updating of probabilities to you: the probabilities after a test must be worked out and entered on the tree.


