∑GATE DA Atlas

Conditional Independence and Bayesian Networks

Representing uncertainty with full joint distributions and why they don't scale, independence and conditional independence, Bayesian networks (DAG + CPTs) and the chain-rule factorisation, parameter counting, the three connection types (chain, fork, collider) and explaining away, d-separation, Markov blankets, and computing joint, marginal and conditional probabilities from a network.

Section 79 practice questions

The problem with full joint distributions

A complete probabilistic model of nn Boolean variables is the full joint distribution — 2n−12^n - 1 numbers. It answers any query by summing entries (marginalisation), but for 30 variables it needs about 10910^9 numbers: impossible to store, estimate or reason with.

Independence is the key to compactness:

  • X⊥YX \perp Y (marginal independence): P(X,Y)=P(X)P(Y)P(X, Y) = P(X)P(Y).
  • X⊥Y∣ZX \perp Y \mid Z (conditional independence): P(X,Y∣Z)=P(X∣Z)P(Y∣Z)P(X, Y\mid Z) = P(X\mid Z)P(Y\mid Z), equivalently P(X∣Y,Z)=P(X∣Z)P(X\mid Y, Z) = P(X\mid Z).

Conditional independence is far more common in practice: a toothache and a dentist's probe catching are dependent, but independent given whether there is a cavity. Naive Bayes is the simplest structure exploiting it (see naive Bayes).

Bayesian networks

A Bayesian network is a directed acyclic graph (DAG) where

  • nodes are random variables;
  • an edge X→YX \to Y means XX directly influences YY (often causally);
  • each node XiX_i has a conditional probability table (CPT) P(Xi∣Parents(Xi))P(X_i\mid\text{Parents}(X_i)).

The network represents the joint distribution as a product of local factors:

P(x1,…,xn)=∏i=1nP(xi∣parents(Xi)).P(x_1, \dots, x_n) = \prod_{i=1}^n P\big(x_i\mid\text{parents}(X_i)\big).
Burglary Earthquake Alarm JohnCalls MaryCalls P(B)=.001P(E)=.002 P(A|B,E) table: 4 rows P(J|A)=.90, P(J|¬A)=.05P(M|A)=.70, P(M|¬A)=.01
Ten numbers specify all 32 joint probabilities.

Compactness

A Boolean node with kk Boolean parents needs 2k2^k CPT numbers. With nn nodes and at most kk parents each, the network needs O(n2k)O(n2^k) numbers instead of O(2n)O(2^n).

Building a network: order the variables (causes before effects works best), and for each variable choose as parents a minimal set of predecessors that renders it independent of the other predecessors. A bad ordering (effects first) produces a denser, less intuitive network with more parameters — but it still represents the same distribution.

Independence in the graph

Local Markov property: each node is conditionally independent of its non-descendants given its parents.

The three connection types

PatternNamePath blocked when the middle node is…Example
X→Y→ZX \to Y \to Zchain (causal)observedBurglary → Alarm → JohnCalls
X←Y→ZX \leftarrow Y \to Zfork (common cause)observedJohnCalls ← Alarm → MaryCalls
X→Y←ZX \to Y \leftarrow Zcollider (common effect, v-structure)unobserved (and no descendant observed)Burglary → Alarm ← Earthquake

Explaining away: two independent causes become dependent once their common effect is observed. If the alarm sounds, an earthquake report "explains" it and makes burglary less likely.

d-separation

Sets XX and YY are d-separated by evidence ZZ if every undirected path between them is blocked; then X⊥Y∣ZX \perp Y \mid Z for every distribution the network represents. A path is blocked if it contains

  • a chain or fork whose middle node is in ZZ, or
  • a collider whose middle node is not in ZZ and has no descendant in ZZ.

Markov blanket

Parents + children + children's other parents. Given its Markov blanket, a node is independent of everything else in the network.

Reasoning with a network

TypeDirectionExample
Causal (predictive)cause → effectP(J∣B)P(J\mid B)
Diagnosticeffect → causeP(B∣J)P(B\mid J)
Intercausalbetween causes of a common effectP(B∣A,E)P(B\mid A, E) (explaining away)
MixedcombinationsP(A∣J,¬E)P(A\mid J, \neg E)

Any query P(X∣e)P(X\mid \mathbf e) can be answered from the factorisation by summing out the hidden variables — exactly, by enumeration or variable elimination, or approximately by sampling.

