Each project below is tailored to a specific algorithm and scientific question from Chapter 01, with concrete inputs, verifiable numerical outputs, boundary cases, and links to the related lab and pioneer.
Project 1 of 3 · v1-c01-p01Foundational · ~20 min
Binary Mind-Reader Card Engine
Lab activity: A · Mind reader · Related code: block-01.js, block-04.js · Pioneer: View profile
Real-World Problem: How can a computer identify one item out of 64 possibilities using only six yes-or-no electrical switches?
Scientific Question: Why does each binary question exactly halve the remaining search space?
Objective: Encode integers 1–63 into 6-bit binary arrays and reconstruct any secret number from six yes/no card answers.
Hypothesis to Test: If a secret number appears on cards 1, 4, and 16, adding their leading powers of two will always reconstruct the exact number.
Step-by-Step Implementation
Generate the 6 binary cards by grouping integers 1–63 where bit k (2^k) equals 1.
Collect six boolean answers from a partner in Activity A of the Chapter 01 Lab.
Sum 2^k for each "Yes" answer using bitwise shift (1 << k) in JavaScript.
Verify boundary numbers 0 (all No), 1 (only bit 0), and 63 (all Yes).
Concrete Input: Answers: [Yes (1), No (2), Yes (4), No (8), Yes (16), No (32)]
Boundary Condition: Numbers >= 64 overflow 6 bits and require a 7th bit (2^6 = 64).
Common Mistake to Avoid: Confusing bit 0 (value 1) with bit 1 (value 2) and off-by-one array indexing.
Interpreting Results: Every binary digit doubles representational capacity: n bits encode 2^n states.
Show Hint, Extension Challenge & Reflection
Hint: Review the worked example and equation in Chapter 01 before testing the boundary case: Numbers >= 64 overflow 6 bits and require a 7th bit (2^6 = 64).
Extension Challenge: Extend the card generator to 7 bits (1–127) and verify how many numbers appear on each card (64).
Reflection Question: Why does binary work better for noisy electronic switches than base-10 voltage levels?
Lab activity: B · Card detective · Related code: block-02.js · Pioneer: View profile
Real-World Problem: Memory chips and radio packets suffer occasional single-bit flips from electrical noise.
Scientific Question: How does adding one parity bit per row and per column locate the exact flipped cell?
Objective: Build a 5×5 binary grid with row/column even-parity guards and automatically identify any single flipped bit.
Hypothesis to Test: Flipping cell (r, c) will cause exactly row r and column c to report odd parity.
Step-by-Step Implementation
Initialize a 4×4 data matrix of 0s and 1s and compute even parity for each row and column.
Compute the corner guard bit so both the bottom row and right column have even parity.
Flip one arbitrary bit and scan row and column XOR totals to find the unique odd intersection.
Flip two bits in the same row and observe why row parity passes while two columns fail.
Concrete Input: 4×4 data grid with even parity border; flip cell at row 2, column 3.
Expected Output: Odd row = 2, Odd column = 3 -> Corrupted bit located at (2, 3) and repaired.
Test Cases: 0 flips -> Valid; 1 flip at (1,2) -> Detects (1,2); 2 flips in row 1 -> Row parity stays even.
Boundary Condition: Two flips in the same row and two in the same column forming a rectangle can evade 2D parity entirely.
Common Mistake to Avoid: Forgetting to update the corner parity bit when changing initial data.
Interpreting Results: Redundancy turns silent corruption into detectable or correctable geometry, with well-defined limits.
Show Hint, Extension Challenge & Reflection
Hint: Review the worked example and equation in Chapter 01 before testing the boundary case: Two flips in the same row and two in the same column forming a rectangle can evade 2D parity entirely.
Extension Challenge: Write a detector that distinguishes 0 errors, 1 correctable error, and 2+ uncorrectable errors.
Reflection Question: Why is knowing when an error-checker can fail just as important as knowing when it succeeds?
Common Mistake to Avoid: Assuming "parity valid" means "data guaranteed uncorrupted".
Interpreting Results: Single parity detects odd error counts only, motivating Hamming and Reed-Solomon codes in Chapters 4–5.
Show Hint, Extension Challenge & Reflection
Hint: Review the worked example and equation in Chapter 01 before testing the boundary case: Zero-length payloads have trivial parity 0; all-ones 7-bit payload requires parity 1.
Extension Challenge: Run 1,000 random trials with 10% per-bit flip probability and compute the empirical false-pass rate.
Reflection Question: What real-world consequences occur when a spacecraft or medical device relies on insufficient error detection?