Learn AI.
Build AI Systems · ORIGINAL LEARN AI LESSON

Factor a probabilistic model.

Build an eight-row joint distribution from local tables, test conditional independence, and separate observing a variable from intervening on it.

By the end: Multiply local conditional factors, sum hidden alternatives and normalize evidence; explain what a missing edge assumes and which extra assumptions an intervention calculation requires.

01 · TRY

Start with something concrete.

Machines with cooling on are often hot. Did cooling cause the heat, or are heavily loaded machines more likely to need cooling? A three-variable model makes the competing explanations inspectable.

Try the interactive model ↓
02 · PREDICT
Before you experiment

Cooling and heat are independent after the machine load is known. Must they also be independent before load is known?

Cooling and heat are independent after the machine load is known. Must they also be independent before load is known?
03 · EXPERIMENT

Change one thing. Watch what follows.

  1. Reconstruct one joint row by multiplying the load, cooling and heat factors. Sum all eight rows.
  2. Filter on cooling on and explain which rows contribute to the numerator and denominator for hot.
  3. Compare cooling/heat within each load group, then compare the unstratified observations.
  4. Force cooling on and inspect the removed incoming edge and replaced C factor. Compare with observing cooling on.
  5. Add the direct cooling-to-heat edge; change its conditional probabilities and inspect the changed independence claim.
  6. Create impossible observational evidence and compare it with a supported hypothetical intervention. Export a model-assumption audit.

Loading this browser experiment…

04 · UNDERSTAND

A pattern needs a model of how variables fit together

Suppose machines with cooling switched on are often hotter than machines with cooling off. It would be premature to conclude that cooling creates heat. Machines doing heavy work may both run hotter and be more likely to have their cooling turned on.

The lab uses three binary variables: L is high load, C is cooling on and H is hot. A value of 1 means yes, and 0 means no. All numbers are authored teaching assumptions. This is not a physical simulator, a learned graph or evidence about a real cooling system.

The first model has arrows L → C and L → H. Knowing load is assumed to account for the relationship between cooling and heat. A second model adds C → H and lets the probability of heat depend on the cooling setting even within the same load group.

A Bayesian network is a directed graph without directed cycles, together with local conditional probability tables. Its factorization describes a joint probability distribution. Arrows in an ordinary probability model are not, by themselves, proof of causal mechanisms. The lab’s intervention comparison adds a separate, explicit causal interpretation.

Reconstruct one possible world

Three binary variables have 2 × 2 × 2 = 8 complete assignments, or possible worlds. One row says low load, cooling on, hot: L = 0, C = 1, H = 1. In the shared-cause preset, its probability is:

P(L=0,C=1,H=1)=0.7×0.1×0.1=0.007P(L=0,C=1,H=1)=0.7\times0.1\times0.1=0.007

The factors mean: 70% low load; among low-load machines, 10% cooling on; among low-load machines, 10% hot. The model assumes that once load is fixed, the heat probability does not additionally depend on cooling. That last assumption is essential to using the same heat factor for both cooling values.

For the entire shared-cause network, the factorization is:

P(L,C,H)=P(L)P(C∣L)P(H∣L)P(L,C,H)=P(L)P(C\mid L)P(H\mid L)

Read it as: multiply the probability of the load state by the probability of the cooling state given that load, then by the probability of heat given that load. A factor for value 0 is the complement of the corresponding value-1 probability. If P(high load) = 0.3, the low-load factor is 1 − 0.3 = 0.7.

Inspect each of the eight rows. Their probabilities sum to one because every local table is normalized and the rows enumerate all assignments. The joint table has seven free probabilities after normalization. The shared-cause factorization uses five: one for load, two for cooling given load and two for heat given load. The reduction comes from the conditional-independence assumption, not from discarding an arbitrary row.

Filter evidence, sum hidden alternatives, normalize

Select the query “hot” and observe cooling on. Four rows match C = 1: low/high load crossed with not-hot/hot. The denominator adds all four probabilities. The numerator adds only the two retained rows with H = 1.

For the preset, the denominator is 0.7 × 0.1 + 0.3 × 0.8 = 0.31. The numerator is 0.7 × 0.1 × 0.1 + 0.3 × 0.8 × 0.8 = 0.199. Thus P(H = 1 | C = 1) = 0.199 ÷ 0.31, about 64.19%.

Unobserved load is not replaced by its most likely value. It is marginalized: sum both low-load and high-load alternatives with their probabilities. The row inspector shows whether a chosen row contributes to both numerator and denominator, only the denominator or neither.

