Mapping the Sheet Problem to the Colored Doors

1. Initial State The Prior Belief

2. Step A: Prediction The Move Step (Odometry Model)

3. Step B: Correction The Sense Step (Measurement Model)

4. Step C: Normalization Normalization


Solution to the homework exercise for the ABC chain network.

1. Construct the full unnormalized joint distribution table P~(A,B,C)

First, we determine the values for the new factor ϕ2(B,C) based on the given rule:

The unnormalized joint probability for each state is calculated as P~(A,B,C)=ϕ1(A,B)ϕ2(B,C).

A B C ϕ1​(A,B) ϕ2​(B,C) P~(A,B,C)=ϕ1​(A,B)⋅ϕ2​(B,C)
0 0 0 30 10 3010=300
0 0 1 30 2 302=60
0 1 0 5 2 52=10
0 1 1 5 10 510=50
1 0 0 1 10 110=10
1 0 1 1 2 12=2
1 1 0 10 2 102=20
1 1 1 10 10 1010=100

2. Calculate the new Partition Function Znew

The partition function is the sum of the unnormalized weights for all possible assignments in the state space:

Znew=a,b,c{0,1}P~(a,b,c)Znew=300+60+10+50+10+2+20+100Znew=552

3. Calculate the probability P(A=0,B=0,C=1)

To find the normalized joint probability for this specific state, divide its unnormalized weight by the partition function:

P(A=0,B=0,C=1)=P~(A=0,B=0,C=1)ZnewP(A=0,B=0,C=1)=60552P(A=0,B=0,C=1)=5460.1087

4. Bonus: Find the marginal probability P(C=0)

To find the marginal probability for C=0, we marginalize out variables A and B. This means we sum the unnormalized probabilities of all states where C=0 and then divide by the partition function.

First, isolate the unnormalized weights where C=0:

Sum these unnormalized probabilities:

a,bP~(a,b,C=0)=300+10+10+20=340

Finally, normalize by dividing by Znew:

P(C=0)=340552P(C=0)=851380.6159

Q3 Explanation

1. The "Separation" Concept (The What)

Imagine a Markov Network as a group of people spreading a rumor.

Let's look at a simple chain: Alice — Bob — Charles.

Alice and Charles do not talk directly.

The Concept: Does knowing Alice's state tell you anything about Charles's state?

In network terms, we say Bob separates Alice and Charles. When a path is blocked by an observed node, the nodes on either side become conditionally independent.

2. Variable Elimination (The How)

So, separation tells us when nodes influence each other. But what if we want to know the probability of Charles knowing the rumor, but we can't observe Bob?

Since Bob is unobserved, information flows from Alice to Charles through him. To calculate the math for Alice and Charles, we have to deal with Bob.

Variable Elimination is the mathematical process of removing the middleman.

Since we don't know Bob's exact state, we must consider every possible state Bob could be in.

  1. We calculate the probability of the rumor passing if Bob is in State 0.

  2. We calculate the probability of the rumor passing if Bob is in State 1.

  3. We add those probabilities together.

By summing out all of Bob's possible states, we perfectly summarize his influence. We can then erase Bob from our graph entirely and draw a brand new, direct line connecting Alice and Charles. That new line is the "message" or "factor" we calculated. We "eliminated" the variable by doing the math for it.

Let’s bring the rumor analogy to the sheet problem!

We have four nodes locked in a cycle: Node 2, Node 4, Node 6, and Node 5.

The Problem with Loops (The "Echo Chamber")

Imagine Node 2, 4, 5, and 6 are friends standing in a circle. Node 2 starts a rumor.

If we just let them talk, the rumor bounces around the circle forever in an infinite feedback loop. The math completely breaks down because the probabilities keep multiplying endlessly.

To solve the math, we have to break the circle. We do this by systematically silencing people (eliminating them) while perfectly preserving what they would have said.

Step-by-Step Elimination

1. Eliminating Node 6 (Breaking the Cycle)

Node 6 only talks to Node 4 and Node 5. We take Node 6 aside and say, "We are going to remove you from the circle, but first, write down exactly how you would react to every possible rumor Node 4 and Node 5 could tell you."

Node 6 does the math (the 2×2+1×1=5 stuff we did earlier) and writes a "Manual of Node 6."

We hand this manual directly to Node 4 and Node 5.

2. Eliminating Node 4 (Folding the Triangle)

Now Node 4 is holding Node 6's manual, and is connected to Node 2 and Node 5.

We take Node 4 aside and say, "Your turn. Combine your own thoughts with Node 6's manual, and write down how you would react to Node 2 and Node 5."

Node 4 writes a new, thicker "Combined Manual" and hands it to Node 2 and Node 5.

3. Eliminating Node 5 (The Final Answer)

Only Node 2 and Node 5 are left. Node 5 takes the thick manual from Node 4, looks at how it feels about Node 2, does one final mathematical summary, and hands the ultimate result to Node 2.


Q: why didn't we do the same for the 1-2-3 triangle

When a group of nodes is completely interconnected like that (everyone is directly connected to everyone else), it is called a Clique. Eliminating a node from a clique is actually the cleanest and easiest part of the algorithm!

Let's look at why eliminating Node 3 from the 1-2-3 triangle is different from breaking the 4-node cycle we talked about earlier.

The Rumor Analogy: The Tight-Knit Group

Imagine Nodes 1, 2, and 3 are a tight-knit friend group.

We need to eliminate Node 3.

Just like before, Node 3 writes down a "manual" summarizing how it reacts to rumors from Node 1 and Node 2. Node 3 hands this manual to 1 and 2, and then goes home.

Here is the big difference:

When we eliminated Node 6 from the 4-person loop, Node 4 and Node 5 didn't have a direct line to each other. Node 6's manual forced them to build a brand new phone line.

In our 1-2-3 triangle, Node 1 and Node 2 already have a direct phone line (their original edge ψ12). They don't need to build a new connection. They just take Node 3's manual and tape it to their existing phone line.

The Math: Updating Instead of Creating

Mathematically, this means instead of creating a brand new factor, we just multiply Node 3's message into the factor that already exists between 1 and 2.

  1. Calculate the Message: Node 3 sums out its states based on its connections to 1 and 2.

    m3(X1,X2)=x3{0,1}ψ13(X1,x3)ψ23(X2,x3)
  2. Update the Edge: We take that message and multiply it directly into the existing connection between 1 and 2.

    ψ12new(X1,X2)=ψ12old(X1,X2)m3(X1,X2)

Why Triangles are Perfect

In graph theory, triangles are mathematically beautiful because they collapse without creating any structural mess. When you eliminate a node from a triangle, it cleanly folds down into a single straight line.

In fact, for really complex networks, computer scientists will purposely add "fake" edges to the graph before solving it just to turn all the messy loops into a bunch of triangles (a process called Triangulation).