Quick revision

Practice questions

GATE-style questions: 3 one-mark and 6 two-mark. Wrong MCQs cost ⅓ of their marks in the real exam; MSQ and NAT have no negative marking. Attempt each before opening the solution.

Q1NAT2 marks

Alarm network. Burglary BB and Earthquake EE are independent causes of Alarm AA; JohnCalls JJ and MaryCalls MM each depend only on AA. All variables are Boolean. P(B)=0.001P(B) = 0.001, P(E)=0.002P(E) = 0.002; P(A∣B,E)=0.95P(A\mid B, E) = 0.95, P(A∣B,¬E)=0.94P(A\mid B, \neg E) = 0.94, P(A∣¬B,E)=0.29P(A\mid\neg B, E) = 0.29, P(A∣¬B,¬E)=0.001P(A\mid\neg B, \neg E) = 0.001; P(J∣A)=0.90P(J\mid A) = 0.90, P(J∣¬A)=0.05P(J\mid\neg A) = 0.05; P(M∣A)=0.70P(M\mid A) = 0.70, P(M∣¬A)=0.01P(M\mid\neg A) = 0.01.

The joint probability P(J,M,A,¬B,¬E)P(J, M, A, \neg B, \neg E), expressed in units of 10−410^{-4}, is ______ (round to one decimal).

Q2NAT1 mark

Alarm network. Burglary BB and Earthquake EE are independent causes of Alarm AA; JohnCalls JJ and MaryCalls MM each depend only on AA. All variables are Boolean. P(B)=0.001P(B) = 0.001, P(E)=0.002P(E) = 0.002; P(A∣B,E)=0.95P(A\mid B, E) = 0.95, P(A∣B,¬E)=0.94P(A\mid B, \neg E) = 0.94, P(A∣¬B,E)=0.29P(A\mid\neg B, E) = 0.29, P(A∣¬B,¬E)=0.001P(A\mid\neg B, \neg E) = 0.001; P(J∣A)=0.90P(J\mid A) = 0.90, P(J∣¬A)=0.05P(J\mid\neg A) = 0.05; P(M∣A)=0.70P(M\mid A) = 0.70, P(M∣¬A)=0.01P(M\mid\neg A) = 0.01.

The number of independent numbers needed to specify all the CPTs of this network is ______.

Q3MCQ2 marks

In the network B→A←EB \to A \leftarrow E (two causes of a common effect), which statement is true?

Q4MSQ2 marks

Which conditional-independence statements are implied by the network structure (for all choices of CPTs)?

One or more options are correct.

Q5NAT2 marks

Alarm network. Burglary BB and Earthquake EE are independent causes of Alarm AA; JohnCalls JJ and MaryCalls MM each depend only on AA. All variables are Boolean. P(B)=0.001P(B) = 0.001, P(E)=0.002P(E) = 0.002; P(A∣B,E)=0.95P(A\mid B, E) = 0.95, P(A∣B,¬E)=0.94P(A\mid B, \neg E) = 0.94, P(A∣¬B,E)=0.29P(A\mid\neg B, E) = 0.29, P(A∣¬B,¬E)=0.001P(A\mid\neg B, \neg E) = 0.001; P(J∣A)=0.90P(J\mid A) = 0.90, P(J∣¬A)=0.05P(J\mid\neg A) = 0.05; P(M∣A)=0.70P(M\mid A) = 0.70, P(M∣¬A)=0.01P(M\mid\neg A) = 0.01.

The marginal probability P(A)P(A) that the alarm sounds, in units of 10−310^{-3}, is ______ (round to two decimals).

Q6MCQ1 mark

The Markov blanket of a node in a Bayesian network consists of its

Q7NAT1 mark

A Boolean node has three Boolean parents. Its conditional probability table needs how many independent numbers? ______

Q8MCQ2 marks

A network has edges A→BA \to B, B→CB \to C, A→DA \to D, D→CD \to C. Given {B,D}\{B, D\}, are AA and CC d-separated?

Q9NAT2 marks

Rain RR causes wet grass WW: P(R)=0.2P(R) = 0.2, P(W∣R)=0.9P(W\mid R) = 0.9, P(W∣¬R)=0.1P(W\mid\neg R) = 0.1. Given that the grass is wet, P(R∣W)P(R\mid W) is ______ (round to two decimals).