If the evidence has probability zero, conditioning is undefined. For example, if cooling-on probability is zero in both load groups, no observational rows with C = 1 have positive mass. Do not turn that absence into a zero probability of heat. If the query variable itself is observed, its conditional probability is 0 or 1 only when the full evidence has positive probability.

Independence can appear after conditioning

In the shared-cause preset, heat is 10% likely among low-load machines regardless of cooling, and 80% likely among high-load machines regardless of cooling. We write:

C⊥H∣LC\perp H\mid L

The perpendicular symbol here means independence; the bar means “given.” Read it as: cooling and heat are independent once load is known. The lab checks both cooling settings within each load stratum. When a conditioning group has zero probability, its conditional comparison is undefined; that is not a numerical test of equality.

Before load is known, the variables are associated. Cooling-on machines are disproportionately high-load machines: P(L = 1 | C = 1) = 0.24 ÷ 0.31, about 77.42%, compared with 30% high load overall. That changed mixture explains why observing cooling on predicts more heat even though the within-load heat probabilities do not change.

Add the direct C → H edge. The factor for heat becomes P(H | L,C), with four value-1 probabilities rather than two. The graph no longer imposes the preceding conditional independence. You could choose equal table entries and make it hold numerically, but it is no longer guaranteed by the structure. An extra edge permits a dependence; it does not force every parameter setting to exhibit one.

Observing a setting does not replace its mechanism

Ordinary conditioning retains the original process that selected cooling. It focuses on machines already assigned C = 1, which changes our belief about their load. An intervention instead asks what would happen if a setting were forced by an external action.

Under the explicitly assumed causal model, an ideal intervention do(C = 1) replaces the cooling-assignment mechanism. The L → C edge is removed; the C factor becomes 1 for the forced value and 0 for the other value. The load distribution and heat mechanism are assumed unchanged. Filtering observational rows while keeping their old C likelihood factors would answer a different question.

For the shared-cause model, forcing either cooling setting leaves heat probability at 0.7 × 0.1 + 0.3 × 0.8 = 31%. Observing cooling on gives 64.19%, but forcing it gives 31%. This is a consequence of this particular model’s missing direct effect, not a claim that cooling has no effect in real machines.

Add a specified direct effect

The direct-cooling preset sets heat probabilities with cooling on to 2% at low load and 20% at high load. With cooling off they remain 10% and 80%. The resulting intervention prediction is:

P(H=1∣do⁡(C=1))=0.7(0.02)+0.3(0.20)=0.074P(H=1\mid\operatorname{do}(C=1))=0.7(0.02)+0.3(0.20)=0.074

Forcing cooling on gives 7.4% heat probability; forcing it off gives 31%. Observing cooling on instead gives approximately 15.94%, because the observational group still contains more high-load machines. These quantities are calculated from the same specified mechanisms but describe different operations.

The causal calculation requires more than normalized tables. The proposed mechanisms and causal directions must be appropriate, important common causes must not be omitted in a way that invalidates the model, and forcing the setting must leave the other mechanisms as specified. A drawing or a fit to observational data does not automatically establish those conditions.

If observational cooling-on cases are absent, the lab can still compute a hypothetical intervention from supplied heat tables. That numerical result is an extrapolation under assumed mechanisms, not evidence that observational data identified it. More general identification, confounding, experimental design and counterfactual questions are reserved for the later causal-reasoning lesson.

Audit a compact model

For guided work, reconstruct one row and one conditional query from the eight-row table. Explain why the shared-cause model can produce an unstratified association and conditional independence at the same time.

For implementation work, reproduce enumeration and compare the intervention result with an independently written two-term load-weighted sum. Test normalization, endpoint probabilities, evidence on the query itself and a conflicting observation after an intervention. For a decision brief, separate what is associated in the specified population from what would happen under a proposed action, then state which additional assumptions or experiments you would need.

Capture up to three configurations and export a bounded note before leaving. The lab is exact for its eight-row authored model, not a validated causal analysis of a real system. It adds no new project qualification or required path percentage. Human review and learner pilots remain pending.

05 · APPLY
Check your understanding

To calculate an ideal intervention do(C = 1) under the stated causal model, what changes?

To calculate an ideal intervention do(C = 1) under the stated causal model, what changes?
06 · CONTINUE

Take this idea with you.

Local probability tables and a graph encode a joint distribution and its assumptions. Exact inference multiplies, sums and normalizes. Causal intervention is an additional model claim, not a synonym for conditioning.

My work
Learn AI · Understand by doing.Loading local progress…Copyright (c) 2026 Mobi Weave, Inc. All rights reserved