Probability & Expected Value
Expected value: the average of futures, weighted by probability.
A casino doesn't need luck — it needs math. With 37 roulette fields and a single green zero, every spin is an independent random event. Yet over millions of spins, the house reliably earns 2.7 cents per euro bet. How can the outcome of a single spin be unpredictable, while the long-run result is almost guaranteed?
The answer lies in three ideas: probability, distributions, and expected value. Together, they form the mathematical language that casinos, meteorologists, and AI systems use to make decisions under uncertainty.
The Language of Uncertainty
Probability
Both interpretations produce valid numbers but answer different questions — one about repeatable experiments, the other about unique events. For a medical diagnosis, for example, both perspectives have value.
Probability = relative frequency over many repetitions. Example: P(Red) = 18/37 because 18 of 37 fields are red. Works in closed systems with repeatable experiments.
Probability = degree of belief. Example: "20% chance of AGI by 2030" is based on prior knowledge and evidence, not counting. Works for one-off events that cannot be repeated.
Example: European Roulette
Misconception: The Gambler's Fallacy
Interactive: Coin Flip Simulator
What happens when a coin isn't perfectly fair? The temperature slider controls the bias: at low temperature, the coin almost always lands on one side. At high temperature, the probabilities approach 50:50. Click Sample repeatedly and watch how the observed frequency converges to the theoretical probability as the sample size grows — the law of large numbers in action.
An LLM has generated the beginning "Das Wetter heute ___" ("The weather today ___") and computes probabilities for the next word. The most natural continuation is "ist" ("is") — but the temperature determines whether the model always picks the safe choice or dares more unusual continuations.
Probability Distribution (at T=1.0)
Results (0 Samples)
No samples yet — click "Sample token"
Click "Sample token" to see how the LLM samples at the current temperature. Observe how the distribution of results approaches the theoretical probability with more samples.
The Map of All Possibilities
Distribution (PMF & PDF)
Distribution Types: An Overview
Example: Fair vs. Loaded Die
Expected Value: The Average of the Future
The expected value E(X) is the weighted average of all possible outcomes: each outcome is multiplied by its probability and everything is summed. This number does not predict what happens on the next trial — it is the anchor around which many trials cluster. This convergence is called the Law of Large Numbers.
Calculating Expected Value
Deal or No Deal: Expected Value vs. Gut Feeling
Three Steps of Understanding
Four Layers of Understanding
Deep Dive: Probability in AI
Key Takeaways
Quiz: Probability & Expected Value
Checkpoint: Probability & Expected Value
- I can explain what probability means and describe the difference between frequentist and Bayesian interpretation.
- I can calculate the expected value of a simple scenario (dice, roulette) and explain why this number often cannot occur on a single trial (e.g. 3.5 on a die).
- I can recognise the Gambler's Fallacy and explain why independent events have no memory.