Chapter 01 of 22 Part I: Foundations of Digital Information

Magic or Mathematics?

Difficulty: Foundational Editorial estimate: ~40 min Prerequisites: Basic arithmetic, Optional: JavaScript Primer

Chapter Field Guide

SCIENTIFIC PRINCIPLES & LAWS
  • Powers of two and positional notation: how six binary choices describe 64 possible states.
  • Discrete mathematics and digital logic: bits, bytes and exclusive OR (XOR).
  • Information theory: even and odd parity, redundancy, and the difference between detecting and correcting errors.
WHERE YOU MEET IT IN EVERYDAY LIFE
  • Phones and computers represent letters, photographs and sound using digital information.
  • Communication systems and storage devices use error-control techniques to help protect data.
  • A simple card trick reveals the mathematics behind a machine’s decisions.
WHAT YOU GAIN BY KNOWING IT
  • Read and create binary numbers, perform two mathematical magic tricks, and explain why they work.
  • Build three JavaScript experiments that detect a changed message or locate a flipped bit.
  • Recognize when a check cannot guarantee correctness; think like an engineer testing a system.

Measurable Learning Outcomes

  • Convert integers between decimal and 6-bit binary notation.
  • Explain why an even-parity bit detects any single-bit flip but misses an even number of flips.
  • Use row and column parity in a 2D grid to locate and repair a single flipped bit.
  • Apply XOR operations in JavaScript to compute and verify parity.

Core Scientific Intuition

Computers store text, images, and sound as sequences of two-state symbols called bits (0 or 1). Positional notation multiplies each bit by a power of two, so 6 bits represent 2^6 = 64 distinct states (0 through 63). Adding one extra parity bit makes the total count of 1s even (or odd), giving a receiver a fast mathematical check for single-bit transmission errors.

N = b₅·2⁵ + b₄·2⁴ + b₃·2³ + b₂·2² + b₁·2¹ + b₀·2⁰
In plain words: A 6-bit binary number equals the sum of each bit multiplied by its corresponding power of two, from 32 down to 1.
Units & assumptions: Each bit b_i is 0 or 1; represents unsigned integers from 0 to 63.

Worked Example

For the secret number 29: 29 = 16 + 8 + 4 + 1, so the 6-bit pattern is 011101. It contains four 1s (already even), so its even-parity bit is 0. If noise flips bit 3 to produce 010101, the count of 1s becomes three (odd), immediately alerting the receiver.

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 (4 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 47 book section headings
  1. A guide to the science and activities in this chapter.
  2. Two surprising tricks reveal how information follows rules.
  3. Can a machine read your mind?
  4. Four more questions
  5. The impossible memory trick
  6. Try it with a partner
  7. Meet the pioneers
  8. Gottfried Wilhelm Leibniz (1646-1716)
  9. George Boole (1815-1864)
  10. From logic to reliable messages
  11. Claude Elwood Shannon (1916-2001)
  12. Richard Wesley Hamming (1915-1998)
  13. When machines made mistakes
  14. 1937 to 1938: Claude Shannon
  15. 1950: Richard Hamming
  16. The secret language of machines
  17. Why six questions are enough
  18. From a trick to an algorithm
  19. Give every message a guardian
  20. The rule that protects the message
  21. Find the flipped card
  22. Why the corner works
  23. One operation, many possibilities
  24. Meet XOR
  25. Build a mind reader
  26. Read the program like a recipe
  27. Build a digital detective
  28. Take the detective apart
  29. What the code is doing
  30. A damaged message from Mars
  31. Make the receiver miss an error
  32. Experiment before you explain
  33. Keep a scientist’s notebook
  34. 07 / Detective mission: emergency on Mars
  35. Decode the damaged transmission
  36. 08 / What if the system gets it wrong?
  37. Now you are the inventor
  38. 1: A bigger mind-reading machine
  39. 2: A language made of lamps
  40. 3: Protect a pixel picture
  41. 4: A reliable toy messenger
  42. Mission answers
  43. Your field guide to new ideas
  44. 11 / What you now know
  45. Next chapter: The secret mathematics of everyday numbers
  46. More to discover
  47. Meet the recurring cast

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
MacTutor, University of St Andrews educational-archive https://mathshistory.st-andrews.ac.uk/Biographies/Leibniz/
Mathematical Association of America: binary arithmetic reference https://old.maa.org/press/periodicals/convergence/russian-multiplication-microprocessors-and-leibniz
University College Cork: George Boole reference https://www.ucc.ie/en/heritage/history/people/ucc-staff/professor-george-boole/
MacTutor biography educational-archive https://mathshistory.st-andrews.ac.uk/Biographies/Boole/
MIT News: Claude Shannon educational-archive https://news.mit.edu/2001/shannon
IEEE Information Theory Society reference https://www.itsoc.org/about/shannon
MacTutor: Richard Hamming educational-archive https://mathshistory.st-andrews.ac.uk/Biographies/Hamming/
Naval Postgraduate School: Hamming biography reference https://savage.nps.edu/hamming/HammingLearningToLearnRecovered/chapters/HammingBiography.pdf
A Symbolic Analysis of Relay and Switching Circuits reference https://doi.org/10.1109/T-AIEE.1938.5057767
A Mathematical Theory of Communication (1948), part I reference https://doi.org/10.1002/j.1538-7305.1948.tb01338.x
Part II reference https://doi.org/10.1002/j.1538-7305.1948.tb00917.x
Error Detecting and Error Correcting Codes reference https://doi.org/10.1002/j.1538-7305.1950.tb00463.x
Parity Magic (activity inspiration) reference https://www.csunplugged.org/en/at-a-distance/parity-magic/
Bitwise XOR (^) official-docs https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_XOR
JavaScript Guide official-docs https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide
Claude Elwood Shannon: reference archive (not verified as the supplied image source) reference https://commons.wikimedia.org/wiki/File:Claude_Shannon_1958_MIT_portrait_cropped.jpg
Richard Wesley Hamming: reference archive (not verified as the supplied image source) reference https://library.nps.edu/richard-w-hamming