Computer Networks · TEE · papers

Q2A · Block coding and all pairwise distances

Final · 5 December 2025

TEE · Actual TEE paper · all questions · current syllabus 702AI0C023

Actual PYQ · Q2A. (i) Explain the block coding method for error detection and correction. (2 marks) (ii) Two binary codewords are used: C1=1001101 and C2=1110001. Compute their Hamming distance. (2 marks) (iii) C3=1010101 is added. Compute its pairwise distances from the other codewords. (2 marks) (iv) Based on the minimum Hamming distance, determine how many errors the code can detect and correct; justify your answer. (4 marks) [10 marks]

Answer

(i) Block coding. Map each k-bit dataword to a distinct n-bit codeword by adding n−k redundant bits. Only the valid codeword subset represents data. A received invalid pattern detects an error; sufficiently separated codewords permit unique correction within the guaranteed radius. For a chosen code, the minimum Hamming distance measures that separation.

Given

CodewordBits
C11001101
C21110001
C31010101

To find

All pair distances, dmin and the maximum guaranteed numbers of errors.

Formula and why

d(a,b)=\mathrm{weight}(a\oplus b)LaTeX: d(a,b)=\mathrm{weight}(a\oplus b)
s=d_{\min}-1,\quad t=\lfloor(d_{\min}-1)/2\rfloorLaTeX: s=d_{\min}-1,\quad t=\lfloor(d_{\min}-1)/2\rfloor

XOR exposes differing positions. Use the closest codeword pair, because it is the weakest separation in the code.

Step-by-step solution

Step 1. XOR every distinct pair

PairFirstSecondXORDistance
C1 vs C21001101111000101111004
C1 vs C31001101101010100110002
C2 vs C31110001101010101001002

Step 2. Take the minimum

dmin = min(4, 2, 2) = 2.

Step 3. Calculate the guarantees

Detect = 2−1 = 1; correct = floor((2−1)/2) = 0.

Step 4. Justify geometrically

2 bit changes can reach another valid codeword, so only 1 are guaranteed detectable. Correction regions require 2t < 2.

Final answer: dmin=2; detect up to 1 errors; correct up to 0 errors.

Source: Final · 5 December 2025, original question paper page 1. Original marks retained; solution independently authored.