Chapter 02 of 22Part I: Foundations of Digital Information
The Secret Mathematics of Everyday Numbers
Each chapter features three guided investigations aligned with the book and Interactive Lab. Work through them in order, record predictions, and test edge cases.
Project 1 of 3 · v1-c02-p01
Luhn number detective
Lab section: A. Luhn number detective · Related code: block-01.js
Objective: Investigate "Luhn number detective" experimentally in the Chapter 02 Interactive Lab and connect the observed behavior to the chapter's underlying rule.
Procedure
Open the Chapter 02 Interactive Lab and select "A. Luhn number detective".
Record a prediction in your notebook before changing any controls, then run at least three distinct test inputs.
Inspect the corresponding JavaScript snippet(s) on the Chapter 02 Code page and trace how the algorithm computes the output.
Test a boundary or failure case (for example, invalid input, noise, or an extreme parameter) and explain why the system behaves as it does.
Sample Input: Baseline preset in "A. Luhn number detective" followed by one modified parameter or boundary test case.
Expected Observation: Deterministic visual/numeric state update in the lab panel matching the mathematical model for Chapter 02.
Show Hint & Extension Challenge
Hint: Check the worked example and equation in the Chapter 02 Lesson before testing edge cases.
Extension Challenge: Design an adversarial or edge-case input that exposes a limit of the model in "Luhn number detective" and document what real-world standard addresses it.
Reflection Question: What real-world constraint or trade-off did "Luhn number detective" make visible that you would not notice from using a finished app?
Lab section: B. Weighted-sum checker · Related code: block-02.js
Objective: Investigate "Weighted-sum checker" experimentally in the Chapter 02 Interactive Lab and connect the observed behavior to the chapter's underlying rule.
Procedure
Open the Chapter 02 Interactive Lab and select "B. Weighted-sum checker".
Record a prediction in your notebook before changing any controls, then run at least three distinct test inputs.
Inspect the corresponding JavaScript snippet(s) on the Chapter 02 Code page and trace how the algorithm computes the output.
Test a boundary or failure case (for example, invalid input, noise, or an extreme parameter) and explain why the system behaves as it does.
Sample Input: Baseline preset in "B. Weighted-sum checker" followed by one modified parameter or boundary test case.
Expected Observation: Deterministic visual/numeric state update in the lab panel matching the mathematical model for Chapter 02.
Show Hint & Extension Challenge
Hint: Check the worked example and equation in the Chapter 02 Lesson before testing edge cases.
Extension Challenge: Design an adversarial or edge-case input that exposes a limit of the model in "Weighted-sum checker" and document what real-world standard addresses it.
Reflection Question: What real-world constraint or trade-off did "Weighted-sum checker" make visible that you would not notice from using a finished app?
Lab section: C. Invent a lab label · Related code: block-03.js
Objective: Investigate "Invent a lab label" experimentally in the Chapter 02 Interactive Lab and connect the observed behavior to the chapter's underlying rule.
Procedure
Open the Chapter 02 Interactive Lab and select "C. Invent a lab label".
Record a prediction in your notebook before changing any controls, then run at least three distinct test inputs.
Inspect the corresponding JavaScript snippet(s) on the Chapter 02 Code page and trace how the algorithm computes the output.
Test a boundary or failure case (for example, invalid input, noise, or an extreme parameter) and explain why the system behaves as it does.
Sample Input: Baseline preset in "C. Invent a lab label" followed by one modified parameter or boundary test case.
Expected Observation: Deterministic visual/numeric state update in the lab panel matching the mathematical model for Chapter 02.
Show Hint & Extension Challenge
Hint: Check the worked example and equation in the Chapter 02 Lesson before testing edge cases.
Extension Challenge: Design an adversarial or edge-case input that exposes a limit of the model in "Invent a lab label" and document what real-world standard addresses it.
Reflection Question: What real-world constraint or trade-off did "Invent a lab label" make visible that you would not notice from using a finished app?