The Maths Behind Everyday Life
The story, the formula and a worked example — see exactly where this maths shows up in the world around you.
Bits That Fix Themselves
Hamming codes detect and correct single-bit errors automatically.
In noisy channels, bits can flip. Hamming codes add parity bits at positions that are powers of 2, allowing the receiver to pinpoint and fix exactly one flipped bit.
Parity Bit Positions
For k data bits, you need r parity bits where 2ʳ ≥ k + r + 1. For 4 data bits: 2³ = 8 ≥ 4 + 3 + 1 = 8 ✓ — so 3 parity bits are needed, making a 7-bit codeword.
r = parity bits, k = data bits
Encoding 4 data bits
- 1
Need r where
- 2
Try r=3
3 parity bits turn 4 data bits into a 7-bit Hamming code that self-corrects single errors
The takeaway
Hamming codes are the elegant maths behind error-free digital communication — catching and fixing mistakes on the fly.