✅ Chrysalis was down earlier today (server issue) but is back up now. It's still offline for the scheduled outage Thu Jun 11 (9:30 AM) – Fri Jun 12 (noon).
📢 Deadlines still extended: Chat 4 → Tue Jun 16, Chat 5 → Thu Jun 18.
📝 Assignment 1 questions → Dake Zhang on Piazza.
Search›Uncertainty›Decisions›Learning
Learning goals
Do inference in Bayes nets more efficiently than the joint
Define factors and the four operations on them
Trace the variable elimination algorithm for prior / posterior queries
Explain how the elimination ordering affects complexity
Know the basics of approximate inference (sampling)
A query in the Holmes BN: \(P(B | w \wedge g)\)
"What's the probability of a burglary, given that both Watson and Gibbon called?"
Query variable:\(B\)
Evidence variables:\(W = w, G = g\)
Hidden variables: \(E, A, R\) (to be summed out)
Convention: capital letters are random variables, lowercase letters are specific values.
B — 14 ops. Inner sum over \(a\): \(4\text{ mul} + 1\text{ add} = 5\); times 2 for the two values of \(e\) \(\Rightarrow 10\); multiply each by \(P(e)\): \(+2\); sum the two \(e\)-terms: \(+1\); multiply by \(P(B)\): \(+1\). Total \(= 14\). ~3x speedup just from re-ordering.
The big idea
Reuse intermediate computations — dynamic programming for probabilities.
Exploit conditional independence baked into the Bayes net.
Push sums in as far as possible, then operate on small tables of probabilities — factors.
This is the Variable Elimination Algorithm.
Factors
A factor \(f(X_1, \ldots, X_j)\) is a function from random-variable assignments to a number. It can represent a joint, a conditional, or a partial assignment.
Summing out \(X_1\) from \(f(X_1, \ldots, X_j)\) gives a factor on \(X_2, \ldots, X_j\) defined by \(\bigl(\sum_{X_1} f\bigr)(X_2, \ldots, X_j) = \sum_{v} f(X_1 = v, X_2, \ldots, X_j)\).
Example: \(\sum_Y f_1(X, Y) \;\to\; f_2(X)\)
\(f_1(X, Y)\)
X
Y
val
t
t
0.1
t
f
0.4
f
t
0.3
f
f
0.5
\(\xrightarrow{\sum_Y}\)
\(f_2(X) = \sum_Y f_1\)
X
val
t
0.1 + 0.4 = 0.5
f
0.3 + 0.5 = 0.8
Multiply two factors
\((f_1 \times f_2)(X, Y, Z) = f_1(X, Y)\cdot f_2(Y, Z)\) for shared \(Y\) — the product is over the union of variables.
\(f_1(X, Y)\)
X
Y
val
t
t
0.1
t
f
0.9
f
t
0.2
f
f
0.8
\(\times\)
\(f_2(Y, Z)\)
Y
Z
val
t
t
0.3
t
f
0.7
f
t
0.6
f
f
0.4
\(=\)
\(f_1 \times f_2\)
X
Y
Z
val
t
t
t
0.03
t
t
f
0.07
t
f
t
0.54
t
f
f
0.36
f
t
t
0.06
f
t
f
0.14
f
f
t
0.48
f
f
f
0.32
Normalize a factor
Divide every entry by the sum, so the values sum to 1 (a valid probability distribution).