Self-Assessment Quiz: Coding Theory — Error-Correcting Codes

Twenty questions to check your understanding. Answer before opening the key. Aim for 16+.


Question 1

The Hamming distance between two equal-length strings is:

A) the number of 1s in the longer string B) the number of positions at which they differ C) the absolute difference of their values as binary numbers D) the number of positions at which they agree

Question 2

Over $\mathrm{GF}(2)$, the Hamming distance $d(x, y)$ equals:

A) $\operatorname{wt}(x) - \operatorname{wt}(y)$ B) $\operatorname{wt}(x) + \operatorname{wt}(y)$ C) $\operatorname{wt}(x \oplus y)$ D) $\operatorname{wt}(x \land y)$

Question 3

A code has minimum distance $d_{\min} = 5$. The largest number of errors it is guaranteed to detect is:

A) 2 B) 3 C) 4 D) 5

Question 4

A code has minimum distance $d_{\min} = 5$. The largest number of errors it is guaranteed to correct (under nearest-codeword decoding) is:

A) 1 B) 2 C) 3 D) 4

Question 5

To correct all error patterns of weight $\le t$, a code's minimum distance must satisfy:

A) $d_{\min} \ge t$ B) $d_{\min} \ge t + 1$ C) $d_{\min} \ge 2t$ D) $d_{\min} \ge 2t + 1$

Question 6

The triple-repetition code $\{\texttt{000}, \texttt{111}\}$ has rate:

A) $1$ B) $1/2$ C) $1/3$ D) $3$

Question 7

In $\mathrm{Hamming}(7,4)$, the parity bits are placed at positions $1, 2, 4$ specifically so that:

A) the codeword is easier to print B) the syndrome, read as a binary number, equals the position of the flipped bit C) the data bits stay contiguous D) the rate is maximized

Question 8

The syndrome of a received word in a linear code is computed as:

A) $G m^{\mathsf T}$ where $G$ is the generator matrix B) $H y^{\mathsf T}$ where $H$ is the parity-check matrix C) the Hamming distance to the nearest codeword D) the XOR of all the data bits

Question 9 (True/False, justify)

True or false: For a linear code, the minimum distance equals the minimum weight of a nonzero codeword. Justify in one sentence.

Question 10

A $\mathrm{Hamming}(7,4)$ receiver computes syndrome $s_4 s_2 s_1 = 110$. It should:

A) accept the word as error-free B) flip position 3 C) flip position 6 D) request a retransmission

Question 11

The reason a $d_{\min} = 3$ code cannot simultaneously correct 1 error and detect 2 is:

A) it has no parity-check matrix B) a double error produces a nonzero syndrome that points at a third position, so the decoder silently miscorrects C) the rate is too low D) double errors are impossible on a binary symmetric channel

Question 12

A linear code over $\mathrm{GF}(2)$ is, by definition:

A) any code whose codewords are sorted B) a subspace of $\mathrm{GF}(2)^n$ (contains $\mathbf{0}$; closed under XOR) C) a code with exactly two codewords D) a code in which every codeword has even weight

Question 13 (True/False, justify)

True or false: Adding redundancy to a code can increase its rate. Justify in one sentence.

Question 14

The Singleton bound states that for an $[n, k]$ code, $d_{\min} \le$:

A) $n - k$ B) $n - k + 1$ C) $n + k - 1$ D) $2(n - k)$

Question 15

A Reed–Solomon code beats burst errors because it:

A) flips bits faster than the channel B) counts errors in multi-bit symbols, so a long bit-burst spans only a few symbol-errors C) uses a smaller alphabet than binary D) ignores any block with more than one error

Question 16

The minimum distance of a Reed–Solomon $[n, k]$ code is exactly $n - k + 1$ because a nonzero polynomial of degree $< k$ over a field has at most $k - 1$:

A) coefficients B) terms C) roots D) evaluations

Question 17

Reed–Solomon must be defined over a true field such as $\mathrm{GF}(2^8)$, not over $\mathbb{Z}_{256}$, because $\mathbb{Z}_{256}$:

A) has too few elements B) has zero divisors, so a degree-$d$ polynomial can have more than $d$ roots and the distance bound collapses C) cannot represent bytes D) has no multiplicative identity

Question 18 (Short answer)

State the two threshold theorems as a pair: the minimum-distance condition to detect up to $t$ errors, and the condition to correct up to $t$ errors.

Question 19 (Short answer)

In the linear-algebra view, the minimum distance of a code equals the smallest number of columns of which matrix that are linearly dependent? Why does this immediately give $d_{\min}(\mathrm{Hamming}(7,4)) = 3$?

Question 20 (Short answer)

A code with minimum distance $d$ detects how many errors, and corrects how many? Give both formulas in terms of $d$.


Answer Key

Q Ans Note
1 B Distance = number of differing positions.
2 C $d(x,y) = \operatorname{wt}(x \oplus y)$: the XOR is 1 exactly where they differ.
3 C Detects $d_{\min} - 1 = 4$ errors (Theorem 38.2).
4 B Corrects $\lfloor (d_{\min}-1)/2 \rfloor = \lfloor 4/2 \rfloor = 2$ (Theorem 38.3).
5 D Correction needs $d_{\min} \ge 2t+1$ — room on both sides of each codeword.
6 C $k=1$, $n=3$, so $R = 1/3$.
7 B Power-of-two placement makes the syndrome equal the error position.
8 B Syndrome $= H y^{\mathsf T}$; it depends only on the error.
9 True $d(x,y)=\operatorname{wt}(x\oplus y)$ and $x\oplus y$ is itself a codeword by linearity, so the set of pairwise distances equals the set of nonzero weights (Theorem 38.4).
10 C $110_2 = 6$; flip position 6.
11 B A weight-2 error gives a nonzero syndrome naming a third position; the decoder miscorrects silently.
12 B A linear code is a subspace: contains $\mathbf 0$, closed under XOR.
13 False Redundancy lowers the rate $R = k/n$ (more transmitted bits per message bit); that is the price of protection.
14 B Singleton: $d_{\min} \le n - k + 1$; RS meets it with equality (MDS).
15 B Burst of consecutive bad bits = a few consecutive bad symbols; correcting few symbol-errors absorbs the burst.
16 C At most $k-1$ roots over a field, so two distinct codewords agree in $\le k-1$ places, differ in $\ge n-k+1$.
17 B $\mathbb{Z}_{256}$ has zero divisors (e.g. $2 \cdot 128 = 0$); polynomials gain extra roots and $d_{\min}=n-k+1$ fails.
18 Detect $\le t$: $d_{\min} \ge t+1$. Correct $\le t$: $d_{\min} \ge 2t+1$.
19 The columns of the parity-check matrix $H$. For Hamming, all 7 columns are distinct and nonzero, so no 1 or 2 are dependent, but columns $1,2,3$ ($001 \oplus 010 \oplus 011 = 000$) are, giving $d_{\min}=3$.
20 Detects $d - 1$ errors; corrects $\lfloor (d-1)/2 \rfloor$ errors.

Topics to review by question

Questions Topic
1–2 Hamming distance and weight (§38.2)
3–5, 18, 20 The two threshold theorems (§38.3)
6, 13 Code rate — the cost of reliability (§38.2)
7, 10 Hamming-code construction & decoding (§38.4)
8, 11 Syndrome decoding & the SECDED pitfall (§38.4–38.5)
9, 12, 19 Linear codes, min distance = min weight, parity-check columns (§38.5)
14–17 Reed–Solomon, Singleton bound, the field requirement (§38.6)