Chapter 05 of 22 Part I: Foundations of Digital Information

Recovering the Impossible

Difficulty: Intermediate Editorial estimate: ~45 min Prerequisites: Chapter 01

Chapter Field Guide

ERROR
  • Value changed, position unknown
  • ERASURE
  • Missing value, position known
  • DELETION
  • File record removed

Measurable Learning Outcomes

  • Place parity bits at powers-of-two positions (1, 2, 4) to form a Hamming(7,4) codeword.
  • Calculate a 3-bit syndrome to pinpoint and flip back any single corrupted bit.
  • Use bitwise XOR across disk blocks to reconstruct a failed drive in a RAID-5 stripe.

Core Scientific Intuition

Richard Hamming noticed that if parity bits check overlapping subsets of positions corresponding to binary place values (1, 2, 4), the failing parity checks literally spell out the binary address (syndrome) of the broken bit. In storage arrays, bitwise XOR across drives works the same way: if one drive fails, XORing all surviving drives reproduces the missing drive exactly.

P = D₁ ⊕ D₂ ⊕ D₃ ⇒ D₂ = D₁ ⊕ D₃ ⊕ P
In plain words: The XOR parity drive equals the XOR of all data drives; any single missing drive is recovered by XORing the remaining drives with parity.
Units & assumptions: Bitwise XOR (⊕) is self-inverse (A ⊕ A = 0) and works for one failed drive per stripe.

Worked Example

If D1 = 1010 and D2 = 1100, then parity P = 1010 XOR 1100 = 0110. If D2 fails, compute D1 XOR P = 1010 XOR 0110 = 1100, restoring D2 bit-for-bit.

Hands-On Exploration

Interactive Laboratory

Test the concepts directly with 4 interactive panels, live controls, and visual feedback.

Open Interactive Lab →

Three Guided Projects

Structured experiments with hypotheses, boundary tests, hints, and reflection prompts.

View 3 Projects →

Source Code (5 Snippets)

Inspect byte-identical printed JavaScript blocks, download `.js` files, or test runnable blocks in the isolated sandbox.

Browse Code →

Self-Check Quiz (5 Questions)

Immediate explanations for every choice, unlimited retries, and local-only score tracking.

Take Self-Check Quiz →

Book Chapter Outline (Reference Guide)

Section headings from Volume 1 for cross-referencing with the printed book.

Show all 33 book section headings
  1. A guide to recovering missing or damaged information.
  2. The drive that vanished
  3. Try the impossible
  4. A scientist who taught machines to repair mistakes
  5. Richard Wesley Hamming (1915 to 1998)
  6. The question that changed everything
  7. A mistake is different from a missing piece
  8. Redundancy is planned extra information
  9. A mathematical limit
  10. Seven bits protect four
  11. Why powers of two?
  12. Find the wrong bit without the original
  13. Build a one-bit repair machine
  14. Experiment
  15. XOR: the secret of missing blocks
  16. Try it with pencil and paper
  17. How storage survives a failed drive
  18. Rebuild a virtual drive
  19. What if a second drive fails?
  20. Gone from the directory, not always from the disk
  21. A signal from Mars
  22. The cost of waiting
  23. Send a protected message to Earth
  24. Challenge
  25. The case of the damaged rover report
  26. Your mission
  27. Now invent
  28. When mathematics cannot bring data back
  29. Answers to the detective mission
  30. What you know now
  31. Scientific vocabulary and sources
  32. Further reading and references
  33. Next chapter

Primary Sources & Further Reading

External links are provided for independent verification and deeper study. Link availability can change over time; see the Resources page for verification notes.

Source Type Link
Historical photograph and biography: Naval Postgraduate School archive reference https://nps.edu/-/iconic-researcher-teacher-richard-hamming-maintains-lasting-legacy-on-campus
MacTutor: Richard Hamming biography educational-archive https://mathshistory.st-andrews.ac.uk/Biographies/Hamming/
Naval Postgraduate School: Hamming resources and photographs reference https://nps.edu/web/cs/hamming-resources
Original 1950 error-correcting code paper reference https://doi.org/10.1002/j.1538-7305.1950.tb00463.x
IBM: RAID 5 and failure tolerance reference https://www.ibm.com/docs/en/power9/9009-22A?topic=srl-raid-5-1
IBM: RAID levels and backup distinction reference https://cloud.ibm.com/docs/bare-metal?locale=en&topic=bare-metal-bm-raid-levels
Microsoft: File recovery and free space reference https://support.microsoft.com/en-us/windows/experience/backup-recovery/windows-file-recovery
Microsoft: TRIM and deallocation reference https://learn.microsoft.com/en-us/windows/compatibility/new-api-allows-apps-to-send-trim-and-unmap-hints
NASA: Deep Space Network reference https://www.nasa.gov/communicating-with-missions/dsn/
MDN: TextEncoder official-docs https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder