Teacher and presenter guide · Haar-wavelet reconstruction workspace
You need: index.html open in any modern browser, on a
projector or on each student's phone. No network, no install, no accounts. Nothing is fetched at
runtime, so it works with the wi-fi off.
One per stage, in the learner's own words — these are the three Takeaway cards on screen, verbatim. If a student can say these three things and point at the evidence for each, the demo has done its job.
An AI-built classroom tool from Part four. Its goal is to make "coefficient budget" a checkable number rather than a vibe, its engine runs live in the browser, and its assumptions — no compression, no denoising — are one tap away in Details. It does not depend on any earlier demo, so it can be taught on its own; the habit it shares with the rest of Part four is naming the boundary between mechanism and claim.
How much can you throw away before it costs you — and how do you know exactly how much?
Question: For the pair [3,1], if only the coarse coefficient survives,
why does the reconstruction become [2,2] rather than [3,1]?
Predict prompt: Press Coarse only on the default signal
[3,1,4,1,5,9,2,6]. Before looking, guess what every one of the eight reconstructed values
becomes.
Activity (3 minutes): 0:00 read the eight sliders and the coefficient cards · 0:45 press Coarse only and check the room's guess · 1:30 click a retained detail card, commit a predicted rise, then press Drop it and check · 2:30 read the readout: the rise equals the coefficient squared, exactly.
Expected observation: With every coefficient kept, squared error is 0.000.
Dropping D1.3 (value −2.828) raises it to exactly 8.000 — and (−2.828)² =
8.000, matching to the third decimal (independently checked in
wavelet.test.js). Pressing Coarse only reconstructs every one of the eight values to
3.875, the plain average of the signal, with squared error 52.875.
Check-yourself answer key: "Because the detail coefficient — the only thing that
told the two values apart — was dropped." The wrong option, "coarsening always throws away
information, even before anything is dropped," is refuted by the demo's own math: the coarse and
detail coefficients together reconstruct [3,1] exactly, and nothing is lost until a
coefficient is actually zeroed.
Teaching limit: This is a pure squared-error accounting; it says nothing yet about which coefficient a person would notice missing. Stage 2 raises that question with a real image.
Question: As the coefficient budget grows, which visual features return first — and does RMSE track what you see?
Predict prompt: Set Mountain lake to a budget of 64. Before looking, guess which shapes survive and which vanish.
Activity (3 minutes): 0:00 note Mountain lake at the default budget of 256 · 0:30 drag the budget down to 64 and compare survivors to the room's guess · 1:30 raise the budget through 256 and 1,024 and watch which boundaries return · 2:30 read Retained energy and RMSE together.
Expected observation, computed for this guide (2026-09-15): at a 64-coefficient budget, Mountain lake keeps 99.1% retained energy (RMSE 14.51); Portrait keeps 95.6% (RMSE 25.88); City at dusk keeps 92.9% (RMSE 20.11). Numerically, this particular procedural city scene is treated less kindly than the portrait at this budget — worth surfacing, because a room asked to guess usually expects the face to be the hardest case.
Check-yourself answer key: "No — largest-magnitude selection minimizes squared error, not perceived sharpness." The wrong option treats RMSE as a guarantee of what looks better, which the page never claims and does not measure.
Teaching limit: Largest-magnitude selection is provably optimal for squared error in
this orthonormal basis (checked in wavelet.test.js). Whether a reconstruction looks right
to a person is not measured anywhere on this page.
Question: At a hard 64-coefficient budget, which feature of a portrait survives and which fails — and does the same energy accounting explain why?
Predict prompt: Before pressing the button: which feature of a portrait survives a 64-coefficient budget, and which one fails?
Activity (2–4 minutes): 0:00 press Set up Portrait at 64, which jumps back to the Image stage already configured · 0:30 name one surviving feature and one failed feature against the room's guess · 1:30 raise the budget until the eyes become recognizable and read the new energy/RMSE numbers · 3:00 compare Portrait with City at dusk at the same budget using the numbers above.
Expected observation: at budget 64, Portrait's large smooth cheek and background regions survive while the eyes and mouth — small, sharp, localized detail — are the last to resolve. The energy/RMSE numbers move together with what the room sees, per Stage 1's identity summed over the 4,032 omitted coefficients.
Check-yourself answer key: "The same budget does not treat every image equally — it depends on where the image concentrates its large coefficients." The wrong option overgeneralizes from one hard case to "64 is too small for any image," which City at dusk's and Mountain lake's own 64-budget reconstructions already refute.
Teaching limit: This exercise does not score or auto-grade an answer; "survives" and "fails" are the learner's own description, checked against the readouts, not a feature detector.
(a,b), the transform computes a normalized coarse
coefficient (a+b)/√2 and detail coefficient (a−b)/√2,
then repeats only on the coarse half. Eight values lay out as
[A3, D3, D2.1, D2.2, D1.1 … D1.4].This lab does not quantize, encode bits, denoise, or promise a file-compression ratio — only a coefficient-selection reconstruction it computes in real time. The three grayscale scenes are original procedural illustrations, not photographs or measured datasets. Full per-stage assumption lists are in the app's Details drawer, which is the surface students should be sent to when they ask "but is that a real photo?".
The three stage tabs run across the top; none is locked, so a presenter can jump straight to any of them. Details in each stage intro opens that stage's formula, assumptions and sources. ? reopens the Guide. ⚙ Settings offers Open Presenter Notes (this document), Presentation mode and Reset.
Presentation mode scales the page up one notch and adds a Notes button to the header for these cues. Reset returns the demo to its opening state without reloading the page — the default signal, every coefficient restored, the predicted-rise box cleared, Mountain lake at a budget of 256 — and leaves presentation mode as you set it. Stage 3's own button sets up the Portrait scene at budget 64 and jumps to the Image stage so the room watches it happen.
These sources support the underlying mathematics; they do not endorse this activity. The
three procedural scenes and every readout are this lab's own computation, independently pinned in
src/wavelet.test.js, which does not call the production transform it checks against.
index.html to run the workspace.
src/demo-guide.html is the canonical source of this document; the shipped
teacher-guide.html, the PDF beside it, and the in-app presenter notes are all generated from
it at build time.