Incoming transmission
course page · mudassir

A 90-minute mathematics mission

GLITCH!

Can mathematics repair a broken message?

Dr. Mudassir Shabbir Department of Computer Science · LUMS

UNKNOWN ORIGIN · SIGNAL 01 H?M?N?TY H?S A PR?BL?M

Impossible mind-reading

Flip one card. I’ll find it.

Choose a random pattern—or flip as many of the 25 center cards as you like.

3After the decoration, flip one card.

Start with any pattern you want.

chosen cards added cards
Final reveal

The intersection gives it away

One flipped square trips exactly two alarms.

Every line begins even → one flip makes one row + one column odd → their intersection is the glitch
Mission briefing
Year 2090
Near-Ice Life Analyzer

Meet Near-Ice Life Analyzer (NILA)

A small robot, a frozen ocean, and one very expensive flashlight.

EUROPA · JUPITER SYSTEM
What can go wrong 628 million km from home?AURORA / NILA-1
NILA → LUMEN → Earth
One-way journey: tens of minutes
NILA LUMEN relay Earth station visible light radio relay
Why not simply ask NILA to resend?Line of sight matters
Mission constraints
The engineering box
2×wake-ups per day
12flashes per report
1flash may flip
Design inside all three constraintsFast · small · reliable
Protocol 0.1
One question
YES
NO
1 light → 2 messages
What should the two colours mean?Click the light
Card game · Human transmitter
Four volunteers

Become NILA’s laser

1Four students hold red/green cards.
2A team secretly draws one mission card.
3Turn the humans into its four-flash code.
Can another team decode without hearing a word?Red = 0 · Green = 1
Mission Control codebook
16 possible reports
How many flashes are enough for all 16?Two cards are dangerously close
Capacity lab
Every light doubles the language

Choose the number of lights

12345678
8 patterns
Not enough for 16
Predict before moving the slider2ⁿ possible patterns
Card game · Round two
Encode → transmit → decode
🧪

Ice sample collected

Secret mission card
Tap lights to build the four-flash message.
Teams race; accuracy beats speedDigital version of the card game
Opening transmission decoded
Code 1011
⚠

MISSION EMERGENCY

1011Mission emergency
1010Possible biological pattern
Prepare to abandon NILA?Countdown paused
The catastrophe
One bit flip
SENT?
1010
⚡
RECEIVED
1011
“Possible life” became “Emergency.”
Can Earth know which message was intended?Both are valid
Engineering huddle
You have 4 minutes
🐕

Add a watchdog light

Cost: 1 extra flash
🔁

Repeat the whole message

Cost: 8–12 flashes
🏝️

Spread valid messages apart

Cost: clever code design
Design first; vocabulary laterAt most 8 flashes
Idea 2 · Repetition
Simple, reliable, expensive
Why is two copies not enough?Works, works, works… but costs
Idea 1 · The watchdog
Even parity
PARITY WATCHDOG

Make the total number of green lights even.

Green lights: 0
Watchdog satisfied ✓
It detects trouble—but can it locate it?5 flashes total
Idea 3 · Give messages personal space
Hamming distance
0000
1111
1010Message A
1011Message B
Positions that differ
1
Honest attempt 1 · Five flashes
32 possible received strings
Best-case packing attempt32 slots
message one-flip result missing slot
Can rearranging the bubbles create more space?
Honest attempt 2 · Six flashes
64 possible received strings
Best-case packing attempt64 slots
message one-flip result missing slot
What changes when we allow seven flashes?
Research door 1 · Pack the message bubbles
A counting lower bound

Each protected message occupies:

1 original + n one-flip neighbours
16(n + 1) ≤ 2n
Try n = 6, 7. Where does counting decide it—and where is the fit exact?
Could seven flashes be enough?Hamming / sphere-packing bound
See the whole seven-bit universe
Q₇ · 128 vertices

One flipped bit draws one edge.

Every seven-bit word appears once. Neighbors differ in exactly one position—one possible transmission error. Each bit gets its own direction in this symmetric projection.

128 possible words 7 neighbors each 448 edges total
any received word Hamming codeword one flip away

Hover or tap a point. Can two amber points ever be neighbors?

All seven-bit words connected by one-bit changes A symmetric seven-direction projection with 128 vertices and 448 edges. Each edge joins two seven-bit strings that differ in exactly one position. The seven neighbors of the selected word are labeled with their bit values.
Selected word 0000000 Its seven one-flip neighbors are highlighted.
A seven-flash repair code
3 inspectors · 4 data lights
First attempt: keep the four data lights together and append all three checks.
Design requirement

