An AI skill that turns books into animated, narrated, interactive web experiences
JavaScript ai-agentsai-educationanimationclaudeclaude-codeclaude-skillsedtecheducationinteractive-textbookscormtext-to-video
feat(math): add proportions chapter
yzr0eb26482c9eb
diff --git a/site/index.html b/site/index.htmlindex 7d8494d..777f4b7 100644--- a/site/index.html+++ b/site/index.html@@ -23,8 +23,8 @@<a class="book-hotspot algebra-book" data-book="elementary-algebra" href="elementary-algebra/" aria-label="Open Elementary Algebra, 68 narrated chapters"><span class="book-caption"><strong>Elementary Algebra <span aria-hidden="true">↗</span></strong><small>68 narrated chapters</small></span></a>- <a class="book-hotspot math-book" data-book="math-notebook" href="math-notebook/" aria-label="Open Elementary Mathematics, 16 narrated chapters">- <span class="book-caption"><strong>Elementary Mathematics <span aria-hidden="true">↗</span></strong><small>16 narrated chapters</small></span>+ <a class="book-hotspot math-book" data-book="math-notebook" href="math-notebook/" aria-label="Open Elementary Mathematics, 17 narrated chapters">+ <span class="book-caption"><strong>Elementary Mathematics <span aria-hidden="true">↗</span></strong><small>17 narrated chapters</small></span></a><span class="physics-pending">Physics · Coming soon</span></section>diff --git a/site/lib/bookshelf.js b/site/lib/bookshelf.jsindex 9ab935f..46fbf45 100644--- a/site/lib/bookshelf.js+++ b/site/lib/bookshelf.js@@ -17,7 +17,7 @@const books = [{ id: 'elementary-algebra', key: 'progress', chapterBase: 'elementary-algebra/', chapters: 68 },{ id: 'math-notebook', key: 'animebook:progress:' + new URL('math-notebook/', location.href).pathname,- chapterBase: 'math-notebook/', chapters: 16 },+ chapterBase: 'math-notebook/', chapters: 17 },];for (const book of books) {const cover = document.querySelector(`[data-book="${book.id}"]`);diff --git a/site/math-notebook/ch16/index.html b/site/math-notebook/ch16/index.htmlindex 85279f0..c404a6b 100644--- a/site/math-notebook/ch16/index.html+++ b/site/math-notebook/ch16/index.html@@ -2,7 +2,7 @@<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Unit Rate and Unit Price — Elementary Mathematics</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"><style>.band .prompt{font-size:27px}.side .keys{font-size:19px}.screen .blanks .bline{gap:12px}.screen .blanks .box{width:7ch!important}.screen .blanks .why{font-size:22px}.screen .blanks .bline svg tspan{font-style:normal}</style></head><body><script src="../lib/engine.js"></script><script src="audio/en/timings.js"></script><script>'use strict';-const CHAPTER={number:16,title:'Unit Rate and Unit Price',minutes:10,language:'en'};+const CHAPTER={number:16,title:'Unit Rate and Unit Price',minutes:10,language:'en', next: '../ch17/' };// Reuse ch15 text/math entrance pattern; quantities blue, time/item denominator coral, focus amber.const urText=(p,s,x,y,t=0,size=30,col=COL.chalk,anchor='start')=>{const e=T(p,s,{x,y,size,fill:col,anchor,o:0});show(e,t);return e;};const urMath=(p,s,x,y,t=0,size=52,col=COL.chalk)=>{const e=M(p,Array.isArray(s)?s:[s],{x,y,size,fill:col,anchor:'middle',o:0});show(e,t);return e;};diff --git a/site/math-notebook/ch17/audio/en/common.mp3 b/site/math-notebook/ch17/audio/en/common.mp3new file mode 100644index 0000000..116e6e5Binary files /dev/null and b/site/math-notebook/ch17/audio/en/common.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/constant.mp3 b/site/math-notebook/ch17/audio/en/constant.mp3new file mode 100644index 0000000..a28b776Binary files /dev/null and b/site/math-notebook/ch17/audio/en/constant.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/copies.mp3 b/site/math-notebook/ch17/audio/en/copies.mp3new file mode 100644index 0000000..4ce521bBinary files /dev/null and b/site/math-notebook/ch17/audio/en/copies.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/cross.mp3 b/site/math-notebook/ch17/audio/en/cross.mp3new file mode 100644index 0000000..1238fb1Binary files /dev/null and b/site/math-notebook/ch17/audio/en/cross.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/data.mp3 b/site/math-notebook/ch17/audio/en/data.mp3new file mode 100644index 0000000..d1d70bcBinary files /dev/null and b/site/math-notebook/ch17/audio/en/data.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/decimal.mp3 b/site/math-notebook/ch17/audio/en/decimal.mp3new file mode 100644index 0000000..895a769Binary files /dev/null and b/site/math-notebook/ch17/audio/en/decimal.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/final1.mp3 b/site/math-notebook/ch17/audio/en/final1.mp3new file mode 100644index 0000000..9eebc7fBinary files /dev/null and b/site/math-notebook/ch17/audio/en/final1.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/final2.mp3 b/site/math-notebook/ch17/audio/en/final2.mp3new file mode 100644index 0000000..e4aaadaBinary files /dev/null and b/site/math-notebook/ch17/audio/en/final2.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/final3.mp3 b/site/math-notebook/ch17/audio/en/final3.mp3new file mode 100644index 0000000..36ff84eBinary files /dev/null and b/site/math-notebook/ch17/audio/en/final3.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/finish.mp3 b/site/math-notebook/ch17/audio/en/finish.mp3new file mode 100644index 0000000..702845dBinary files /dev/null and b/site/math-notebook/ch17/audio/en/finish.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/intro.mp3 b/site/math-notebook/ch17/audio/en/intro.mp3new file mode 100644index 0000000..5f1af2cBinary files /dev/null and b/site/math-notebook/ch17/audio/en/intro.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/q1.mp3 b/site/math-notebook/ch17/audio/en/q1.mp3new file mode 100644index 0000000..948f34bBinary files /dev/null and b/site/math-notebook/ch17/audio/en/q1.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/q2.mp3 b/site/math-notebook/ch17/audio/en/q2.mp3new file mode 100644index 0000000..e9b1bbaBinary files /dev/null and b/site/math-notebook/ch17/audio/en/q2.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/q3.mp3 b/site/math-notebook/ch17/audio/en/q3.mp3new file mode 100644index 0000000..1c6aac3Binary files /dev/null and b/site/math-notebook/ch17/audio/en/q3.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/recipe.mp3 b/site/math-notebook/ch17/audio/en/recipe.mp3new file mode 100644index 0000000..72577f8Binary files /dev/null and b/site/math-notebook/ch17/audio/en/recipe.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/scale.mp3 b/site/math-notebook/ch17/audio/en/scale.mp3new file mode 100644index 0000000..5e25253Binary files /dev/null and b/site/math-notebook/ch17/audio/en/scale.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/solve.mp3 b/site/math-notebook/ch17/audio/en/solve.mp3new file mode 100644index 0000000..e64a038Binary files /dev/null and b/site/math-notebook/ch17/audio/en/solve.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/timings.js b/site/math-notebook/ch17/audio/en/timings.jsnew file mode 100644index 0000000..866cbd9--- /dev/null+++ b/site/math-notebook/ch17/audio/en/timings.js@@ -0,0 +1,690 @@+window.TIMINGS = {+ "intro": {+ "dur": 20.592,+ "marks": {+ "sub": 7.904+ },+ "cues": [+ [+ 0.104,+ "Chapter seventeen."+ ],+ [+ 1.68,+ "Proportions."+ ],+ [+ 2.878,+ "Two batches can have different sizes but the same recipe."+ ],+ [+ 6.55,+ "What stays the same?"+ ],+ [+ 7.904,+ "We will watch both quantities scale together, explain why cross products work, and find missing amounts."+ ],+ [+ 14.688,+ "Numbers need their units, and a prediction needs a reason to expect the same rate."+ ]+ ]+ },+ "recipe": {+ "dur": 24.72,+ "marks": {+ "syrup": 2.474,+ "water": 3.841,+ "ratio": 12.448+ },+ "cues": [+ [+ 0.091,+ "Our invented drink recipe uses two cups of syrup with three cups of water."+ ],+ [+ 5.469,+ "Blue cups mean syrup; coral cups mean water."+ ],+ [+ 8.958,+ "Every drawn cup represents one cup of liquid."+ ],+ [+ 12.448,+ "The ordered ratio is two cups of syrup for three cups of water."+ ],+ [+ 16.836,+ "Keep syrup first and water second."+ ],+ [+ 19.505,+ "These are amounts in the recipe, not a claim that syrup and water are the same ingredient."+ ]+ ]+ },+ "copies": {+ "dur": 29.76,+ "marks": {+ "copy": 3.385,+ "total": 12.812,+ "same": 19.049+ },+ "cues": [+ [+ 0.104,+ "We want a larger batch with exactly the same recipe."+ ],+ [+ 3.385,+ "Add two more copies of the original batch."+ ],+ [+ 5.977,+ "The first two syrup cups and three water cups stay in place; the new groups contain the same amounts."+ ],+ [+ 12.812,+ "Three batches have six cups of syrup and nine cups of water."+ ],+ [+ 16.51,+ "Both amounts were multiplied by three."+ ],+ [+ 19.049,+ "Six to nine has the same balance as two to three, because every water group still has its matching syrup group."+ ],+ [+ 26.576,+ "An equal pair of ratios is called a proportion."+ ]+ ]+ },+ "scale": {+ "dur": 36.72,+ "marks": {+ "grow": 3.737,+ "cancel": 13.867,+ "rule": 22.135+ },+ "cues": [+ [+ 0.104,+ "The bars measure the two liquid amounts on the same cup scale."+ ],+ [+ 3.737,+ "Let both amounts grow by the same factor, from one batch to three batches."+ ],+ [+ 9.128,+ "At every moment, the syrup amount is two thirds of the water amount."+ ],+ [+ 13.867,+ "Multiplying numerator and denominator by the same nonzero factor does not change a ratio: the factor cancels when we divide."+ ],+ [+ 22.135,+ "For these positive liquid amounts the scale factor is positive."+ ],+ [+ 26.25,+ "Never use zero as a denominator."+ ],+ [+ 28.646,+ "Multiplying both amounts by zero would produce zero over zero, which is undefined, not an equivalent ratio."+ ]+ ]+ },+ "q1": {+ "dur": 7.056,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Quick check."+ ],+ [+ 1.133,+ "Select the larger batch that keeps two cups of syrup for every three cups of water."+ ]+ ]+ },+ "common": {+ "dur": 39.24,+ "marks": {+ "expand": 5.794,+ "shared": 19.883,+ "compare": 27.865+ },+ "cues": [+ [+ 0.104,+ "Why can cross products test a proportion?"+ ],+ [+ 2.773,+ "Start with two thirds and six ninths."+ ],+ [+ 5.794,+ "Give both fractions the same denominator."+ ],+ [+ 8.815,+ "Multiply two thirds by nine over nine; multiply six ninths by three over three."+ ],+ [+ 15.182,+ "These multipliers equal one, so each fraction keeps its value."+ ],+ [+ 19.883,+ "Both denominators are twenty-seven."+ ],+ [+ 22.448,+ "The numerators become two times nine and six times three, both eighteen."+ ],+ [+ 27.865,+ "With equal nonzero denominators, equal fractions must have equal numerators."+ ],+ [+ 33.88,+ "That is where the cross products come from."+ ],+ [+ 36.003,+ "The diagonal pattern is a shortcut for this reason."+ ]+ ]+ },+ "cross": {+ "dur": 36.408,+ "marks": {+ "diagonal": 4.141,+ "general": 15.56,+ "condition": 24.792+ },+ "cues": [+ [+ 0.13,+ "Here is the shortcut, with its reason still attached."+ ],+ [+ 4.141,+ "Multiply the first numerator by the second denominator, and the second numerator by the first denominator."+ ],+ [+ 10.482,+ "For two thirds and six ninths, those products are eighteen and eighteen."+ ],+ [+ 15.56,+ "For a over b and c over d, the common denominator is b times d."+ ],+ [+ 21.237,+ "The numerators are a times d and c times b."+ ],+ [+ 24.792,+ "As long as b and d are nonzero, equal cross products mean equal ratios, and equal ratios mean equal cross products."+ ],+ [+ 33.841,+ "Neither denominator may be zero."+ ]+ ]+ },+ "unequal": {+ "dur": 28.488,+ "marks": {+ "products": 3.268,+ "different": 8.307,+ "check": 22.383+ },+ "cues": [+ [+ 0.104,+ "Now compare five eighths with eight twelfths."+ ],+ [+ 3.268,+ "Five times twelve is sixty."+ ],+ [+ 5.612,+ "Eight times eight is sixty-four."+ ],+ [+ 8.307,+ "Those products are unequal, so the two ratios do not form a proportion."+ ],+ [+ 13.268,+ "Changing only one amount changes the balance."+ ],+ [+ 16.497,+ "You can use scaling when the factor is easy to see, or cross products when it is not."+ ],+ [+ 22.383,+ "Both methods ask the same mathematical question: are the two ordered ratios equal?"+ ]+ ]+ },+ "q2": {+ "dur": 9.744,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Quick check."+ ],+ [+ 1.172,+ "For two fourths and six twelfths, choose the correct pair of cross-product rectangles."+ ],+ [+ 7.435,+ "Each square represents one."+ ]+ ]+ },+ "unknown": {+ "dur": 34.992,+ "marks": {+ "blank": 8.073,+ "units": 14.089,+ "groups": 21.107,+ "answer": 28.49+ },+ "cues": [+ [+ 0.078,+ "A new recipe uses three cups of concentrate with four cups of water."+ ],+ [+ 4.648,+ "We want the same recipe using twelve cups of water."+ ],+ [+ 8.073,+ "The concentrate amount is missing."+ ],+ [+ 10.339,+ "The letter x is only a name for that missing number of cups."+ ],+ [+ 14.089,+ "Put concentrate above water in both ratios: three over four equals x over twelve."+ ],+ [+ 21.107,+ "Twelve cups of water make three copies of the four-cup group, so we need three copies of the three concentrate cups."+ ],+ [+ 28.49,+ "That gives nine cups of concentrate."+ ],+ [+ 30.781,+ "The missing number is concrete before any algebra shortcut."+ ]+ ]+ },+ "solve": {+ "dur": 35.424,+ "marks": {+ "product": 3.164,+ "share": 12.721,+ "divide": 21.797,+ "verify": 27.669+ },+ "cues": [+ [+ 0.104,+ "We can find the same missing number with cross products."+ ],+ [+ 3.164,+ "Three times twelve equals four times x."+ ],+ [+ 6.12,+ "Three times twelve is thirty-six, so four copies of the missing number must total thirty-six."+ ],+ [+ 12.721,+ "These thirty-six counters model that number, not thirty-six cups in our recipe."+ ],+ [+ 17.734,+ "Share them into four equal groups."+ ],+ [+ 20.312,+ "Each group has nine."+ ],+ [+ 21.797,+ "Dividing thirty-six by four undoes the four copies, so x is nine."+ ],+ [+ 27.669,+ "Check it in the original ratio: nine cups of concentrate for twelve cups of water is three cups for every four."+ ]+ ]+ },+ "q3": {+ "dur": 6.96,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Quick check."+ ],+ [+ 1.172,+ "Choose the completed recipe with matching units and the right missing concentrate amount."+ ]+ ]+ },+ "decimal": {+ "dur": 32.784,+ "marks": {+ "cross": 5.859,+ "divide": 10.117,+ "verify": 15.534+ },+ "cues": [+ [+ 0.091,+ "A missing amount need not be a whole number."+ ],+ [+ 2.773,+ "Five eighths equals y over fourteen."+ ],+ [+ 5.859,+ "The cross products give eight copies of y equal to seventy."+ ],+ [+ 10.117,+ "Seventy divided by eight is eight point seven five."+ ],+ [+ 14.141,+ "That is the missing number."+ ],+ [+ 15.534,+ "Check: eight times eight point seven five is exactly seventy, just like five times fourteen."+ ],+ [+ 22.018,+ "Eight point seven five also equals thirty-five fourths."+ ],+ [+ 26.419,+ "Keep the exact value; a nearby rounded number would not make this exact proportion true."+ ]+ ]+ },+ "travel": {+ "dur": 38.496,+ "marks": {+ "assume": 4.583,+ "units": 10.3,+ "extend": 18.516,+ "answer": 23.307+ },+ "cues": [+ [+ 0.104,+ "Suppose a train travels eighty-four kilometres in three hours."+ ],+ [+ 4.583,+ "Assume it maintains the same speed for seven hours; that assumption permits our prediction."+ ],+ [+ 10.3,+ "Kilometres stay above hours in both ratios."+ ],+ [+ 14.062,+ "Eighty-four over three equals the missing distance over seven."+ ],+ [+ 18.516,+ "The distance and time bars grow together from three hours to seven."+ ],+ [+ 23.307,+ "Eighty-four divided by three is twenty-eight kilometres per hour."+ ],+ [+ 27.461,+ "Seven hours at twenty-eight kilometres per hour gives one hundred ninety-six kilometres."+ ],+ [+ 33.164,+ "The original observation alone cannot guarantee that the train will keep that speed."+ ]+ ]+ },+ "constant": {+ "dur": 40.152,+ "marks": {+ "normalize": 5.208,+ "rate": 12.969,+ "reverse": 25.885+ },+ "cues": [+ [+ 0.091,+ "Return to the recipe with three cups of concentrate for four cups of water."+ ],+ [+ 5.208,+ "Divide both amounts by four."+ ],+ [+ 7.409,+ "The water amount becomes one cup; concentrate becomes three quarters of a cup."+ ],+ [+ 12.969,+ "The constant of proportionality in this direction is three quarters of a cup of concentrate per cup of water."+ ],+ [+ 19.401,+ "Multiply any chosen water amount by that rate to get concentrate, if we keep the same recipe."+ ],+ [+ 25.885,+ "Reverse the question and the rate becomes four thirds cups of water per cup of concentrate."+ ],+ [+ 31.576,+ "Direction and units belong to the constant."+ ],+ [+ 34.701,+ "The factor three between two batches is a batch scale factor, not this unit rate."+ ]+ ]+ },+ "data": {+ "dur": 36.48,+ "marks": {+ "rates": 6.042,+ "one": 12.93,+ "assumption": 17.188+ },+ "cues": [+ [+ 0.104,+ "A pump delivered twenty-one litres in three minutes and thirty-five litres in five minutes."+ ],+ [+ 6.042,+ "Both observed ratios give seven litres per minute."+ ],+ [+ 9.74,+ "The table is consistent with one constant rate."+ ],+ [+ 12.93,+ "Seven is the unit rate in litres per minute, not minutes per litre."+ ],+ [+ 17.188,+ "A finite table does not prove that the pump will always work at that rate."+ ],+ [+ 21.862,+ "If we assume it continues steadily, eight minutes would give fifty-six litres."+ ],+ [+ 27.214,+ "Without that assumption, the future amount is not determined by these two observations alone."+ ],+ [+ 32.734,+ "Proportions describe a chosen model as well as arithmetic."+ ]+ ]+ },+ "wrap": {+ "dur": 36.432,+ "marks": {+ "w1": 2.096,+ "w2": 12.018,+ "w3": 17.044,+ "w4": 23.555+ },+ "cues": [+ [+ 0.104,+ "Keep four ideas together."+ ],+ [+ 2.096,+ "A proportion states that two ordered ratios are equal."+ ],+ [+ 6.133,+ "Matching units occupy matching positions, and denominators are nonzero."+ ],+ [+ 12.018,+ "Scale both amounts by the same nonzero factor to preserve their ratio."+ ],+ [+ 17.044,+ "Equal cross products follow from a common denominator."+ ],+ [+ 20.521,+ "A missing letter names a concrete missing number."+ ],+ [+ 23.555,+ "A constant of proportionality is a unit rate with direction and units."+ ],+ [+ 28.763,+ "Same recipe or constant speed is an assumption for predictions."+ ],+ [+ 33.802,+ "Now use these ideas in your own examples."+ ]+ ]+ },+ "final1": {+ "dur": 9.84,+ "marks": {},+ "cues": [+ [+ 0.091,+ "Chapter practice, set one."+ ],+ [+ 2.201,+ "Decide which pairs form proportions."+ ],+ [+ 4.922,+ "Compare their cross products; the denominators here are all nonzero."+ ]+ ]+ },+ "final2": {+ "dur": 7.584,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Chapter practice, set two."+ ],+ [+ 2.331,+ "Find each missing number."+ ],+ [+ 4.128,+ "Exact fractions or exact decimals are accepted."+ ]+ ]+ },+ "final3": {+ "dur": 10.944,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Chapter practice, set three."+ ],+ [+ 2.435,+ "Keep the units in order."+ ],+ [+ 4.336,+ "Use the same recipe, the stated constant price or speed, and the unit rate supported by the table."+ ]+ ]+ },+ "finish": {+ "dur": 10.944,+ "marks": {},+ "cues": [+ [+ 0.104,+ "You have finished proportions."+ ],+ [+ 1.927,+ "A larger batch can keep the same balance."+ ],+ [+ 4.675,+ "Match the units, explain the equal ratios, and check the missing number in the original proportion."+ ]+ ]+ }+};diff --git a/site/math-notebook/ch17/audio/en/travel.mp3 b/site/math-notebook/ch17/audio/en/travel.mp3new file mode 100644index 0000000..ea6a88bBinary files /dev/null and b/site/math-notebook/ch17/audio/en/travel.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/unequal.mp3 b/site/math-notebook/ch17/audio/en/unequal.mp3new file mode 100644index 0000000..4a89f9bBinary files /dev/null and b/site/math-notebook/ch17/audio/en/unequal.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/unknown.mp3 b/site/math-notebook/ch17/audio/en/unknown.mp3new file mode 100644index 0000000..96049f1Binary files /dev/null and b/site/math-notebook/ch17/audio/en/unknown.mp3 differdiff --git a/site/math-notebook/ch17/audio/en/wrap.mp3 b/site/math-notebook/ch17/audio/en/wrap.mp3new file mode 100644index 0000000..26faf27Binary files /dev/null and b/site/math-notebook/ch17/audio/en/wrap.mp3 differdiff --git a/site/math-notebook/ch17/index.html b/site/math-notebook/ch17/index.htmlnew file mode 100644index 0000000..a50b734--- /dev/null+++ b/site/math-notebook/ch17/index.html@@ -0,0 +1,54 @@+<!doctype html>+<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Proportions — Elementary Mathematics</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"><style>.band .prompt{font-size:27px}.side .keys{font-size:19px}.screen .blanks .bline{gap:12px}.screen .blanks .box{width:8ch!important}.screen .blanks .why{font-size:22px}.screen .blanks .bline svg tspan{font-style:normal}</style></head><body>+<script src="../lib/engine.js"></script><script src="audio/en/timings.js"></script><script>+'use strict';+const CHAPTER={number:17,title:'Proportions',minutes:12,language:'en'};+// Ch16 entrances; blue = output/concentrate, coral = input/water, amber = focus.+const prText=(p,s,x,y,t=0,size=30,col=COL.chalk,anchor='start')=>{const e=T(p,s,{x,y,size,fill:col,anchor,o:0});show(e,t);return e;};+const prMath=(p,s,x,y,t=0,size=52,col=COL.chalk)=>{const e=M(p,Array.isArray(s)?s:[s],{x,y,size,fill:col,anchor:'middle',o:0});show(e,t);return e;};+const prTitle=(p,s,sub='')=>{prText(p,s,100,110,.1,43);if(sub)prText(p,sub,100,165,.15,27,COL.dim);};+function prCup(p,id,x,y,col){const g=G(p,{x,y});g.dataset.cupId=id;g.dataset.cups='1';path(g,'M-20 -25H20L15 25H-15Z',{fill:mix(COL.board,col,.35),stroke:col,'stroke-width':3});path(g,'M-18 -12H18',{stroke:col,'stroke-width':2});return g;}+function prRecipe(p,a=2,b=3,groups=1,y=300){return [0,1,2].map(i=>{const g=G(p,{x:400+i*380,y:i<groups?0:80,o:i<groups?1:0});g.dataset.batchId='batch-'+i;const top=Array.from({length:a},(_,j)=>prCup(g,'batch-'+i+'-top-'+j,(j-(a-1)/2)*60,y,COL.whole));const bottom=Array.from({length:b},(_,j)=>prCup(g,'batch-'+i+'-bottom-'+j,(j-(b-1)/2)*60,y+150,COL.nat));return {g,top,bottom};});}+function prUnits(p,a,b,top,bot,x,y,t=0){const g=G(p,{o:0});T(g,a+' '+top,{x,y:y-55,size:39,fill:COL.whole,anchor:'middle'});path(g,`M${x-235} ${y}H${x+235}`,{stroke:COL.chalk,'stroke-width':3});T(g,b+' '+bot,{x,y:y+70,size:39,fill:COL.nat,anchor:'middle'});show(g,t);return g;}+function prBars(p,a,b,top,bot,u=90){const x=200;prText(p,top,x,250,0,32,COL.whole);prText(p,bot,x,460,0,32,COL.nat);const first=mk('rect',{x,y:280,width:a*u,height:70,fill:mix(COL.board,COL.whole,.3),stroke:COL.whole,'stroke-width':3},p),second=mk('rect',{x,y:490,width:b*u,height:70,fill:mix(COL.board,COL.nat,.3),stroke:COL.nat,'stroke-width':3},p);const firstLab=prText(p,a+' '+top,x,395,0,32,COL.whole),secondLab=prText(p,b+' '+bot,x,605,0,32,COL.nat),factor=prText(p,'scale × 1',1250,345,0,39,COL.task,'middle');return {first,second,firstLab,secondLab,factor,a,b,u,top,bot};}+function prScale(v,k,t){prog(q=>{const f=1+(k-1)*q;v.first.setAttribute('width',v.a*v.u*f);v.second.setAttribute('width',v.b*v.u*f);v.first.dataset.amount=String(v.a*f);v.second.dataset.amount=String(v.b*f);const fmt=n=>(q>0&&q<1?'≈ ':'')+String(+n.toFixed(3));v.firstLab.textContent=fmt(v.a*f)+' '+(v.a*f===1?v.top.replace(/^cups /,'cup '):v.top);v.secondLab.textContent=fmt(v.b*f)+' '+(v.b*f===1?v.bot.replace(/^cups /,'cup '):v.bot);v.factor.textContent='scale × '+fmt(f);},t,3,io);}+function prProduct(p,x,y,cols,rows,col){const g=G(p,{x,y});g.dataset.cols=String(cols);g.dataset.rows=String(rows);for(let r=0;r<rows;r++)for(let c=0;c<cols;c++)mk('rect',{x:c*22,y:r*22,width:22,height:22,fill:mix(COL.board,col,.3),stroke:col,'stroke-width':1.5},g);return g;}+const BEATS=[+['intro','Proportions',(m,D)=>{const g=G(scene,{o:0,y:24});T(g,'Unit 2 · Ratios, Proportions, and Percents · Chapter 17',{x:800,y:200,size:28,fill:COL.dim,anchor:'middle'});T(g,'Proportions',{x:800,y:380,size:96,weight:600,anchor:'middle'});M(g,[F(2,3),' = ',F(6,9)],{x:800,y:575,size:76,fill:COL.task,anchor:'middle'});tw(g,{o:1,y:0},.2,1,out);prText(g,'Different batch size · same balance',800,745,m('sub'),37,COL.dim,'middle');hide(g,D-.8,.7);}],+['recipe','An ordered recipe',m=>{const p=panel(0);prTitle(p,'Two cups of syrup · three cups of water','Invented recipe · every drawn cup represents 1 cup of liquid');S.prRecipe=prRecipe(p);prText(p,'syrup',130,310,m('syrup'),34,COL.whole);prText(p,'water',130,460,m('water'),34,COL.nat);prUnits(p,2,3,'cups syrup','cups water',1130,370,m('ratio'));prText(p,'Keep syrup first, water second.',800,760,m('ratio',2),40,COL.task,'middle');}],+['copies','Three copies, same recipe',m=>{const p=panel(0);prTitle(p,'Copy the WHOLE recipe','Original batch stays; two new batches use the same amounts.');S.prRecipe=prRecipe(p);prText(p,'syrup',130,310,0,34,COL.whole);prText(p,'water',130,460,0,34,COL.nat);S.prRecipe.slice(1).forEach(s=>{show(s.g,m('copy'),.5);tw(s.g,{y:0},m('copy'),2,io);});[0,1,2].forEach(i=>prText(p,'batch '+(i+1),400+i*380,560,i?m('copy',2):0,29,COL.dim,'middle'));prText(p,'6 cups syrup / 9 cups water',800,665,m('total'),44,COL.chalk,'middle');prMath(p,[F(2,3),' = ',F(6,9)],800,785,m('same'),58,COL.task);}],+['scale','Both amounts share one factor',m=>{const p=panel(0);prTitle(p,'Scale both liquid amounts together','Both bars use the same cup scale; intermediate readouts use ≈.');S.prBars=prBars(p,2,3,'cups syrup','cups water');prScale(S.prBars,3,m('grow'));prMath(p,[F('2 × 3','3 × 3'),' = ',F(2,3)],800,740,m('cancel'),55,COL.task);prText(p,'Same nonzero factor · denominators ≠ 0',800,845,m('rule'),32,COL.dim,'middle');}],+['q1','Choose the equivalent batch',()=>{const p=panel(0);prTitle(p,'Keep 2 syrup cups for every 3 water cups','Select the batch that preserves the recipe. Each cup represents 1 cup.');S.prChoices=[[4,6],[4,3],[6,6]].map(([a,b],i)=>{const x=285+i*515,g=G(p);for(let j=0;j<a;j++)prCup(g,'q1-'+i+'-s-'+j,x+(j-(a-1)/2)*48,300,COL.whole);for(let j=0;j<b;j++)prCup(g,'q1-'+i+'-w-'+j,x+(j-(b-1)/2)*48,455,COL.nat);prText(g,a+' cups syrup',x,240,0,32,COL.whole,'middle');prText(g,b+' cups water',x,550,0,32,COL.nat,'middle');g.dataset.top=String(a);g.dataset.bottom=String(b);return {el:g,box:[x-220,205,440,380],label:a+' syrup cups and '+b+' water cups'};});},{ask:done=>quiz(BAND,[{id:'c-batch',prompt:'Which picture keeps syrup/water = 2/3?',build:pickEls(S.prChoices,0,'4/6 = 2/3: BOTH amounts doubled.',i=>i===1?'Only syrup doubled; water stayed at three. Double both amounts.':'Equal amounts give 1/1, not two syrup cups for every three water cups.')}],done)}],+['common','Where cross products come from',m=>{const p=panel(0);prTitle(p,'Make a common denominator','Multiplying by 9/9 or 3/3 multiplies by ONE.');prMath(p,[F(2,3)],400,310,0,84,COL.whole);prMath(p,[F(6,9)],1130,310,0,84,COL.nat);prMath(p,[F('2 × 9','3 × 9')],400,510,m('expand'),66,COL.whole);prMath(p,[F('6 × 3','9 × 3')],1130,510,m('expand',1),66,COL.nat);prMath(p,[F(18,27),' = ',F(18,27)],800,705,m('shared'),63,COL.task);prText(p,'Same denominator 27: compare 18 with 18.',800,840,m('compare'),33,COL.chalk,'middle');}],+['cross','The diagonal shortcut has a reason',m=>{const p=panel(0);prTitle(p,'Equal ratios ⇔ equal cross products','The common denominator is b × d; it must be nonzero.');prMath(p,[F(2,3)],580,340,0,93);prMath(p,[F(6,9)],1020,340,0,93);const diagonals=path(p,'M610 280L990 350 M610 350L990 280',{stroke:COL.task,'stroke-width':4},{d:0});draw(diagonals,m('diagonal'),1.2);prText(p,'2 × 9 = 18 6 × 3 = 18',800,520,m('diagonal',1.3),44,COL.task,'middle');prMath(p,[F('a','b'),' = ',F('c','d'),' ⇔ a × d = c × b'],800,675,m('general'),51);prText(p,'b ≠ 0 and d ≠ 0',800,820,m('condition'),39,COL.dim,'middle');S.prDiagonals=diagonals;}],+['unequal','Unequal products, unequal ratios',m=>{const p=panel(0);prTitle(p,'Do 5/8 and 8/12 form a proportion?');prMath(p,[F(5,8),' ',F(8,12)],800,350,0,85);prMath(p,'5 × 12 = 60',430,570,m('products'),52,COL.whole);prMath(p,'8 × 8 = 64',1160,570,m('products',2),52,COL.nat);prMath(p,'60 ≠ 64',800,710,m('different'),63,COL.task);prText(p,'Not a proportion: the ordered ratios differ.',800,835,m('check'),34,COL.chalk,'middle');}],+['q2','Choose the matching cross-product areas',()=>{const p=panel(0);prTitle(p,'Compare 2/4 with 6/12','Which picture shows the correct cross products? Each square = 1.');S.prChoices=[[[12,2],[6,4]],[[10,2],[6,4]],[[12,2],[5,4]]].map(([a,b],i)=>{const x=90+i*520,g=G(p);const top=prProduct(g,x+30,280,...a,COL.whole),bot=prProduct(g,x+30,455,...b,COL.nat);prText(g,a[1]+' × '+a[0],x+150,245,0,34,COL.whole,'middle');prText(g,b[0]+' × '+b[1],x+150,420,0,34,COL.nat,'middle');prText(g,String(a[0]*a[1]),x+355,315,0,38,COL.whole,'middle');prText(g,String(b[0]*b[1]),x+355,510,0,38,COL.nat,'middle');return {el:g,box:[x,210,440,370],label:a[1]+' times '+a[0]+' and '+b[0]+' times '+b[1],top,bot};});},{ask:done=>quiz(BAND,[{id:'c-products',prompt:'Choose 2 × 12 and 6 × 4. Do their areas match?',build:pickEls(S.prChoices,0,'Both actual rectangles contain 24 unit squares. Equal products give 2/4 = 6/12.',i=>i===1?'Use twelve, the second denominator, not ten. 2 × 12 = 24.':'Use six, the second numerator, not five. 6 × 4 = 24.')}],done)}],+['unknown','A letter names a missing amount',m=>{const p=panel(0);prTitle(p,'Same recipe · 3 concentrate cups for 4 water cups');prUnits(p,3,4,'cups concentrate','cups water',410,330);prMath(p,'=',795,340,0,56);S.prUnknown=prUnits(p,'x',12,'cups concentrate','cups water',1180,330,m('blank'));prText(p,'Matching ingredient units in matching positions',800,460,m('units'),31,COL.task,'middle');S.prRecipe=prRecipe(p,3,4,1,545);S.prRecipe.slice(1).forEach(s=>{show(s.g,m('groups'),.5);tw(s.g,{y:0},m('groups'),2,io);});prText(p,'concentrate',115,550,0,26,COL.whole);prText(p,'water',115,700,0,26,COL.nat);prText(p,'x = 9 cups of concentrate',800,825,m('answer'),40,COL.task,'middle');}],+['solve','Undo four copies by sharing',m=>{const p=panel(0);prTitle(p,'3/4 = x/12: find the missing number','Counters model the arithmetic product 36, not recipe cups.');prMath(p,'3 × 12 = 4 × x',800,245,m('product'),48);S.prCounters=Array.from({length:36},(_,i)=>{const e=G(p,{x:250+i%12*90,y:345+Math.floor(i/12)*65});e.dataset.counterId='counter-'+i;mk('circle',{r:17,fill:mix(COL.board,COL.whole,.35),stroke:COL.whole,'stroke-width':2},e);const group=Math.floor(i/9),j=i%9;tw(e,{x:350+group*300+(j%3-1)*60,y:345+Math.floor(j/3)*65},m('share'),2,io);return e;});[0,1,2,3].forEach(i=>{const box=mk('rect',{x:250+i*300,y:295,width:200,height:225,rx:12,fill:'none',stroke:COL.task,'stroke-width':2},p);put(box,{o:0});show(box,m('share',2));prText(p,'9 in group '+(i+1),350+i*300,575,m('share',2),28,COL.task,'middle');});prMath(p,'36 ÷ 4 = 9',800,695,m('divide'),56,COL.task);prText(p,'Check: 3/4 = 9/12 · 4 × 9 = 3 × 12',800,825,m('verify'),34,COL.chalk,'middle');}],+['q3','Complete the recipe',()=>{const p=panel(0);prTitle(p,'Same recipe: 3 cups concentrate / 4 cups water','Use 12 cups water. Which completed picture has the right amount AND units?');S.prChoices=[[9,12,'concentrate','water'],[16,12,'concentrate','water'],[9,12,'water','concentrate']].map(([a,b,top,bot],i)=>{const x=285+i*515,g=G(p),topCol=top==='concentrate'?COL.whole:COL.nat,botCol=bot==='concentrate'?COL.whole:COL.nat;prText(g,a+' cups '+top,x,255,0,30,topCol,'middle');mk('rect',{x:x-150,y:300,width:a*18,height:65,fill:mix(COL.board,topCol,.3),stroke:topCol,'stroke-width':3},g);prText(g,b+' cups '+bot,x,455,0,30,botCol,'middle');mk('rect',{x:x-150,y:495,width:b*18,height:65,fill:mix(COL.board,botCol,.3),stroke:botCol,'stroke-width':3},g);Object.assign(g.dataset,{top:String(a),bottom:String(b),topUnit:top,bottomUnit:bot});return {el:g,box:[x-220,215,440,385],label:a+' cups '+top+' above '+b+' cups '+bot};});},{ask:done=>quiz(BAND,[{id:'c-missing',prompt:'Choose the completed concentrate/water ratio.',build:pickEls(S.prChoices,0,'9 cups concentrate / 12 cups water = 3/4. Water tripled, so concentrate tripled.',i=>i===1?'Multiply three concentrate cups by three, not four water cups by four.':'The ingredient units are reversed. Concentrate must be above water in BOTH ratios.')}],done)}],+['decimal','An exact missing decimal',m=>{const p=panel(0);prTitle(p,'Find y: exact fractions or exact decimals');prMath(p,[F(5,8),' = ',F('y',14)],800,330,0,83);prMath(p,'8 × y = 5 × 14 = 70',800,505,m('cross'),57);prMath(p,'y = 70 ÷ 8 = 8.75',800,660,m('divide'),58,COL.task);prText(p,'Check: 8 × 8.75 = 70 · 8.75 = 35/4 exactly',800,815,m('verify'),32,COL.chalk,'middle');}],+['travel','A proportion needs the same speed',m=>{const p=panel(0);prTitle(p,'Train: 84 km in 3 hours','Prediction assumes the train maintains the same speed.');S.prBars=prBars(p,84,3,'km','hours',4);S.prBars.second.setAttribute('width',3*112);+prText(p,'Distance and time use separate, consistent scales.',800,210,m('assume'),27,COL.dim,'middle');prText(p,'km / hours in BOTH ratios',1250,500,m('units'),29,COL.task,'middle');prog(q=>{const f=1+4/3*q,a=84*f,b=3*f;S.prBars.first.setAttribute('width',a*4);S.prBars.second.setAttribute('width',b*112);S.prBars.first.dataset.amount=String(a);S.prBars.second.dataset.amount=String(b);const approx=q>0&&q<1?'≈ ':'';S.prBars.firstLab.textContent=approx+String(+a.toFixed(3))+' km';S.prBars.secondLab.textContent=approx+String(+b.toFixed(3))+' hours';S.prBars.factor.textContent='same speed';},m('extend'),3,io);prText(p,'28 km/hour × 7 hours = 196 km',800,745,m('answer'),42,COL.task,'middle');prText(p,'84/3 = 196/7 · observation + constant-speed assumption',800,840,m('answer',2),29,COL.dim,'middle');}],+['constant','The constant is a directed unit rate',m=>{const p=panel(0);prTitle(p,'Same recipe · concentrate per water','Both liquid bars use the same scale; both amounts divide by 4.');S.prBars=prBars(p,3,4,'cups concentrate','cups water',160);prScale(S.prBars,.25,m('normalize'));prText(p,'¾ cup concentrate',1250,420,m('rate'),30,COL.whole,'middle');prText(p,'per 1 cup water',1250,470,m('rate'),30,COL.nat,'middle');prText(p,'Reverse direction: 4/3 cups water per cup concentrate',800,735,m('reverse'),34,COL.chalk,'middle');prText(p,'Unit rate = 3/4 · This normalization scale factor = 1/4',800,840,m('reverse',2),31,COL.task,'middle');}],+['data','A table supports a model',m=>{const p=panel(0);prTitle(p,'Two observations from a pump','Observed values are consistent with a constant rate.');prText(p,'litres delivered',250,280,0,34,COL.whole);prText(p,'minutes',250,400,0,34,COL.nat);[0,1].forEach(i=>{prText(p,String([21,35][i]),790+i*340,280,0,49,COL.whole,'middle');prText(p,String([3,5][i]),790+i*340,400,0,49,COL.nat,'middle');prText(p,[21,35][i]+' ÷ '+[3,5][i]+' = 7 L/min',790+i*340,530,m('rates'),32,COL.task,'middle');});prText(p,'Constant in this direction: 7 litres per minute',800,645,m('one'),38,COL.task,'middle');prText(p,'IF the pump stays steady: 8 minutes gives 56 litres.',800,755,m('assumption'),33,COL.chalk,'middle');prText(p,'Finite data alone do not guarantee future amounts.',800,850,m('assumption',3),30,COL.dim,'middle');}],+['wrap','Equal ratios, meaningful units',m=>{const p=panel(0);prTitle(p,'Four habits for proportions');[['Equal ordered ratios; matching units; denominators ≠ 0.','w1'],['Scale BOTH quantities by the same nonzero factor.','w2'],['Common denominators explain cross products and missing numbers.','w3'],['Constant = directed unit rate; predictions need assumptions.','w4']].forEach(([s,key],i)=>{const g=G(p,{x:-16,y:285+i*145,o:0});mk('circle',{cx:130,cy:-10,r:26,fill:COL.task},g);T(g,String(i+1),{x:130,y:0,size:30,anchor:'middle',fill:COL.board});T(g,s,{x:195,size:31});tw(g,{x:0,o:1},m(key),.6);});}],+['final1','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-proportions',prompt:'Do these ordered ratios form a proportion? Compare cross products.',build:grid([+{parts:[F(4,7),' and ',F(12,21)],ans:['yes'],why:'4 × 21 = 84 and 12 × 7 = 84. Equal products: yes.'},+{parts:[F(5,6),' and ',F(10,15)],ans:['no'],why:'5 × 15 = 75, but 10 × 6 = 60. Unequal products: no.'},+{parts:[F('1.2',3),' and ',F(2,5)],ans:['yes'],why:'1.2 × 5 = 6 and 2 × 3 = 6. Equal products: yes.'}+],[['yes','Yes'],['no','No']],{multi:false})}],done,'Chapter practice 1 of 3')}],+['final2','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-missing',prompt:'Find each missing number. Use exact fractions or exact decimals.',build:blanks([+{parts:[F(8,12),' = ',F(14,'x'),': x = ',{box:'21'}],why:'8 × x = 12 × 14 = 168; x = 168 ÷ 8 = 21.'},+{parts:[F(5,8),' = ',F('y',14),': y = ',{box:'8.75'}],why:'8 × y = 5 × 14 = 70; y = 70 ÷ 8 = 8.75.'},+{parts:[F('z','2.5'),' = ',F(3,4),': z = ',{box:'1.875'}],why:'4 × z = 2.5 × 3 = 7.5; z = 7.5 ÷ 4 = 1.875.'}+])}],done,'Chapter practice 2 of 3')}],+['final3','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-context',prompt:'Use the stated same recipe, constant price or speed. Keep units in order.',build:blanks([+{parts:['Same paint: 3 blue cups / 5 white cups; 12 blue need ',{box:'20'},' white cups'],why:'Blue amount × 4 requires white amount × 4: 5 × 4 = 20 cups.'},+{parts:['Constant price, no fee: 4 tickets cost $6.40; 10 cost $',{box:'16'}],why:'$6.40 ÷ 4 = $1.60/ticket; 10 × $1.60 = $16.'},+{parts:['Same speed: 72 km in 2 hours; 5 hours gives ',{box:'180'},' km'],why:'72 ÷ 2 = 36 km/hour; 5 × 36 = 180 km.'},+{parts:['Table: 21 L in 3 min, 35 L in 5 min; unit rate ',{box:'7'},' L/min'],why:'Both observed ratios give 7 litres/minute; future predictions require steady flow.'}+])}],done,'Chapter practice 3 of 3')}],+['finish','Finished',()=>panel(0),{ask:finishCard}]+].map(([id,title,run,extra])=>({id,title,run,...extra}));+boot();+</script></body></html>diff --git a/site/math-notebook/index.html b/site/math-notebook/index.htmlindex 2b8cf0e..16fba69 100644--- a/site/math-notebook/index.html+++ b/site/math-notebook/index.html@@ -230,7 +230,7 @@ main#contents { padding-bottom: 80px; }// Chapters are numbered in order through the units. Add a chapter here when its lesson is ready.const UNITS = [ // [unit title, [[chapter title, minutes], ...]]; chapters are numbered in order. Add a chapter when its lesson is ready.['The Number System', [['Types of Numbers and the Number Line', 9], ['Positive and Negative Numbers', 8], ['Absolute Value', 9], ['Factors and Greatest Common Factor', 11], ['Multiples and Least Common Multiple', 10], ['Fraction Basics: Types of Fractions and Adding and Subtracting Fractions', 13], ['Multiplying and Dividing Fractions', 12], ['Adding and Subtracting Decimals', 11], ['Multiplying Decimals', 12], ['Dividing Decimals', 10], ['Adding Positive and Negative Numbers', 12], ['Subtracting Positive and Negative Numbers', 13], ['Multiplying and Dividing Positive and Negative Numbers', 14], ['Inequalities', 10]]],- ['Ratios, Proportions, and Percents', [['Ratios', 9], ['Unit Rate and Unit Price', 10]]],+ ['Ratios, Proportions, and Percents', [['Ratios', 9], ['Unit Rate and Unit Price', 10], ['Proportions', 12]]],];const HUES = ['#f4a48c', '#86c9e8', '#f3c95c', '#e8a0c8', '#8fd6b0', '#bba8ee', '#f0b45a'];const id = n => 'ch' + String(n).padStart(2, '0');