PROBABILITY REFRESHER: EXPECTATION VALUE, VISUALLY
From dice rolls to Pauli-Z expectation values, the single-number summary that variational algorithms optimize.
We now have all the raw mathematical tools needed to fully assemble the Bloch sphere formula in Lesson 9. Before we do, this short lesson introduces one more concept that will recur throughout the entire curriculum, especially in Module 20 (VQE) and beyond: the expectation value — a precise way of asking "if I repeat a random process many times, what average result should I expect?"
Starting Classically: Expected Value of a Die Roll
You've likely seen this concept before in a probability or statistics class, so let's refresh it quickly with something concrete: a fair six-sided die.
Expected value is defined as: for each possible outcome, multiply its value by its probability, then add up all these products.
Since each outcome of a fair die has probability :
Notice the expected value (3.5) isn't even a possible outcome of a single roll — it's the average you'd converge to if you rolled the die thousands of times and averaged all the results. This "average over many repeated trials" framing is exactly how you'll interpret quantum expectation values once you reach real hardware in Module 11 and variational algorithms in Module 20.
Applying This to a Qubit Measurement
Recall the Born rule from Module 1, Lesson 6: measuring a qubit gives outcome 0 with probability P(0) and outcome 1 with probability P(1). If we assign the numeric value +1 to outcome 0 and -1 to outcome 1 (tied to the eigenvalues found in Lesson 6 for the Pauli-Z matrix — |0⟩ had eigenvalue +1 and |1⟩ had eigenvalue -1), the expectation value is:
This quantity, written , tells us, in a single number, how "0-leaning" or "1-leaning" a qubit's measurement statistics are — ranging from +1 (always measures 0) to -1 (always measures 1), with 0 meaning perfectly balanced.
Worked Example 1: Expectation Value of |0⟩
P(0) = 1, P(1) = 0.
Worked Example 2: Expectation Value of |1⟩
P(0) = 0, P(1) = 1.
Worked Example 3: Expectation Value of |+⟩
P(0) = 0.5, P(1) = 0.5.
This matches intuition perfectly: |+⟩ sits exactly on the equator, equidistant from both poles, so its "average leaning" is perfectly neutral — zero.
Worked Example 4: Expectation Value Using the Geometric Born Rule Formula
Using (Module 1, Lesson 6's Worked Example 4, which gave P(0) = 0.75, P(1) = 0.25):
The subscript Z in ⟨Z⟩ refers to the fact that we're computing this expectation value using the Pauli-Z matrix's eigenvalues (+1 for |0⟩, -1 for |1⟩) as our "outcome values" — equivalently, that we're measuring along the Z-axis of the Bloch sphere. You could similarly compute ⟨X⟩ or ⟨Y⟩ using the eigenvalues of the Pauli-X or Pauli-Y matrices instead, corresponding to measuring along the X or Y axis (full mechanics come in Module 8).
Why This Matters Going Forward
In Module 20 (VQE and QAOA), you'll see algorithms whose entire goal is to minimize or maximize an expectation value like (or more complex combinations of Pauli expectation values) by adjusting a circuit's parameters. Understanding expectation value now, as a simple weighted average, means that when we get there, the concept itself won't be new — only its application to optimization will be.
Practice Questions
Test your understanding
KEY TAKEAWAYS
Remember these points
Expected value is the probability-weighted average of a random process's possible outcomes -- familiar from classical examples like dice rolls
For a qubit measured in the Z-basis, assigning +1 to outcome 0 and -1 to outcome 1 gives the expectation value formula: P(0) minus P(1)
The Z expectation value ranges from +1 (certainly |0⟩) to -1 (certainly |1⟩), with 0 representing perfectly balanced 50/50 states like those on the equator
This single-number summary is exactly what variational algorithms like VQE and QAOA (Module 20) are built to optimize -- minimizing or maximizing an expectation value by adjusting circuit parameters
The same idea generalizes to X and Y expectation values, using the eigenvalues of the Pauli-X and Pauli-Y matrices from Lesson 6 -- full measurement mechanics for these come in Module 8