Every damaged position needs its own alarm pattern.

Three inspectors each answer yes or no. How many different patterns can they report?

Do three checks help just because we appended them?Next: find positions that give every light a distinct signature
Build NILA’s protected report
Data: 1010
Place data in positions 3, 5, 6, 7. Then satisfy every inspector.
Teams calculate one inspector eachEven parity throughout
Radiation strike
Received: 1011000
?
Complaining labels add to the error positionSyndrome = address
Message repaired
Scientific caution required
1010
POSSIBLE BIOLOGICAL PATTERN

Not proof of life—proof that Earth heard NILA correctly.

What confirmation should Mission Control request next?Abandonment cancelled
Practice lab · 1 of 7
Work alone · 3 minutes
Write one number for each pair

Hamming distance

  1. Compare the bits in the same positions.
  2. Count every position where the bits differ.
  3. Circle each pair that could belong to a one-error-correcting code.
A10110101011000
B00000001110000
C11001101010101
Next reveals the check
Practice lab · 2 of 7
Pairs · 4 minutes
Explore one error bubble

One-flip neighbors

Start with0101101
  1. Flip bit 1 and record the new word.
  2. Restore it, then repeat for bits 2 through 7.
  3. Count the original word and all its neighbors.

Your paper should contain seven different neighbors and one neighborhood size.

Change exactly one position each time
Practice lab · 3 of 7
Pairs · 4 minutes
1 means that inspector complains

Inspector signatures

  1. For each position, decide whether P4, P2, and P1 watch it.
  2. Write the complaint pattern in the order P4 P2 P1.
  3. Read the pattern as a binary number.
Position P4 P2 P1 Sum
3 ___ ___
5 ___ ___
6 ___ ___
7 ___ ___
Why must every nonzero pattern appear once?
Practice lab · 4 of 7
Guided · 4 minutes
Encode data 0110

Guided encoding

1 · P1?2 · P2? 3 · D104 · P4? 5 · D216 · D31 7 · D40
  1. Choose P1 so positions 1, 3, 5, and 7 have even parity.
  2. Repeat for P2 on 2, 3, 6, and 7.
  3. Repeat for P4 on 4, 5, 6, and 7.
Write all seven bits before checking
Practice lab · 5 of 7
Work alone · 4 minutes
Encode data 1101

Independent encoding

Data1101
  1. Draw positions 1 through 7 and label the parity positions.
  2. Place the four data bits in positions 3, 5, 6, and 7.
  3. Choose all three parity bits, then audit every group.

Submit one seven-bit codeword and three parity checks.

No position guide this time
Practice lab · 6 of 7
Guided · 4 minutes
Received word

Guided decoding

Earth sees1000111
  1. Test P1 on positions 1, 3, 5, and 7.
  2. Test P2 and P4 in the same way.
  3. Add the labels of the complaining inspectors.
  4. Flip that position, then read data positions 3, 5, 6, and 7.
The complaining labels identify one position
Practice lab · 7 of 7
Solo check · 5 minutes
One error occurred

Complete decode

Received0101100
  1. Find the syndrome without using a group diagram.
  2. Repair the indicated bit.
  3. Extract the four data bits.
  4. Verify the repaired word with all three parity checks.

Show the syndrome, repaired codeword, recovered data, and parity audit.

This one uses the complete routine
Research door 2 · What if two lights flip?
Beyond single-error correction
✓
0 errorsall checks agree
🛠️
1 errorlocate and repair
⚠️
2 errorsmay imitate one error
?
More errorsstronger codes needed
🛡️

Add one overall parity light

8 flashes can correct one error and detect two.

Can you derive the four possible check outcomes?
Detection and correction are different promisesSECDED
Research door 3 · Is seven optimal?
16 messages · correct 1 flip
words become vertices · close words become edges
n = 6 → impossible
n = 7 → perfect fit
16 · 8 = 128 = 27
Add a 17th report, or demand two-error correction. When does counting stop deciding it?
This is a genuine finite research problemA₂(7,3) = 16
Choose a research door
Mini-project menu
Explorer
📦

Pack better codes

Search for large sets of far-apart bit strings. Compare constructions with counting bounds.

Explorer
🕸️

Turn it into a graph

Connect confusable messages. Error-correcting codes become independent sets.

Builder
🌩️

Burst errors

Several neighbouring flashes fail together. Can interleaving spread the damage?

Builder
🕳️

Missing flashes

A light disappears and shifts everything. Explore deletion-correcting codes.

Researcher
📡

