AI Glossary / Graphs and symbolic AI / Intermediate
Chain rule
Definition
The chain rule of probability expresses a joint probability as a product of successive conditional probabilities. It lets a model describe several events or variables together by specifying one part at a time, conditioned on earlier parts. This entry uses the probability meaning relevant to probabilistic reasoning; the calculus chain rule for derivatives is a separate, also important AI concept.
What it means
Knowing how often individual events occur is generally not enough to know how often they occur together. Their relationships matter. The probability chain rule preserves those relationships through conditioning. For two events, P(A and B) equals P(A) multiplied by P(B given A), when the conditional probability is defined.
For more variables, each new factor can depend on all variables already introduced. The rule itself does not assume independence. Simplifying away conditions requires additional knowledge or assumptions. This distinction is central to probabilistic models because an unjustified simplification can change the distribution being represented.
How it works
For three discrete variables, one ordering gives P(A, B, C) = P(A) times P(B given A) times P(C given A and B). Repeated application of the conditional-probability definition produces this factorization. Another ordering is equally valid when its conditional terms are defined consistently.
In a Bayesian network, conditional-independence assumptions allow some of the earlier variables to be omitted from a factor, leaving a distribution conditioned on a node's parents. That simplification comes from the model structure, not from the chain rule alone. Continuous-variable versions use densities and require the corresponding mathematical care rather than interpreting a density value as a point probability.
Three practical examples
- A reliability model combines the probability of a disruption with the conditional probability that a backup fails given that disruption.
- A language model represents a token sequence using probabilities for each token conditioned on the preceding context.
- A probabilistic workflow model calculates the chance that a request passes several stages while accounting for dependencies between stage outcomes.
Think of it this way
Think of following a branching tree of conditions: the chance of reaching one particular leaf combines the chance of the first branch with the chances of subsequent branches given the path already taken. The analogy is limited because the ordering need not represent time or causation. A mathematically valid factorization can list variables in an order different from how events physically occur.
Worked example
Suppose a fictional service model assigns probability 0.20 to a surge in requests, S. Given a surge, the probability of a queue forming, Q, is 0.60. Given both a surge and a queue, the probability of a delayed response, D, is 0.50. The probability of all three events is 0.20 times 0.60 times 0.50, or 0.06.
Thus the model assigns 6 percent probability to the joint event S and Q and D. This is not the overall probability of delay: delays could also occur without a surge or without this type of queue. Calculating P(D) requires accounting for the other relevant combinations. Nor can P(Q given S) be replaced by the unconditional P(Q) unless the needed independence holds. The example illustrates a single joint assignment, with hypothetical numbers and no claim about an operating service.
Illustrative case study
At fictional Birch Analytics, a team combines separate stage-success percentages by multiplying them as though the stages were independent. Reviewers point out that difficult requests are more likely to struggle at several stages, so unconditional averages may hide dependence.
The team revises its model to use the relevant conditional quantities and checks the resulting joint probabilities against held-out cases. This fictional case illustrates why a familiar multiplication can be correct or incorrect depending on what its factors mean. It does not claim a measured calibration improvement.
Common misconceptions and mistakes
The chain rule is not the statement that all marginal probabilities can always be multiplied. That simpler product requires independence. It is also not Bayes' rule, although both follow from probability relationships and are often used together.
A variable appearing earlier in the factorization does not automatically cause later variables. Conditioning is not intervention. Also, a conditional probability with a zero-probability conditioning event is not defined by the ordinary ratio formula. Finally, the derivative chain rule used in backpropagation concerns rates of change through composed functions, not this factorization of a joint distribution.
Business use
Businesses can use the probability chain rule to make multistage risk and success models explicit. Each factor should state its conditioning population so teams do not combine percentages drawn from incompatible groups. The framework is also useful for reviewing AI explanations: ask whether an apparent simplification assumes independence and whether that assumption is supported. A correctly written formula cannot compensate for unreliable conditional estimates or missing pathways to the outcome.
People also ask
Does the chain rule require independent variables?
No. It is designed to retain dependence through conditional probabilities.
Can the variables be ordered differently?
Yes. Different consistent orderings factorize the same joint distribution using different conditional terms.
Does multiplying one path give the overall outcome probability?
Usually not. Other mutually exclusive paths to that outcome must also be accounted for when computing its marginal probability.
Check your understanding
If P(A) = 0.4 and P(B given A) = 0.25, what is P(A and B)?
Answer: 0.10. This does not tell us P(B) without information about B when A does not occur.
Related terms
- Conditional probability
- Product rule
- Bayesian network
- Conditional independence
- Marginalization
- joint distribution
- autoregressive model
Learn next
Build a two-stage probability tree and label every branch with its conditioning event. Multiply along each complete path, then add the paths for a selected outcome. Comparing path products with outcome totals makes the distinction between joint and marginal probabilities visible.
More in Graphs and symbolic AI
- Certainty effect - The certainty effect is a pattern in decision making in which a guaranteed outcome receives disproportionate weight compared with outcomes that are merely...
- Certainty equivalent - A certainty equivalent is a guaranteed outcome that a decision maker values equally to a specified uncertain prospect.
- Certification - Certification is a formal attestation that a specified object meets defined requirements within an identified scope.
- Chains - Chains, in the graph-algorithm sense used here, are paths or cycles produced by a chain decomposition based on a depth-first search tree.
- Chance nodes - Chance nodes represent uncertain outcomes in a decision tree, game tree, or decision network.
- Characters - Characters are the written-text elements that a system represents and processes, such as letters, digits, punctuation, and other symbols.
Sources
Sources: Russell and Norvig, original AIMA uncertainty slides, probability product and chain rules: https://aima.eecs.berkeley.edu/2nd-ed/slides-pdf/chapter13.pdf . Original AIMA index for probabilistic context: https://aima.cs.berkeley.edu/aima-index.html .
Previous: Chain of trust Next: Chain rule of calculus