---
title: "Problem set 7: error-control coding"
heading: "Problem set 7: block, convolutional, Reed–Solomon and LDPC codes, interleaving and puncturing, and iterative decoding"
eyebrow: S8 · Problem set 7
type: problems
---

::: hook
These problems cover lessons 34 to 37: block code parameters, error correction and block error rates, convolutional trellises, free distance and Viterbi complexity, Reed–Solomon codes and interleaving, LDPC rates and graphs, density evolution, and belief-propagation messages.
:::

::: pool
pick: 12

::: check
kind: parts
given: d = 3 | 5 | 7 | 8; m = 3 | 5

## A code with $d_\text{min}$ = {d}; and the Hamming code with m = {m} check bits.

::: part
answer: floor((d - 1)/2 + 0.0001)
tolerance: 0

### Errors corrected?

::: misses
- [any] $\lfloor(d - 1)/2\rfloor$.
:::
:::

::: part
answer: d - 1
tolerance: 0

### Errors detected?

::: misses
- [any] $d - 1$.
:::
:::

::: part
answer: (2^m - 1 - m)/(2^m - 1)
tolerance: 0.5%

### The Hamming code's rate?

::: misses
- [any] $k/n$ with $n = 2^m - 1$.
:::
:::
:::

::: check
kind: parts
given: n = 7 | 23; p = 0.005 | 0.02; R = 0.5 | 0.57; E = 5 | 8

## A single-error-correcting code of length {n} with raw error probability {p}; separately, a rate-{R} code at Eb/N0 = {E} dB.

::: part
answer: 1 - (1 - p)^n - n*p*(1 - p)^(n - 1)
tolerance: 0.5%

### Block error probability?

::: misses
- [any] More than one error.
:::
:::

::: part
answer: Q(sqrt(2*R*10^(E/10)))
tolerance: 1%

### Coded-bit error probability (hard BPSK)?

::: misses
- [any] $Q(\sqrt{2RE_b/N_0})$.
:::
:::
:::

::: check
kind: parts
given: K = 3 | 5 | 7; d = 5 | 7 | 10; R = 0.5 | 0.333

## A rate-{R} convolutional code with constraint length {K} and $d_\text{free}$ = {d}.

::: part
answer: 2^(K - 1)
tolerance: 0

### Trellis states?

::: misses
- [any] $2^{K-1}$.
:::
:::

::: part
answer: 10*log(R*d)
unit: dB
tolerance: 0.05

### Asymptotic soft-decision gain?

::: misses
- [any] $10\log(Rd_\text{free})$.
:::
:::

::: part
answer: 5*K
tolerance: 0

### Traceback depth (rule of thumb)?

::: misses
- [any] About 5K.
:::
:::
:::

::: check
kind: parts
given: B = 3 | 25; d = 6 | 10; E = 3.5 | 5

## A rate-1/2 code with $d_\text{free}$ = {d}, $B_d$ = {B}, soft decisions at {E} dB.

::: part
answer: B*Q(sqrt(2*0.5*d*10^(E/10)))
tolerance: 1%

### Bit error estimate?

::: misses
- [any] $B_dQ(\sqrt{2Rd_\text{free}E_b/N_0})$.
:::
:::

::: part
answer: Q(sqrt(2*10^(E/10)))
tolerance: 1%

### Uncoded BPSK at the same Eb/N0?

::: misses
- [any] $Q(\sqrt{2E_b/N_0})$.
:::
:::
:::

::: check
kind: parts
given: n = 255 | 127; t = 4 | 8 | 16; m = 7 | 8; let k = n - 2*t

## A Reed–Solomon code with n = {n}, k = {k} and {m}-bit symbols.

::: part
answer: (n - k)/2
tolerance: 0

### Symbol errors corrected?

::: misses
- [any] (n − k)/2.
:::
:::

::: part
answer: n - k
tolerance: 0

### Erasures it could fill instead?

::: misses
- [any] n − k.
:::
:::

