Probabilistic Reasoning and Inference
Conditional Probability, Bayes' Rule, and Independence · 16 min
Probability theory is the standard formalism AI systems use to represent degrees of belief about which of several possible states of the world actually holds, given incomplete evidence. Two building blocks make the whole framework work. Conditional probability, written P(A|B), measures the probability of event A given that event B is known to hold, and is defined as P(A, B) / P(B), the probability of both events occurring divided by the probability of the conditioning event. Repeatedly applying this definition yields the chain rule, which decomposes any joint probability over several variables into a product of conditional probabilities: P(A₁, A₂, ..., Aₖ) = P(A₁) · P(A₂|A₁) · P(A₃|A₁, A₂) · ... · P(Aₖ|A₁, ..., Aₖ₋₁). This decomposition is exact, not an approximation — it holds for any joint distribution whatsoever, which is precisely what makes it a foundation to build on rather than a simplifying assumption. Bayes' rule itself follows directly from this same definition of conditional probability, simply applied in both directions: since P(A, B) = P(A|B)·P(B) and also P(A, B) = P(B|A)·P(A), setting these equal and rearranging yields P(A|B) = P(B|A)·P(A) / P(B), the identity that lets an AI system update a belief about a hidden cause given an observed effect.
Independence and conditional independence are the two properties that make large probabilistic models computationally tractable rather than merely theoretically well-defined. Two events A and B are (mutually) independent when P(A, B) = P(A)·P(B) — knowing one tells you nothing about the other. They are conditionally independent given a third event C when P(A, B|C) = P(A|C)·P(B|C) — once C's value is known, A and B no longer inform each other, even if they were dependent unconditionally. This is a categorically different tool from the fuzzy set membership covered in Topic 46: fuzzy logic handles vagueness about which graded category a fully known quantity belongs to, whereas probability handles genuine uncertainty about which single, crisp state of the world actually holds when that state is not directly observed. Conditional independence in particular is what makes it possible to reason about dozens or hundreds of variables at all, since without some such structural assumption, a fully general joint distribution over many variables would require an amount of data and storage that grows exponentially with the number of variables involved.
A worked example shows why this machinery matters in practice, and resolves the module's opening question. Let disease prevalence be P(D) = 0.01, test sensitivity be P(positive|D) = 0.9, and the false-positive rate be P(positive|not D) = 0.05. Bayes' rule states P(D|positive) = P(positive|D)·P(D) / P(positive), where the denominator expands, via the law of total probability, to P(positive|D)·P(D) + P(positive|not D)·P(not D) = (0.9)(0.01) + (0.05)(0.99) = 0.009 + 0.0495 = 0.0585. So P(D|positive) = 0.009 / 0.0585 = 2/13, approximately 0.154, or about 15.4 percent — far below the test's 90 percent sensitivity, because the disease's low base rate means the far more numerous healthy population's 5 percent false-positive rate contributes more positive tests in absolute terms than the rare disease's true positives do. This is precisely why base rates cannot be ignored, and why probabilistic reasoning, done correctly, routinely overturns intuitive but mathematically wrong judgments — an AI system that instead treated any positive test as near-certain evidence of disease would be systematically miscalibrated in exactly the direction human intuition tends to err.
Bayesian Networks: Encoding Independence in Graph Structure · 17 min
A Bayesian network, also called a belief network, represents a joint probability distribution compactly using a directed acyclic graph whose nodes are random variables and whose edges represent direct probabilistic influence between them. The graph licenses a specific factorization of the full joint distribution: P(X₁, X₂, ..., Xₙ) equals the product, over every node, of that node's probability conditioned only on its parents in the graph — P(Xᵢ | parents(Xᵢ)) — rather than on every other variable. When the graph is sparse, meaning most nodes have only a handful of parents, this factorization needs dramatically fewer numbers than a full joint probability table would, which for n binary variables would otherwise require storing 2ⁿ − 1 entries. Judea Pearl's foundational work formalizing this representation and its associated inference algorithms — recognized by the ACM with the 2011 Turing Award for developing "a calculus for probabilistic and causal reasoning" — is widely credited with establishing Bayesian networks as the representational backbone of modern probabilistic AI.
The graph's structure does more than save storage; it directly encodes which conditional independence statements are guaranteed to hold. The most immediate rule is local: each node is conditionally independent of its non-descendant nodes, given its own parents. More generally, the criterion of d-separation determines, purely from graph topology, whether a given conditional independence statement is guaranteed to hold for every distribution consistent with that graph. D-separation analysis reduces to three canonical structural patterns behaving differently under conditioning: a causal chain (A→B→C), where conditioning on the middle node B blocks the path and makes A and C conditionally independent; a common cause or "fork" (A←B→C), where conditioning on the shared cause B similarly blocks the path between A and C; and a common effect or "collider" (A→C←B), where the opposite happens — A and B start out independent, but conditioning on their shared effect C can introduce a dependence between them that did not exist before.
A concrete illustration of the chain case: suppose A→B→C represents a simple causal chain, for instance a chain of noisy sensor readings where a first reading A influences a second reading B, which in turn influences a third reading C, with no direct link from A to C. Observing B "blocks" the only path connecting A and C, so once B's value is known, learning A's value provides no further information about C — formally, A and C are conditionally independent given B. If instead the graph were a collider, with C as a shared effect of both A and B, conditioning on C would have the opposite effect: it can make A and B dependent on each other even though they were independent before C was observed, since learning C narrows down the joint possibilities for A and B in a way that couples them together. Correctly distinguishing these two structural patterns is essential for reasoning about which pieces of evidence in a network actually inform which others.
Likelihoods, Propagating Uncertainty, and Probabilistic Decisions · 15 min
Bayes' rule involves a term, P(evidence|hypothesis), that deserves its own name and its own way of thinking: the likelihood. Probability and likelihood use the identical formula but hold different things fixed. When you treat P(evidence|hypothesis) as a probability, you fix the hypothesis and ask how probable different possible pieces of evidence are under it. When you treat the same formula as a likelihood, you fix the observed evidence — the data you actually have — and ask how that fixed evidence varies in plausibility across different candidate hypotheses. This reframing is exactly what Bayes' rule needs: to compare hypotheses given the one piece of evidence you actually observed, you evaluate the likelihood of that fixed evidence under each candidate hypothesis, then weight by each hypothesis's prior probability. The distinction is easy to state but easy to lose track of in practice, since the two views share an identical mathematical expression; keeping them straight is what allows the same conditional-probability machinery introduced in Lesson 1 to serve double duty as both a description of how evidence behaves and a procedure for comparing competing explanations of that evidence.
Real inference problems rarely involve just one piece of evidence; uncertainty typically needs to be propagated across a chain of observations. A common simplifying pattern, sometimes called a naive Bayes assumption, treats multiple evidence variables as conditionally independent given the hypothesis, which lets their combined likelihood be computed as a simple product of individual likelihoods — P(evidence₁, evidence₂, ...|hypothesis) = P(evidence₁|hypothesis) · P(evidence₂|hypothesis) · ... — rather than requiring a full joint model of how the evidence variables interact. This is the same conditional-independence machinery from the previous lesson's Bayesian networks, now applied to combining evidence rather than to network structure alone. It is a genuine assumption, not a theorem, and when the evidence variables are not really conditionally independent given the hypothesis, the resulting combined probability estimate can be systematically distorted — a real limitation worth stating plainly rather than glossing over, since errors from a false independence assumption compound across a longer chain of combined evidence.
Probabilistic reasoning is ultimately in service of decisions, not belief for its own sake. A rational agent operating under uncertainty does not simply act on the single most probable state of the world; it selects the action with the highest expected value or utility, computed by weighting each possible outcome's utility by its Bayes-updated probability given all available evidence — extending the general framing of a rational agent as one that chooses actions to maximize expected performance given whatever evidence its percepts provide. Closing this module, and Domain F's opening, on that connection matters: probabilistic reasoning provides a calibrated, mathematically well-founded notion of uncertainty, distinct both from fuzzy logic's graded vagueness in Topic 46 and from an arbitrary, uncalibrated confidence score a neural network might output — a distinction worth carrying forward into later coursework on decision theory and learning under uncertainty. Recognizing which of these three tools — fuzzy membership, symbolic guarantees, or calibrated probability — actually fits a given problem's source of imprecision is itself a core reasoning skill this closing sequence of Domain E and opening of Domain F has been building toward.
Bayes' Rule on a Diagnostic Test
A probability tree for the module's worked Bayes' rule example: leaf joint probabilities (0.009, 0.001, 0.0495, 0.9405) sum to exactly 1.0, and dividing the true-positive branch by the total positive-branch probability gives P(Disease | Positive) ≈ 15.4%.
- Bayes' rule quantifies exactly how much a positive test should shift belief in a hypothesis, and the answer depends critically on the prior: a 90%-sensitive test on a 1%-prevalence condition still leaves the posterior probability of disease near 15%, not 90%.
- A Bayesian network's directed acyclic graph is not just a picture — its structure formally licenses which conditional independence statements are guaranteed to hold, letting the joint distribution factor into a product of small local conditional probability tables instead of one exponentially large table.
- Likelihood and probability use the same formula viewed from two different fixed variables: probability fixes the hypothesis and varies over outcomes, while likelihood fixes the observed data and varies over hypotheses — exactly the quantity Bayes' rule needs to update belief.
Recall Practice
Glossary
- Conditional probability
- The probability of an event A given that event B is known to hold, defined as P(A|B) = P(A, B) / P(B).
- Bayes' rule
- The identity P(H|E) = P(E|H)·P(H) / P(E), used to update the probability of a hypothesis H after observing evidence E, combining a prior probability with a likelihood.
- Conditional independence
- The property that two variables A and B no longer inform each other once a third variable C is known: P(A, B|C) = P(A|C)·P(B|C), even if A and B are dependent unconditionally.
- Bayesian network (belief network)
- A directed acyclic graph representing a joint probability distribution, in which the joint factors as the product over all nodes of each node's probability conditioned on its parents.
- D-separation
- A graph-theoretic criterion for determining, from a Bayesian network's topology alone, which conditional independence statements are guaranteed to hold across every distribution consistent with that graph.
- Likelihood
- The same functional form as a conditional probability P(evidence|hypothesis), but interpreted as a function of the hypothesis with the observed evidence held fixed, rather than as a function of the evidence with the hypothesis held fixed.
Hand-Trace Bayes' Rule and a Small Belief Network
A fully virtual, paper-based worksheet exercise — no real patient data, sensors, or software execution of any kind. In the first half, learners recompute the module's diagnostic-test posterior probability using a different supplied prevalence, sensitivity, and false-positive rate, showing every arithmetic step by hand. In the second half, learners are given a small five-node directed acyclic graph (paper diagram) and apply the d-separation rules for chains, forks, and colliders from Lesson 2 to answer three supplied conditional-independence queries, justifying each answer by naming which structural pattern applies.
Ready to test yourself?
5 questions on this module.