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
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
How far apart must valid messages be?Count differing positions
Honest attempt 1 · Five flashes
32 possible received strings
Best-case packing attempt32 slots
message one-flip result missing slot
Be unrealistically generous

Assume every neighborhood packs perfectly.

1 original + 5 possible flips = 6 slots per message
32 ÷ 6At most 5 protected messages We need 16. The sixth message already spills over.
Can rearranging the bubbles create more space?No—every message still needs six exclusive outcomes
Honest attempt 2 · Six flashes
64 possible received strings
Best-case packing attempt64 slots
message one-flip result missing slot
Try again with twice the space

Six flashes still run out far too early.

1 original + 6 possible flips = 7 slots per message
64 ÷ 7At most 9 protected messages We need 16. The tenth message has only one slot left.
What changes when we allow seven flashes?One more flash doubles the universe to 128
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
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
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
originaldamagedrepaired
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
originaldamagedrepaired
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
originaldamagedrepaired
Millions of repairs—what does the guarantee still miss?Leo Tolstoy · Project Gutenberg #2600 · public domain in the USA
Final mission challenge
No hints from Mission Control
Received protected transmission
1110001
Which position? Which four-bit report? Which mission card?Received: 1110001
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
Send1111[3,1,3] corrects 1 error
Send111111[5,1,5] corrects 2 errors
Send11111111[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.