Exercises
ch18-ex01
EasyWrite the sum-product message updates for a binary variable factor graph with factor , .
Compute explicitly.
Substitute
.
Evaluate at $x_2 = \pm 1$
, .
LLR form
where . Simplifying, .
ch18-ex02
EasyFor a parity check of degree 3, incoming LLRs are . Compute the outgoing message on edge 1 using the exact check-node update. What does min-sum give?
Exact: .
Min-sum: .
Exact
. . Product . .
Min-sum
Signs: . Magnitudes: . .
Comparison
Min-sum magnitude (1.5) is larger than exact (1.31) — min-sum overestimates. A scale factor would match; normalized min-sum uses .
ch18-ex03
MediumProve that the BP threshold of the -regular ensemble on the BEC satisfies at (where the iteration map has a tangent fixed point). Solve numerically.
Tangent fixed point: both and .
.
Fixed-point equations
and .
Eliminate $\epsilon$
From first: . Substitute in the second: .
Numerical solution
Solve numerically. Root: . Then .
ch18-ex04
MediumA (2,4)-regular LDPC code has rate . Compute its BP threshold on the BEC and compare to the Shannon limit.
Density evolution: .
Density evolution
. Recursion: .
Tangent fixed point
Solve and . From second: . Substitute: , i.e., . Expand: . LHS: . Equation: , i.e., , i.e., . Nontrivial root ? Fails . So the equation does not have a tangent fixed point in , meaning no inflection and whenever the map first fails to drive .
Check monotonicity
is convex increasing. Zero fixed point is stable iff , i.e., . So .
Shannon gap
Shannon: . Gap . The (2,4) code is much further from Shannon than the (3,6) code. Variable degree 2 is too small — one of the reasons (3,6) is canonical.
ch18-ex05
EasyApply the Viterbi algorithm to the trellis with branch metrics per transition: from state 0: ; from state 1: . Find the most likely state path of length 3 (i.e., ) by max-product.
Work in log-domain: max-sum.
Keep backpointers.
Step 1
From : .
Step 2
, bp = 1. , bp = 0.
Step 3
, tie (bp = 0 or 1). , bp = 0.
Traceback
Best end state: (metric vs ). Traceback: bp at 3 says ; bp at 2 says ; given. Path: . Most likely sequence.
ch18-ex06
MediumShow that the LDPC BP iteration on the BEC can be tracked exactly by a scalar variable (erasure probability), justifying the density-evolution simplification.
On BEC, messages are binary: known or erased.
Message state
Each BP message on the BEC is either fully informative or erased. In density evolution, this is captured by the probability of erasure for a randomly chosen variable-to-check edge.
Recursion
Variable-to-check erased iff channel erased AND all other incoming check messages erased: . Check-to-variable erased iff any of other variable-to-check inputs is erased.
Close recursion
Plug in: for regular , equivalent to for irregular.
ch18-ex07
MediumImplement Gaussian BP in pseudocode for the precision matrix and . Verify convergence to .
This is a chain — tree, so one outward/inward pass suffices.
Direct inversion
. Cofactors give . .
GaBP on chain
Graph: with edges weighted by . Forward: , . Then at node 2: , . Backward analogously.
Beliefs
. . . ✓ Similarly .
ch18-ex08
MediumExplain why the BP threshold is always strictly less than the Shannon limit for regular LDPC ensembles.
Regular codes have finite variable degree.
Suboptimality of BP
BP makes only local decisions — it cannot exploit long-range correlations that the optimal decoder can use. This creates a nonzero gap.
Formal statement
For -regular codes with , the MAP threshold equals asymptotically, but the BP threshold is strictly smaller. The gap shrinks as (and grows accordingly).
Irregular codes
By carefully mixing degrees, irregular codes can push to within of — essentially matching Shannon.
ch18-ex09
HardProve that GaBP means are exact on any convergent graph. Specifically, show that the GaBP fixed-point equations for the potentials imply .
Sum the GaBP updates across all incoming edges of each node.
Combine update equations
Fixed-point messages satisfy expressions in terms of . Write where , .
Row-wise verification
Substitute the message fixed-point equations into and simplify. After algebra (Schur complement identities), this equals . Hence for every .
Walk-sum interpretation
Alternative proof: expand as a walk-sum ; GaBP's update collects all walks from sources to even on loopy graphs.
ch18-ex10
HardConsider loopy BP on a graph with two fixed points. What determines which fixed point the algorithm converges to? Describe a practical test for this bistability.
Basin of attraction depends on initial messages.
Attraction basins
Each stable fixed point has a basin of attraction in message space. The initialization determines which basin the trajectory enters.
Diagnostic
Run BP from multiple random initializations. If outputs differ, the system has multiple fixed points and the solution is initialization-dependent — a sign of underlying model multimodality.
Bethe free energy interpretation
Each fixed point corresponds to a Bethe free energy stationary point. The 'correct' fixed point is usually the global minimum, but BP can get stuck at local minima.
ch18-ex11
EasyA binary symmetric channel has crossover probability . What is the channel LLR at bit if ? If ?
.
Compute
. when . when .
ch18-ex12
MediumCompare the per-iteration cost of GaBP vs. direct matrix inversion for a sparse Gaussian graph with nodes and edges.
GaBP: per iteration.
Direct: dense, sparse (fill-in dependent).
GaBP
scalar ops per iteration. With 20 iterations: ops.
Direct
Dense inversion: — intractable. Sparse direct solver: , similar but with factorization overhead.
Conclusion
GaBP is competitive with sparse direct solvers and more parallel-friendly. Advantage grows with sparsity.
ch18-ex13
MediumWrite the sum-product algorithm for an HMM with discrete states: specialize the generic rules to forward-backward.
Forward message = ; backward = .
Forward
.
Backward
.
Marginal
. Forward-backward is sum-product on the HMM factor graph.
ch18-ex14
MediumIn the LDPC decoding iteration, suppose all variable nodes have channel LLR (channel provides no information, e.g., BEC with ). Prove that BP cannot break the symmetry — all messages remain zero forever.
Show is a fixed point.
Zero fixed point
If all , then variable-node update gives . Then variable-to-check . Fixed.
Interpretation
Without channel information, BP remains uncertain. This is the erasure limit: nothing to decode.
Minimal evidence
Any tiny nonzero channel LLR (say from a single non-erased bit) propagates through iterations, breaking symmetry. BP is symmetry-aware.
ch18-ex15
HardProve that the max-product algorithm on a tree factor graph computes the joint MAP configuration via backpointers, and explain why taking independently at each node may fail when MAP ties exist.
Consider an even-symmetric factor with two equally optimal joint configurations.
Backpointer correctness
Each factor-to-variable update selects the best configuration of its -ary factor given the best incoming messages. Storing the argmax at each step creates a chain of optimal choices consistent across the tree.
Independent argmax can fail on ties
Example: . Max-marginals are uniform, so gives any tied choice independently per node — could yield , which has probability zero. Backpointers resolve ties consistently.
Lesson
Always follow backpointers for joint MAP reconstruction on trees. Independent argmax is incorrect when the posterior has symmetries.
ch18-ex16
MediumWrite the Gaussian BP message update for a node with neighbors, using the precision-form parameterization.
Messages are scalar pairs.
Node aggregation
At node , incoming messages for . Total precision: . Total potential: .
Outgoing to $j$
Exclude neighbor : . .
ch18-ex17
EasyName two signal-processing problems that are naturally solved by Gaussian BP on a tree factor graph.
Linear Gaussian state space.
Examples
(1) Kalman filter/smoother: HMM with Gaussian transitions and emissions → chain factor graph, GaBP = Kalman filter. (2) Gaussian Markov random field denoising on a tree (e.g., along a pyramid or quadtree).
ch18-ex18
MediumShow that for a repetition code (where every bit must equal every other), the BP decoder is equivalent to majority voting.
All bits share one big equality constraint.
Factor graph
variable nodes connected to a single factor .
BP update
Variable-to-factor: . Factor-to-variable: (by the equality-check factor: flipping any one bit is infeasible, so the message is of the others).
Belief
. Decision: majority.
ch18-ex19
HardA 3-cycle factor graph has three binary variables with pairwise factors , . Find the loopy BP fixed point by exploiting symmetry, and compare the predicted marginals to the true ones.
By symmetry, all messages are equal.
Symmetric fixed point
All messages equal for some . The check-node update: , where is the common LLR. Solving: (the fixed point matches the intrinsic pairwise strength).
BP belief
, so .
True marginal
By symmetry, . BP is wrong — it says a skewed marginal because the cycle has created phantom correlation. Loopy BP fails on this small graph.
Moral
Short cycles combined with strong coupling can severely mislead loopy BP. Longer cycles or weaker coupling would improve performance.
ch18-ex20
ChallengeDerive density evolution for a irregular LDPC ensemble on the binary-input AWGN channel, tracking the message LLR density (not probability). Outline the challenge and the Gaussian approximation.
Messages are real-valued, not binary.
Gaussian approximation: track only mean.
Density recursion
Let be the density of variable-to-check messages at iteration . Variable-node update: convolution of check messages with channel LLR. Check-node update: a nonlinear transform via .
Gaussian approximation
Assume (symmetric Gaussian). Track only . Then density evolution reduces to a scalar recursion in : function of (involves expectations under Gaussian).
Threshold from recursion
Threshold SNR = largest SNR for which fails. For -regular on BI-AWGN: threshold dB (Shannon limit for rate 1/2: dB, gap 0.92 dB).