::: part
answer: ((n - k)/2 - 1)*m + 1
unit: bits
tolerance: 0

### Guaranteed burst length?

::: misses
- [any] $(t - 1)m + 1$.
:::
:::
:::

::: check
kind: parts
given: B = 29 | 67; D = 4 | 8; b = 2 | 4 | 6; let a = b + 1

## A {B}-symbol burst through a depth-{D} interleaver; and a rate-1/2 code punctured to send {a} bits per {b} data bits.

::: part
answer: ceil(B/D - 0.0001)
tolerance: 0

### Worst codeword's share?

::: misses
- [any] ⌈B/D⌉.
:::
:::

::: part
answer: b/a
tolerance: 0.5%

### Punctured rate?

::: misses
- [any] Data over sent bits.
:::
:::
:::

::: check
kind: parts
given: m = 4 | 5 | 6; E = 30 | 45

## Hamming codes with m = {m}, and Rayleigh BPSK at {E} dB.

::: part
answer: 2^m
tolerance: 0

### Syndromes ($2^{n-k}$)?

::: misses
- [any] $2^m$.
:::
:::

::: part
answer: 1/(4*10^(E/10))
tolerance: 1%

### Rayleigh error rate, high-SNR approximation?

::: misses
- [any] $1/(4\bar\gamma)$.
:::
:::
:::

::: check
kind: parts
given: n = 1200 | 64800; v = 3 | 4; c = 6 | 12; e = 0.3 | 0.4

## A ({v}, {c})-regular LDPC code of length {n} is used on an erasure channel with ε = {e}.

::: part
answer: 1 - v/c
tolerance: 0.5%

### Design rate?

::: misses
- [any] $1 - d_v/d_c$.
:::
:::

::: part
answer: n*v/c
tolerance: 0

### Number of check nodes?

::: misses
- [any] $nd_v/d_c$.
:::
:::

::: part
answer: e*(1 - (1 - e)^(c - 1))^(v - 1)
tolerance: 0.5%

### Erasure probability on bit-to-check messages after one iteration?

::: misses
- [any] $\epsilon(1 - (1 - \epsilon)^{d_c - 1})^{d_v - 1}$.
:::
:::
:::

::: check
kind: parts
given: c = 0.5 | 1.5; a = 1 | 1.5; b = 2 | 4

## A belief-propagation decoder: a bit with channel LLR {c} receives {a} and {b} from two checks; a check receives {a} and {b} from two bits.

::: part
answer: c + a + b
tolerance: 0.5%

### What does the bit send to its third check?

::: misses
- [any] Sum the channel LLR and the other incoming LLRs.
:::
:::

::: part
answer: ln((1 + (exp(a) - 1)/(exp(a) + 1)*(exp(b) - 1)/(exp(b) + 1))/(1 - (exp(a) - 1)/(exp(a) + 1)*(exp(b) - 1)/(exp(b) + 1)))
tolerance: 0.5%

### What does the check send to its third bit, by the tanh rule?

::: misses
- [any] $2\,\text{atanh}(\tanh(a/2)\tanh(b/2))$.
:::
:::

::: part
answer: a
tolerance: 0.5%

### And by min-sum?

::: misses
- [any] The smaller magnitude, with the product of the signs.
:::
:::
:::

::: check
kind: parts
given: n = 7 | 15 | 23 | 31; t = 1 | 2

## A binary code of length {n} must correct every pattern of up to {t} error(s).

::: part
answer: 1 + n + step(t - 1.5)*n*(n - 1)/2
unit: patterns
tolerance: 0

### How many error patterns, counting no error, must have distinct syndromes?

::: misses
- [any] Add $\binom{n}{i}$ for i from 0 to t.
:::
:::

::: part
answer: ceil(log(1 + n + step(t - 1.5)*n*(n - 1)/2)/log(2) - 1e-9)
unit: bits
tolerance: 0

### How many parity bits does the Hamming bound require, at least?

::: misses
- [any] The smallest r with $2^r \ge \sum\binom{n}{i}$.
:::
:::
:::

