A Bayesian network has a root X0 and n children X1,…,Xn, with arrows X0→Xi, all variables binary. To compute P(X1) with no evidence, compare the cost of eliminating X0 first against eliminating Xn,…,X2 first. What is the induced width in each case?

Probabilistic models, Exact inference
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you understand that the cost of variable elimination depends on the elimination order, through the size of the intermediate factors.

Key idea

Eliminating a variable multiplies all factors that mention it and sums it out. The new factor involves all its neighbours at that moment, so its size is 2(number of neighbours).

Steps

  1. The joint is P(X0)∏i=1nP(Xi∣X0). For the query X1, we must sum out X0,X2,…,Xn.
  2. Order 1: eliminate X0 first. All n+1 factors mention X0, so we multiply them into one factor over X1,…,Xn and sum out X0. The new factor τ(X1,…,Xn) has 2n entries. Cost is exponential in n.
  3. Order 2: eliminate Xn first. Only P(Xn∣X0) mentions it, and ∑xnP(xn∣X0)=1, so we get a factor over X0 alone with 2 entries.
  4. Repeat for Xn−1,…,X2. Each step creates a factor of size 2. Finally P(X1)=∑x0P(x0) P(X1∣x0). Total cost is O(n).
  5. Induced width (largest clique created minus 1): order 1 creates a clique on X0,…,Xn of size n+1, giving width n. Order 2 creates cliques of size 2, giving width 1.
  6. Lesson: finding the best order is NP-hard in general, but greedy rules such as min-neighbours or min-fill work well in practice.

Common mistakes

How long your answer should be

Half a page.

Last checked on 4 December 2026.

Read this

Previous in Probabilistic models: In a network B→A←E (burglary, alarm, earthquake), P(B=1)=0.01 and P(E=1)=0.02. The alarm probabilities are P(A=1∣B=1,E=1)=0.95, P(A=1∣B=1,E=0)=0.94, P(A=1∣B=0,E=1)=0.29 and P(A=1∣B=0,E=0)=0.001. What are P(B=1∣A=1) and P(B=1∣A=1,E=1), and why do they differ?
Next in Probabilistic models: Three binary variables form a chain x1−x2−x3 with unary factors ϕ1=(1,2), ϕ2=(1,1), ϕ3=(3,1) (for values 0 and 1), and the same pairwise factor on both edges, ψ(a,b)=2 if a=b and 1 otherwise. Using sum-product messages, what are p(x2) and p(x3)?