Soft decoding

The detector reports confidence, not just red/green. How should likelihood guide repair?

Researcher
⚛️

Quantum errors

Qubits cannot simply be copied. How can parity-like ideas protect quantum states?

State a question, build evidence, defend a claimResearch begins with a precise failure model
Not science fiction
Extra bits are everywhere

QR codes

Still scan when parts are dirty or covered.

Storage

Detect and repair corrupted bits on disks and memory.

Wireless

Recover messages from interference and weak signals.

Space links

Protect data when retransmission is slow and costly.

Where else have you seen “damaged but readable” data?The mathematics is already in your pocket
Recovery game · Round 1
A page of editable text
LIVE PAYLOAD

Can Hamming code rescue a damaged page?

Broken text · before repair
Damaged text will appear here.
Recovered text
Recovered text will appear here.
Ready. Encode the source to begin.
Source— Encoded— Flipped— Recovered—
original→damaged→repaired
Predict the recovery percentage before decodingEvery result is computed from the actual transmitted bits
Recovery game · Round 2
The first website · recreated
FAMOUS WEBPAGE

Will damaged HTML still behave like a webpage?

Original · a playful 1991-style recreation
Broken webpage · before repair
Recovered webpage
Ready. Encode the source to begin.
HTML— Encoded— Flipped— Recovered—
original→damaged→repaired
Can a page look right without being byte-perfect?Source code is data too
Recovery game · Final round
Complete public-domain book · 3.36 MB
PROJECT GUTENBERG EBOOK #2600

Can we repair all of War and Peace?

Original book · opening preview
Loading book preview…
Broken book · before repair
Damaged text will appear here.
Recovered book · opening preview
Recovered text will appear here.
Ready. Encode the source to begin.
Book3.36 MB Encoded— Flipped— Recovered—
original→damaged→repaired
Millions of repairs—what does the guarantee still miss?Leo Tolstoy · Project Gutenberg #2600 · public domain in the USA
AURORA Mission · Link complete
NILA returns to sleep
Thank you
Mathematics did not make the light brighter.
It made the message harder to destroy.
What new channel would you design a code for?End of transmission
Encore · The simplest family
One idea, any odd length
Repetition code

When in doubt, say it again.

Send one bit n times. Decode by majority vote.

[n, 1, n]length · data · distance
Send1→111[3,1,3] corrects 1 error
Send1→11111[5,1,5] corrects 2 errors
Send1→1111111[7,1,7] corrects 3 errors
What reliability do we buy—and what rate do we pay?Corrects ⌊(n − 1)/2⌋ errors · rate 1/n
Encore · Hamming's legendary cousin
Marcel Golay · 1949
PERFECT BINARY GOLAY CODE
[23, 12, 7]
23 transmitted 12 data 7 minimum distance
Any 3 flipped bits can be corrected.
One radius-3 neighborhood
1 + 23 + 253 + 1771 = 2048
4096 messages × 2048 outcomes
= 8,388,608 = 223

Every possible received word belongs to exactly one message.

Encore · Add one more parity bit
From 23 bits to 24
Extended binary Golay code

[24, 12, 8]

[23,12,7]+ parity[24,12,8]
  • Correct any 3 flipped bits.
  • Detect up to 7 errors when only detecting.
  • Golay-family decoding served real deep-space links.
Encore · From symbols to a polynomial
Reed & Solomon · 1960
Three message symbols
231
become the coefficients of
p(x) = 2 + 3x + x2
Arithmetic wraps around modulo 11.
Sample the same shape seven times
x=02
x=16
x=21
x=39
x=48
x=59
x=61
TRANSMIT2 · 6 · 1 · 9 · 8 · 9 · 1

We did not copy the message. We sent enough points to rebuild its rule.

Encore · Two samples are corrupted
Repair the polynomial, not each bit
RECEIVED
2679841
Two symbols no longer lie on the shape.
DECODER Find the degree-2 polynomial that agrees with at least 5 points →
RECOVERED
2619891
[7,3,5] corrects any 2 symbol errors.
▦QR codessurvive dirt and missing patches
💿Storage & mediarepair clustered damage
🛰️Space linksrecover blocks of telemetry
Encore · One idea becomes a field
Your next mission
1Repetitionmajority vote
→
2Hammingone-error address
→
3Golayperfect radius 3
→
4Reed-Solomonrepair symbols
→
5LDPC · Polarmodern high-rate links
You already know how to begin:

What can fail? What must survive? What redundancy can we afford?

Invent a channel. Then invent the code it needs.The next theorem could be yours.