Quantifying Uncertainty
Logic breaks down in any domain where the rules have exceptions you cannot enumerate — the qualification problem. Probability replaces truth values with degrees of belief that obey Kolmogorov's axioms, and the full joint distribution becomes a knowledge base from which any query is answered by summing entries: marginalization, conditioning, and normalization.
╌╌╌╌
The logical agents of the previous module believe each sentence to be true, false, or unknown, and they act by deducing what must follow. That works when the rules hold without exception. It fails when the rules have exceptions — which, outside of puzzles and theorem-proving, is nearly always.
Consider a dentist trying to diagnose a patient by the rules of propositional logic. The obvious rule is
It is wrong: not every toothache is a cavity — there is gum disease, an abscess, impaction, and a long tail of rarer causes. So we weaken it to a disjunction, , and now the right-hand side is an unbounded list we can never finish. Turning the implication around into a causal rule, , is no better: not every cavity hurts. To make that true we would have to load the left side with every precondition a cavity needs in order to cause pain — exposed nerve, no anaesthetic, and so on — again without end.1
Why logic fails: the qualification problem
To state any rule about the physical world so that it is exceptionless, you must attach every qualifying condition under which it could fail — and there are always more conditions than you can list. This is the qualification problem, and it has no purely logical solution.
Russell and Norvig identify three sources of the problem.2
The connection between a toothache and a cavity is not a logical consequence in
either direction. That is typical not just of medicine but of law, business,
automobile repair, and most domains where an agent has to act on incomplete
knowledge. A logical agent, forced to answer true / false / unknown, can only say
unknown,
which is useless for choosing an action. What the agent can honestly
supply is a degree of belief: a number between 0 and 1 that grades how
strongly the evidence supports the proposition.
The ontological commitment is the same as logic's — the world is made of facts that either hold or not. What changes is the epistemological commitment: where a logical agent believes each fact true, false, or has no opinion, a probabilistic agent holds a numerical degree of belief in , with for certainly false and for certainly true.3 Probability provides a way of summarizing the uncertainty that comes from laziness and ignorance, and that summary is precisely what a rational agent needs in order to compare plans that are not guaranteed and still choose one.
A subtle point: at the time of diagnosis there is no uncertainty in the actual world — the patient either has a cavity or does not. The probability is not a statement about the tooth; it is a statement about the agent's knowledge state. That is why probabilities are written relative to evidence. Before any evidence we have the prior ; after observing the toothache we have the posterior ; if we later learn of gum disease the number moves again. None of these contradict each other — each is a separate assertion about a different state of knowledge.
Basic notation
Before we can compute with degrees of belief, we need a language to write them in. The notation borrows almost everything from familiar tools: the true/false propositions of logic, and the variables-with-values of constraint satisfaction. This section fixes the vocabulary — random variables, sample spaces, the axioms — used by the arithmetic in the rest of the lesson.
Random variables are the building blocks; by convention their names begin with an uppercase letter. Each has a domain, the set of values it can take. A Boolean variable like has domain ; might have domain ; a variable can even be continuous. We abbreviate the proposition as and as .
The sample space and the axioms
Probabilistic assertions are about possible worlds. The set of all possible worlds is the sample space ; its elements are individual possible worlds, and they are mutually exclusive and exhaustive — exactly one is the actual case. A fully specified probability model assigns a number to each world, subject to the basic axioms.
An event (or proposition) is a set of possible worlds — those in which the proposition holds — and its probability is the total probability of that set. Everything else about probability follows from these axioms. The relationship between a proposition and its negation drops out immediately,
as does the inclusion–exclusion principle for a disjunction, obtained by noting that summing the -worlds and the -worlds double-counts their overlap:
The axioms are not an arbitrary convention. De Finetti's theorem shows that any agent whose degrees of belief violate these axioms is exposed to a Dutch book — a set of bets, each of which it accepts as fair, that together guarantee it loses money no matter how the world turns out. Rational belief has to obey the axioms of probability, on pain of certain loss.4
Prior, conditional, and joint probability
Probabilities like that refer to a degree of belief in the absence of
any other information are prior or unconditional probabilities. Once we
have observed some evidence we want the conditional or posterior
probability, written with a vertical bar for given
:
The definition makes sense from the axioms: observing rules out every world where is false, leaving a set of total probability ; within that set the -worlds are the ones satisfying , a fraction . Multiplying through gives the product rule, often easier to remember: for to hold, must hold and must hold given .
When a variable has more than two values we often want the whole vector of probabilities at once. Writing (bold ) denotes the distribution over a fixed ordering of the domain — a probability distribution. For several variables the joint probability distribution tabulates the probability of every combination of their values. The joint over all the variables in the domain is the full joint distribution, and it is the object everything in this lesson is built on.
Inference from the full joint distribution
Once the full joint distribution is written down, answering any probability
question is addition: the joint is a lookup table, and each query sums the
entries that match. Probabilistic inference —
computing the posterior of a query given evidence — reduces to arithmetic. The
distribution is the knowledge base
; every answer is a sum of its entries.
Take the dentistry domain with three Boolean variables: , , and (the steel probe catches in the tooth). The full joint is a table of eight numbers that sum to .
Marginalization (or summing out) extracts the distribution over a subset of variables by adding over the values of the rest. Summing the whole row of the table gives the unconditional probability of a cavity:
In general, for disjoint sets of variables and ,
where the sum runs over all value-combinations of . A variant using the product rule, called conditioning, marginalizes with conditional probabilities instead: .
For a conditional query we use the definition of conditional probability, then read the two joint terms off the table. The probability of a cavity given a toothache restricts attention to the four cells:
Computing the complementary query the same way gives , and the two sum to as they must. Notice the denominator was the same in both. This is the constant that forces the posterior distribution to sum to , so we can treat it as a normalization constant and defer it. Writing the query distribution over in one line,
We never needed the value of . We summed the joint entries for and , got and — the correct relative proportions — then divided by their total to normalize. This is the general inference-by-enumeration procedure. Let be the query variable, the observed evidence, and the remaining unobserved (hidden) variables; then
This is correct and completely general, but it does not scale. For a domain of Boolean variables the full joint has entries, so the table itself is of size and each query sums over of them. With past a hundred — routine in real problems — the tabular full joint is not a practical tool. It is the theoretical foundation on which better methods are built, just as truth tables underlie DPLL. The rest of the lesson is about the structure that makes those better methods possible.
Independence
Inference-by-enumeration is correct but hopeless at scale, because the joint table is exponentially large. The rest of the lesson looks for structure that lets us shrink that table. The simplest kind of structure is when two variables have nothing to do with each other — knowing one tells us nothing about the other. That is independence.
Expand the dentistry domain with a fourth variable, , and the joint blows up to entries. But the weather has nothing to do with anyone's teeth. Any sensible model asserts
and likewise for every combination — knowing the dental facts tells us nothing new about the sky. When this holds we say and the dental variables are independent, written .
Independence lets the -entry table be reconstructed from an -entry table (the dental joint) and a -entry table (the weather), because . The saving compounds: independent coin flips have a joint of entries, yet the whole thing collapses to a product of tiny single-variable distributions.
Independence dramatically shrinks the representation, but clean separation of whole variable sets is rare: any connection, however indirect, breaks it. The toothache–weather split is the easy case. What we usually need is a subtler, conditional version — variables that are dependent in general but come apart once some third fact is known. Getting there needs one more tool: Bayes' rule.
This continues in Bayes' Rule and Naive Bayes, which inverts causal models into diagnostic ones and shows how conditional independence lets evidence combine without an exponential blowup.
Footnotes
- Russell & Norvig, Artificial Intelligence: A Modern Approach (3rd ed.), §13.1.1 — Summarizing uncertainty: the toothache/cavity example and why neither nor can be made exceptionless in propositional logic. ↩
- Russell & Norvig, §13.1.1 — the three reasons logic fails for judgmental domains: laziness, theoretical ignorance, and practical ignorance. ↩
- Russell & Norvig, §13.1 — degree of belief and probability theory; the shared ontological but differing epistemological commitments of logic and probability, and probability as a summary of laziness and ignorance. ↩
- Russell & Norvig, §13.2.3 — Probability axioms and their reasonableness: Kolmogorov's axioms and de Finetti's argument that beliefs violating them admit a guaranteed-loss combination of bets. ↩
╌╌ END ╌╌