Bayesian Networks and Joint Factorization
A Bayesian network draws a joint probability distribution over many variables as a directed graph of arrows, and that graph is not just a picture — it is a literal recipe for factoring a huge joint distribution into a product of small, manageable pieces, one per variable.
Prerequisites: Probabilistic Graphical Models, Generative vs Discriminative Models
The joint probability of 10 binary variables, written out in full, has independent numbers to specify — and that count doubles with every additional variable. No one can write down, estimate, or reason about a table that size directly. A Bayesian network is the standard fix: draw the variables as nodes in a directed graph, with an arrow from each variable to whatever it directly influences, and that graph turns out to be exactly the information needed to factor the enormous joint distribution into a handful of small, local pieces — one modest table per node, instead of one astronomical table for everything at once.
The analogy: a recipe versus a finished dish's full ingredient interactions
Describing every possible flavor interaction between 10 ingredients in a dish directly — how salt interacts with garlic interacts with heat interacts with acid, all at once — would take an enormous, unmanageable table. A recipe never does this. It instead lists a sequence of small local steps: "sauté the garlic in oil" depends only on garlic and oil, not on what happens six steps later. The full flavor of the dish emerges from chaining these small, local dependencies together, not from ever writing down one giant combined table. A Bayesian network is this recipe structure applied to probability: each variable's distribution is specified only in terms of its direct parents in the graph, not the entire rest of the network, and the full joint distribution is recovered by chaining these local pieces together.
The factorization formula
A Bayesian network over variables with graph structure factors the joint distribution as:
In words: the probability of everything happening together is just the product, over every variable, of that variable's probability given only its direct parents in the graph — no variable's local table needs to mention any node it isn't directly connected to. If a variable has no parents, its local table is just its plain marginal probability.
Worked example 1: a 3-node chain, factoring the joint by hand
Take three variables: (heavy rain today, yes/no), (train delayed, yes/no), (arrives late to work, yes/no), with the causal chain (rain delays the train, a delayed train causes lateness — has no direct dependence on except through ). The full joint would naively need specified for all 8 combinations. The graph says instead: . Suppose , , , , . The probability of "it rained, the train was delayed, and I was late" is: . Only three small numbers multiplied together, none of which ever required a table over all three variables jointly.
Worked example 2: counting the savings
The chain above needs: 1 number for , 2 numbers for (one per value of ), 2 numbers for — 5 numbers total (the complementary probabilities like are implied by subtracting from 1). The naive full joint table over 3 binary variables needs independent numbers — already a saving, and the gap widens fast. Scale to 10 binary variables arranged as a chain (each depending only on the one before it): the network needs numbers total, versus for the full joint table — a roughly 50-fold reduction, purely from the graph telling you which variables can be ignored when specifying each local piece.
The exploding curve above is the same shape as the naive joint table's size, , as the number of variables grows — the whole reason Bayesian network factorization, which grows only linearly in a chain, matters at all.
A Bayesian network's directed graph is not decoration — it is a literal factorization recipe: the joint distribution over all variables equals the product of each variable's distribution conditioned only on its direct parents, replacing one astronomically large joint table with many small local ones.
What this means in practice
This factorization is what makes probabilistic reasoning over many variables computationally tractable at all — it underlies everything from medical diagnosis systems (symptom nodes depending on disease nodes) to credit risk models (default depending on a handful of directly relevant factors, not every economic variable simultaneously) to the structure behind causal DAGs used for identifying confounders. The graph itself is a modeling choice, usually built from domain knowledge about what genuinely causes or influences what — a wrong graph (missing an arrow, or drawing one that shouldn't exist) doesn't just make the model less accurate, it changes which conditional independencies the model assumes are true, which is exactly the subject of d-separation.
Practice
- For the rain-train-late chain, compute using the same numbers given.
- If a 4th variable, "meeting missed," depended only on , write out the new factorized joint distribution formula.
- Explain in one sentence why a Bayesian network's factorization only works correctly if the graph has no directed cycles.
The common confusion is thinking the arrows in a Bayesian network necessarily mean strict causation in the real-world sense — "rain causes delay" — when structurally, all the graph guarantees is a particular factorization and a set of conditional independence assumptions. Two different graphs can encode the exact same joint distribution while drawing the arrows in opposite directions (e.g. versus a graph capturing the same correlations differently), so reading a specific causal story directly off a Bayesian network's arrows, without separate causal justification, is a common and costly overreach.
Related concepts
Practice in interviews
Further reading
- Pearl, Probabilistic Reasoning in Intelligent Systems (1988)
- Koller & Friedman, Probabilistic Graphical Models (2009)