::: check
kind: parts
given: r = 8 | 16 | 32

## A cyclic redundancy check uses a generator polynomial of degree {r} (with a nonzero constant term).

::: part
answer: r
unit: bits
tolerance: 0

### What is the longest error burst it always detects?

::: misses
- [any] Any burst no longer than the degree.
:::
:::

::: part
answer: 2^(-(r - 1))
tolerance: 0.5%

### What fraction of bursts exactly {r} + 1 bits long slip through?

::: misses
- [2^(-r)] That's for bursts longer than r + 1.
- [any] $2^{-(r-1)}$.
:::
:::

::: part
answer: 2^(-r)
tolerance: 0.5%

### And of longer bursts?

::: misses
- [any] $2^{-r}$.
:::
:::
:::

::: check
kind: parts
given: R = 0.25 | 0.333 | 0.5 | 0.75; E = 1 | 2.5

## A rate-{R} code is used on a Gaussian channel, one real code symbol per channel use; a practical decoder needs {E} dB of Eb/N0.

::: part
answer: 10*log((2^(2*R) - 1)/(2*R))
unit: dB
tolerance: 1%

### What is the smallest Eb/N0 at which any rate-{R} code could work, with unrestricted inputs?

::: misses
- [-1.59] That's the limit as the rate goes to zero.
- [any] $\frac12\log_2(1 + 2RE_b/N_0) \ge R$ gives $E_b/N_0 \ge (2^{2R} - 1)/(2R)$.
:::
:::

::: part
answer: E - 10*log((2^(2*R) - 1)/(2*R))
unit: dB
tolerance: 1%

### How far from that limit is the decoder?

::: misses
- [any] Subtract the limit.
:::
:::
:::

::: check
kind: parts
given: v = 3 | 4; c = 15 | 20 | 30; n = 1200 | 64800

## A ({v}, {c})-regular LDPC code has length {n}: each bit sits in {v} checks and each check covers {c} bits.

::: part
answer: 1 - v/c
tolerance: 0.5%

### What is its design rate?

::: misses
- [v/c] That's the fraction of checks per bit, $1 - R$.
- [any] $1 - d_v/d_c$.
:::
:::

::: part
answer: n*v/c
unit: checks
tolerance: 0.5%

### How many parity checks does it have?

::: misses
- [any] Count the edges two ways: $nd_v = md_c$.
:::
:::

::: part
answer: n*v
unit: edges
tolerance: 0.5%

### How many edges does its Tanner graph have?

::: misses
- [any] $nd_v$.
:::
:::
:::

::: check
kind: parts
given: n = 255 | 204 | 63; k = 223 | 188 | 47; m = 8 | 6

## A Reed–Solomon code with n = {n}, k = {k} and {m}-bit symbols.

::: part
answer: floor((n - k)/2)
unit: symbols
tolerance: 0

### How many symbol errors can it correct?

::: misses
- [n - k] That many erasures, but errors cost two check symbols each.
- [any] $\lfloor(n - k)/2\rfloor$.
:::
:::

::: part
answer: (floor((n - k)/2) - 1)*m + 1
unit: bits
tolerance: 0

### What is the longest bit burst it always corrects?

::: misses
- [floor((n - k)/2)*m] A burst that starts partway into a symbol can touch one more symbol.
- [any] $(t - 1)m + 1$.
:::
:::
:::

::: check
kind: parts
given: n = 255 | 31; k = 239 | 223 | 15; e = 1 | 3 | 6

## A Reed–Solomon code with n = {n} and k = {k} sees {e} symbol error(s) at unknown positions.

::: part
answer: n - k
unit: symbols
tolerance: 0

### How many erasures could it fill if there were no errors?

::: misses
- [any] Erasures need one check symbol each: n − k.
:::
:::

::: part
answer: n - k - 2*e
unit: symbols
tolerance: 0

### How many erasures can it fill alongside the errors?

::: misses
- [any] $2t + e_\text{erasures} \le n - k$.
:::
:::
:::
:::
