Three binary variables x1,x2,x3∈{0,1} form a chain MRF x1−x2−x3 with p(x)=1Zψ(x1,x2) ψ(x2,x3), where ψ(a,b)=3 if a=b and ψ(a,b)=1 if a≠b. What are Z, p(x2=0), p(x1=x2=x3=0) and p(x1=x3)?

Probabilistic models, Markov random fields
Level L2 Elementary. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can compute a partition function and marginals for a small MRF by summing products of potentials.

Key idea

Sum the product of potentials over all 23=8 states to get Z. Then each probability is a sum of some of these products divided by Z.

Steps

  1. Fix x2. Then the sum over x1 is ∑x1ψ(x1,x2)=3+1=4 for either value of x2. The same holds for the sum over x3.
  2. So Z=∑x24⋅4=16+16=32.
  3. p(x2=0)=16/32=0.5, which is expected from symmetry.
  4. The state (0,0,0) has unnormalised weight 3⋅3=9, so p(0,0,0)=9/32=0.281.
  5. x1=x3 can happen as (0,⋅,0) or (1,⋅,1). For (0,x2,0): x2=0 gives 9 and x2=1 gives 1⋅1=1, total 10. By symmetry (1,x2,1) also gives 10.
  6. So p(x1=x3)=20/32=0.625. Note that x1 and x3 agree more often than chance (0.5), even though they are not neighbours.

Common mistakes

How long your answer should be

Half a page.

Last checked on 4 December 2026.

Read this

Previous in Probabilistic models: You use a Metropolis random-walk sampler for the unnormalised target p~(x)=e−x2/2. The current state is x=1. Find the acceptance probability for the proposals x′=−0.5 and x′=2. If the uniform random number is u=0.3 for x′=2, is it accepted? Why is the normalising constant not needed?
Next in Probabilistic models: A scalar state follows xt=xt−1+wt with wt∼N(0,1), and we observe yt=xt+vt with vt∼N(0,4). After step t−1 the belief is xt−1∼N(2,3). The new observation is yt=5. What are the predicted and the updated beliefs?