Probability theory is the mathematical framework for representing and reasoning about uncertain statements. AI uses it two ways: the laws of probability tell us how systems should reason (so we design algorithms to compute or approximate the right expressions), and probability lets us analyze proposed systems theoretically. Information theory — the second half of this chapter — then quantifies how much uncertainty a distribution contains.
Aside — how to read this chapter
Comfortable with both subjects? Skip everything except §3.14, the graph language the rest of the book uses for structured probabilistic models. Brand new? This chapter suffices for deep learning research, but a dedicated text (Jaynes, 2003) is recommended too.
§3.1 Why probability?
Most of computer science lives in a deterministic world — a CPU executes every instruction flawlessly, and software rarely plans for hardware error. Machine learning is the opposite: it always deals with uncertain, and sometimes genuinely stochastic, quantities. Beyond mathematical tautologies, it is hard to name any proposition that is absolutely true or event absolutely guaranteed. Uncertainty enters through exactly three doors:
Even when the true rule is deterministic and representable, a simple uncertain rule often beats a complex certain one: “most birds fly” is cheap, broadly useful and robust; “birds fly, except very young birds, sick or injured birds, flightless species including the cassowary, ostrich and kiwi…” is expensive to build, maintain and communicate — and still brittle.
Two meanings of “probability,” one set of rules
- Frequentist probability frequentist probability Probability as long-run event rates over repeatable experiments. defined in ch. 3 — open in glossary : the rate at which a repeatable event occurs — probability of a poker hand means proportion of infinitely many draws.
- Bayesian probability bayesian probability Probability as a degree of belief (0 = certainly false, 1 = certainly true); obeys the same axioms as frequentist probability. defined in ch. 3 — open in glossary : a degree of belief about a non-repeatable proposition — “this patient has a 40 % chance of flu” cannot mean replicas of the patient; 1 is absolute certainty of flu, 0 absolute certainty of none.
Remarkably, listing the common-sense properties we expect of uncertain reasoning forces both kinds to obey exactly the same axioms (Ramsey, 1926): the poker formulas and the diagnosis formulas are one and the same.
What this really says
Probability is logic extended to uncertainty. Logic derives which propositions must be true given that others are; probability derives how likely a proposition is given the likelihoods of others. That is why one calculus serves frequencies and beliefs alike.
§3.2 Random variables
A random variable random variable A variable taking values randomly (plain typeface x, values x); meaningful only when coupled with a distribution; discrete or continuous. defined in ch. 3 — open in glossary is a variable that takes values randomly — written in plain typeface (), with its possible values in italic (); vector-valued random variables are upright bold () with values (the typography is on the notation page). On its own a random variable just lists possible states; it must be coupled with a probability distribution saying how likely each state is. Variables are discrete (finitely or countably many states — not necessarily numbers; named categories count) or continuous (real-valued).
§3.3 Probability distributions
§3.3.1 Discrete variables: probability mass functions
A probability mass function (PMF) probability mass function P(x) for discrete variables: domain = all states, 0 ≤ P ≤ 1, Σ P = 1 (normalized). defined in ch. 3 — open in glossary maps each state to its probability; means , and declares the distribution. PMFs over several variables at once are joint distributions: . Three properties make a function a PMF:
The PMF contract
| P must cover every possible state of x | completeness | |
| nothing is less likely than impossible or more likely than guaranteed | bounds | |
| "normalized" — without this, the probability of one-of-many events could exceed 1 | normalization |
Worked example — the uniform die
A discrete with states is uniform when (eq 3.1). For a fair die, : each face has , and (eq 3.2) — both requirements check out.
every state gets P = 1/k = 0.167; the 6 bars sum to exactly 1
§3.3.2 Continuous variables: probability density functions
Continuous variables have uncountably many states, so no state can carry finite mass. A probability density function (PDF) probability density function p(x) for continuous variables: p ≥ 0 (may exceed 1!), ∫p = 1; region probabilities come from integrating p. defined in ch. 3 — open in glossary instead satisfies:
The PDF contract — note what is MISSING
| densities are non-negative — but there is NO requirement p(x) ≤ 1 | lower bound only | |
| the actual probability of landing in an infinitesimal region of volume δx | mass = density × volume | |
| the probability that x lies in a set S — integrate the density | probability of regions |
What this really says
A density is probability per unit length, not probability. Any single point has probability zero; only regions accumulate mass. And just as a physical object can have density above 1 g/cm³, a PDF can rise above 1 — squeeze the uniform below and watch it happen.
The continuous uniform puts on and 0 outside (written ). The "" reads “parametrized by”: is the argument; and define the particular function.
height 1/(b−a) = 1.00; shaded area = 1
Next: combining, splitting and conditioning distributions — marginals, conditionals and the chain rule.
Check yourself — why probability, PMFs and PDFs
1.The Monty Hall problem illustrates which source of uncertainty?
2.Why does the book prefer 'most birds fly' over the exhaustive exception-listing rule?
3.A doctor says a patient has a 40% chance of flu. What kind of probability is this, and why do the usual formulas still apply?
4.In the continuous-uniform widget you drag b until b − a = 0.5. The density reads 2.0. Is this a bug?
5.What is a random variable, before any distribution is attached?