An AI skill that turns books into animated, narrated, interactive web experiences
JavaScript ai-agentsai-educationanimationclaudeclaude-codeclaude-skillsedtecheducationinteractive-textbookscormtext-to-video
feat(math): add inequalities chapter
yzr363df8fa0411
diff --git a/site/index.html b/site/index.htmlindex cfb02c6..1caf6df 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, 13 narrated chapters">- <span class="book-caption"><strong>Elementary Mathematics <span aria-hidden="true">↗</span></strong><small>13 narrated chapters</small></span>+ <a class="book-hotspot math-book" data-book="math-notebook" href="math-notebook/" aria-label="Open Elementary Mathematics, 14 narrated chapters">+ <span class="book-caption"><strong>Elementary Mathematics <span aria-hidden="true">↗</span></strong><small>14 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 1b0978a..53e4b45 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: 13 },+ chapterBase: 'math-notebook/', chapters: 14 },];for (const book of books) {const cover = document.querySelector(`[data-book="${book.id}"]`);diff --git a/site/math-notebook/ch13/index.html b/site/math-notebook/ch13/index.htmlindex 79364ca..48a3f64 100644--- a/site/math-notebook/ch13/index.html+++ b/site/math-notebook/ch13/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>Multiplying and Dividing Positive and Negative Numbers — Elementary Mathematics</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"><style>.screen .blanks .math{font-size:38px}.side .keys{font-size:20px}</style></head><body><script src="../lib/engine.js"></script><script src="audio/en/timings.js"></script><script>'use strict';-const CHAPTER={number:13,title:'Multiplying and Dividing Positive and Negative Numbers',minutes:14,language:'en'};+const CHAPTER={number:13,title:'Multiplying and Dividing Positive and Negative Numbers',minutes:14,language:'en', next: '../ch14/' };const smColor=v=>v>0?POS:v<0?NEG:COL.chalk;const smV=v=>({t:num(v),fill:smColor(v)}),smOperand=v=>({t:v<0?'('+num(v)+')':num(v),fill:smColor(v)});const smText=(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;};diff --git a/site/math-notebook/ch14/audio/en/decimals.mp3 b/site/math-notebook/ch14/audio/en/decimals.mp3new file mode 100644index 0000000..fd1a160Binary files /dev/null and b/site/math-notebook/ch14/audio/en/decimals.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/final1.mp3 b/site/math-notebook/ch14/audio/en/final1.mp3new file mode 100644index 0000000..ea5f6ccBinary files /dev/null and b/site/math-notebook/ch14/audio/en/final1.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/final2.mp3 b/site/math-notebook/ch14/audio/en/final2.mp3new file mode 100644index 0000000..a2105e0Binary files /dev/null and b/site/math-notebook/ch14/audio/en/final2.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/final3.mp3 b/site/math-notebook/ch14/audio/en/final3.mp3new file mode 100644index 0000000..fe3a5e0Binary files /dev/null and b/site/math-notebook/ch14/audio/en/final3.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/finish.mp3 b/site/math-notebook/ch14/audio/en/finish.mp3new file mode 100644index 0000000..c848874Binary files /dev/null and b/site/math-notebook/ch14/audio/en/finish.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/fractions.mp3 b/site/math-notebook/ch14/audio/en/fractions.mp3new file mode 100644index 0000000..1e550f1Binary files /dev/null and b/site/math-notebook/ch14/audio/en/fractions.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/inclusive.mp3 b/site/math-notebook/ch14/audio/en/inclusive.mp3new file mode 100644index 0000000..7dc0353Binary files /dev/null and b/site/math-notebook/ch14/audio/en/inclusive.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/intro.mp3 b/site/math-notebook/ch14/audio/en/intro.mp3new file mode 100644index 0000000..6ae2208Binary files /dev/null and b/site/math-notebook/ch14/audio/en/intro.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/lower.mp3 b/site/math-notebook/ch14/audio/en/lower.mp3new file mode 100644index 0000000..173efacBinary files /dev/null and b/site/math-notebook/ch14/audio/en/lower.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/negatives.mp3 b/site/math-notebook/ch14/audio/en/negatives.mp3new file mode 100644index 0000000..bc7dcc1Binary files /dev/null and b/site/math-notebook/ch14/audio/en/negatives.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/notEqual.mp3 b/site/math-notebook/ch14/audio/en/notEqual.mp3new file mode 100644index 0000000..89075c6Binary files /dev/null and b/site/math-notebook/ch14/audio/en/notEqual.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/order.mp3 b/site/math-notebook/ch14/audio/en/order.mp3new file mode 100644index 0000000..46b5c0cBinary files /dev/null and b/site/math-notebook/ch14/audio/en/order.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/q1.mp3 b/site/math-notebook/ch14/audio/en/q1.mp3new file mode 100644index 0000000..9756a43Binary files /dev/null and b/site/math-notebook/ch14/audio/en/q1.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/q2.mp3 b/site/math-notebook/ch14/audio/en/q2.mp3new file mode 100644index 0000000..45281afBinary files /dev/null and b/site/math-notebook/ch14/audio/en/q2.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/q3.mp3 b/site/math-notebook/ch14/audio/en/q3.mp3new file mode 100644index 0000000..4b8373cBinary files /dev/null and b/site/math-notebook/ch14/audio/en/q3.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/repartition.mp3 b/site/math-notebook/ch14/audio/en/repartition.mp3new file mode 100644index 0000000..204ff0bBinary files /dev/null and b/site/math-notebook/ch14/audio/en/repartition.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/reverse.mp3 b/site/math-notebook/ch14/audio/en/reverse.mp3new file mode 100644index 0000000..5d5b605Binary files /dev/null and b/site/math-notebook/ch14/audio/en/reverse.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/strict.mp3 b/site/math-notebook/ch14/audio/en/strict.mp3new file mode 100644index 0000000..562ee00Binary files /dev/null and b/site/math-notebook/ch14/audio/en/strict.mp3 differdiff --git a/site/math-notebook/ch14/audio/en/timings.js b/site/math-notebook/ch14/audio/en/timings.jsnew file mode 100644index 0000000..77db3d6--- /dev/null+++ b/site/math-notebook/ch14/audio/en/timings.js@@ -0,0 +1,697 @@+window.TIMINGS = {+ "intro": {+ "dur": 31.512,+ "marks": {+ "sub": 2.878+ },+ "cues": [+ [+ 0.091,+ "Chapter fourteen."+ ],+ [+ 1.445,+ "Inequalities."+ ],+ [+ 2.878,+ "An equality says that two values match."+ ],+ [+ 6.12,+ "An inequality compares values, or tells us that they are different."+ ],+ [+ 11.12,+ "Our number line will explain the symbols, even when the numbers are negative, decimals, or fractions."+ ],+ [+ 17.487,+ "Then we will use a single inequality to describe a whole collection of possible values."+ ],+ [+ 23.385,+ "This chapter finishes the number system unit."+ ],+ [+ 26.276,+ "We are reading and comparing inequalities here; solving them comes later."+ ]+ ]+ },+ "order": {+ "dur": 32.496,+ "marks": {+ "points": 4.753,+ "compare": 12.747,+ "mouth": 20.833+ },+ "cues": [+ [+ 0.117,+ "Here are negative three and positive five on the same number line."+ ],+ [+ 4.753,+ "Negative three sits to the left of five."+ ],+ [+ 7.904,+ "Values get smaller as we move left and larger as we move right."+ ],+ [+ 12.747,+ "So negative three is less than five."+ ],+ [+ 15.534,+ "Read the sentence from left to right."+ ],+ [+ 17.734,+ "The symbol between them is the less-than sign."+ ],+ [+ 20.833,+ "Its pointed end faces the smaller value."+ ],+ [+ 24.167,+ "Its open side faces the greater value."+ ],+ [+ 27.279,+ "The picture tells us which is greater; the sign records what the picture already shows."+ ]+ ]+ },+ "reverse": {+ "dur": 32.784,+ "marks": {+ "swap": 8.49,+ "sign": 13.008,+ "same": 25.195+ },+ "cues": [+ [+ 0.104,+ "Watch the two number chips exchange places in the written sentence."+ ],+ [+ 4.297,+ "The points on the number line stay put: their values have not changed."+ ],+ [+ 8.49,+ "Five now comes first, and negative three comes second."+ ],+ [+ 13.008,+ "The sign turns around so its open side still faces five."+ ],+ [+ 17.773,+ "Five is greater than negative three."+ ],+ [+ 20.052,+ "This says exactly the same thing as negative three is less than five."+ ],+ [+ 25.195,+ "Reversing the written order reverses the comparison sign."+ ],+ [+ 29.115,+ "It does not reverse the actual order of the values on the line."+ ]+ ]+ },+ "negatives": {+ "dur": 37.752,+ "marks": {+ "distance": 8.529,+ "order": 18.021,+ "zero": 27.63+ },+ "cues": [+ [+ 0.078,+ "Comparing two negative numbers can feel backward if we look only at their digits."+ ],+ [+ 5.69,+ "Here are negative seven and negative two."+ ],+ [+ 8.529,+ "Negative seven is seven units from zero, while negative two is only two units away."+ ],+ [+ 14.896,+ "Those are distances, not their signed values."+ ],+ [+ 18.021,+ "Negative seven is farther left, so negative seven is less than negative two."+ ],+ [+ 23.633,+ "A larger negative magnitude means a smaller signed value."+ ],+ [+ 27.63,+ "Both are less than zero, and zero is less than every positive number."+ ],+ [+ 32.721,+ "Keep looking at position rather than treating the minus sign as decoration."+ ]+ ]+ },+ "q1": {+ "dur": 7.896,+ "marks": {+ "ask": 1.094+ },+ "cues": [+ [+ 0.104,+ "Quick check."+ ],+ [+ 1.094,+ "The temperature was negative nine degrees, then negative four degrees."+ ],+ [+ 5.443,+ "Choose the point for the warmer temperature."+ ]+ ]+ },+ "decimals": {+ "dur": 37.8,+ "marks": {+ "points": 9.036,+ "compare": 17.5,+ "equal": 26.367+ },+ "cues": [+ [+ 0.117,+ "Decimals have positions too."+ ],+ [+ 2.135,+ "This is an enlarged view from two point three zero to two point four zero."+ ],+ [+ 6.732,+ "Each small interval is one hundredth."+ ],+ [+ 9.036,+ "Two point three four is four hundredths past two point three zero."+ ],+ [+ 14.036,+ "Two point three seven is seven hundredths past it."+ ],+ [+ 17.5,+ "Two point three four is to the left, so it is smaller."+ ],+ [+ 21.471,+ "The whole-number and tenths digits match; the hundredths decide the order."+ ],+ [+ 26.367,+ "Writing two point three four zero does not move the point."+ ],+ [+ 30.677,+ "A trailing fractional zero changes the written form, not the value."+ ],+ [+ 35.456,+ "Compare places of equal size."+ ]+ ]+ },+ "fractions": {+ "dur": 38.376,+ "marks": {+ "parts": 13.151,+ "points": 20.872+ },+ "cues": [+ [+ 0.091,+ "Now compare negative three fourths and negative three fifths."+ ],+ [+ 4.57,+ "Both lie between negative one and zero."+ ],+ [+ 7.526,+ "Each upper row represents the same one-unit distance from negative one to zero."+ ],+ [+ 13.151,+ "One row has fourths; the other has fifths."+ ],+ [+ 16.51,+ "Three fourths of a unit is a larger distance than three fifths."+ ],+ [+ 20.872,+ "Moving that distance left from zero puts negative three fourths farther left than negative three fifths."+ ],+ [+ 27.552,+ "So negative three fourths is smaller."+ ],+ [+ 30.482,+ "We have already seen the order on the line."+ ],+ [+ 32.63,+ "Equal denominators give us another way to make the same comparison precise."+ ]+ ]+ },+ "repartition": {+ "dur": 36.84,+ "marks": {+ "cuts": 3.633,+ "labels": 14.518,+ "compare": 25.443+ },+ "cues": [+ [+ 0.104,+ "Keep every original fourth and fifth in place."+ ],+ [+ 3.633,+ "Split each fourth into five equal pieces and each fifth into four equal pieces."+ ],+ [+ 9.935,+ "Both rows now use twentieths."+ ],+ [+ 12.201,+ "No length was added or removed."+ ],+ [+ 14.518,+ "Negative three fourths is negative fifteen twentieths."+ ],+ [+ 18.516,+ "Negative three fifths is negative twelve twentieths."+ ],+ [+ 22.266,+ "The points remain in exactly the same positions."+ ],+ [+ 25.443,+ "Negative fifteen is less than negative twelve, so negative fifteen twentieths is less than negative twelve twentieths."+ ],+ [+ 33.32,+ "Common denominators compare equal-sized pieces."+ ],+ [+ 0,+ "They are one useful method; they are not required when another exact comparison already settles the order."+ ]+ ]+ },+ "q2": {+ "dur": 7.368,+ "marks": {+ "ask": 1.185+ },+ "cues": [+ [+ 0.104,+ "Quick check."+ ],+ [+ 1.185,+ "The line shows negative four fifths and negative three fourths."+ ],+ [+ 5.716,+ "Choose the greater value."+ ]+ ]+ },+ "notEqual": {+ "dur": 36.216,+ "marks": {+ "different": 3.281,+ "equal": 18.359+ },+ "cues": [+ [+ 0.091,+ "A crossed equals sign means not equal."+ ],+ [+ 3.281,+ "Negative one and two are different values, so negative one is not equal to two."+ ],+ [+ 9.284,+ "That symbol alone does not say which is greater."+ ],+ [+ 12.76,+ "Either ordering of those two different values gives a true not-equal sentence."+ ],+ [+ 18.359,+ "Now look at one half and zero point five."+ ],+ [+ 21.315,+ "Their two written forms land on the same point."+ ],+ [+ 24.466,+ "They are equal, so a not-equal sentence about them would be false."+ ],+ [+ 28.737,+ "Different writing does not guarantee different values."+ ],+ [+ 32.227,+ "The symbols compare quantities, not the shapes of the digits."+ ]+ ]+ },+ "inclusive": {+ "dur": 39.312,+ "marks": {+ "region": 10.768,+ "endpoint": 14.271,+ "candidates": 22.943+ },+ "cues": [+ [+ 0.091,+ "An inequality can describe a whole collection of values."+ ],+ [+ 4.336,+ "Read x is less than or equal to two."+ ],+ [+ 7.747,+ "The letter x is a placeholder for a number."+ ],+ [+ 10.768,+ "Every point to the left of two qualifies."+ ],+ [+ 14.271,+ "Two itself also qualifies, because the symbol includes the words or equal to."+ ],+ [+ 20.104,+ "We use a filled boundary point to include it."+ ],+ [+ 22.943,+ "One point five and negative one work; two point five does not."+ ],+ [+ 27.396,+ "These are just examples."+ ],+ [+ 28.997,+ "Fractions and decimals between them work too."+ ],+ [+ 32.083,+ "The shaded direction describes all real values at most two, not only the integers we happened to name."+ ]+ ]+ },+ "lower": {+ "dur": 37.968,+ "marks": {+ "region": 5.169,+ "endpoint": 9.805,+ "candidates": 12.734+ },+ "cues": [+ [+ 0.117,+ "Here is x is greater than or equal to negative one half."+ ],+ [+ 5.169,+ "Start at negative one half and move right to greater values."+ ],+ [+ 9.805,+ "The boundary itself qualifies again."+ ],+ [+ 12.734,+ "Zero and one qualify."+ ],+ [+ 14.766,+ "Negative three fourths does not: it lies to the left of negative one half."+ ],+ [+ 20.326,+ "Think of greater than or equal to as at least."+ ],+ [+ 24.232,+ "Every real value at least negative one half qualifies, whether it is written as an integer, fraction, or decimal."+ ],+ [+ 32.643,+ "There is no single answer."+ ],+ [+ 34.349,+ "The inequality describes a whole set of answers."+ ]+ ]+ },+ "strict": {+ "dur": 39.528,+ "marks": {+ "open": 8.893,+ "closed": 15.169,+ "rule": 24.531+ },+ "cues": [+ [+ 0.104,+ "Compare these two conditions: x is less than two, and x is less than or equal to two."+ ],+ [+ 6.562,+ "Their shaded directions are the same."+ ],+ [+ 8.893,+ "The strict less-than condition excludes two itself, so its boundary point is open."+ ],+ [+ 15.169,+ "The less-than-or-equal condition includes two, so its point is filled."+ ],+ [+ 19.727,+ "One point nine qualifies for both."+ ],+ [+ 22.122,+ "Two qualifies only for the second."+ ],+ [+ 24.531,+ "The same distinction applies to greater than and greater than or equal to."+ ],+ [+ 29.74,+ "An open point excludes the boundary; a filled point includes it."+ ],+ [+ 34.323,+ "We are describing membership, not yet doing algebra to find a boundary."+ ]+ ]+ },+ "q3": {+ "dur": 7.728,+ "marks": {+ "ask": 1.159+ },+ "cues": [+ [+ 0.091,+ "Quick check."+ ],+ [+ 1.159,+ "For each labelled point, decide whether its value is greater than or equal to negative one half."+ ]+ ]+ },+ "wrap": {+ "dur": 37.632,+ "marks": {+ "w1": 2.044,+ "w2": 9.297,+ "w3": 15.755,+ "w4": 22.695+ },+ "cues": [+ [+ 0.104,+ "Keep four ideas together."+ ],+ [+ 2.044,+ "Left is smaller and right is greater; the open side of a comparison sign faces the greater value."+ ],+ [+ 9.297,+ "Negative numbers follow that same order."+ ],+ [+ 11.706,+ "A larger distance left from zero gives a smaller signed value."+ ],+ [+ 15.755,+ "Not equal means different values."+ ],+ [+ 18.203,+ "Equivalent fractions and decimals still count as equal."+ ],+ [+ 22.695,+ "Less than or equal to and greater than or equal to include their boundary."+ ],+ [+ 28.138,+ "A shaded direction describes all qualifying real values, not just a short list of integers."+ ],+ [+ 34.753,+ "Now use those ideas in chapter practice."+ ]+ ]+ },+ "final1": {+ "dur": 11.568,+ "marks": {+ "ask": 2.122+ },+ "cues": [+ [+ 0.104,+ "Chapter practice, part one."+ ],+ [+ 2.122,+ "Choose less than, equal to, or greater than for each comparison."+ ],+ [+ 7.266,+ "Compare exact values and keep negative numbers in number-line order."+ ]+ ]+ },+ "final2": {+ "dur": 8.928,+ "marks": {+ "ask": 2.188+ },+ "cues": [+ [+ 0.104,+ "Chapter practice, part two."+ ],+ [+ 2.188,+ "Decide whether each sentence is true or false."+ ],+ [+ 5.898,+ "Watch equivalent values and the included boundary."+ ]+ ]+ },+ "final3": {+ "dur": 15.168,+ "marks": {+ "ask": 2.448+ },+ "cues": [+ [+ 0.117,+ "Chapter practice, part three."+ ],+ [+ 2.448,+ "Enter any three distinct values satisfying the first condition."+ ],+ [+ 7.357,+ "Then enter three distinct values rejected by the second condition."+ ],+ [+ 11.432,+ "Many answers work."+ ],+ [+ 12.904,+ "Finish with the temperature comparison."+ ]+ ]+ },+ "finish": {+ "dur": 15.72,+ "marks": {},+ "cues": [+ [+ 0.104,+ "You have finished the number system unit."+ ],+ [+ 2.161,+ "You can now compare signed values and read an inequality as a whole set of possibilities."+ ],+ [+ 7.812,+ "Replay any idea you want to revisit."+ ],+ [+ 10.208,+ "The next unit connects quantities through ratios, proportions, and percents."+ ]+ ]+ }+};diff --git a/site/math-notebook/ch14/audio/en/wrap.mp3 b/site/math-notebook/ch14/audio/en/wrap.mp3new file mode 100644index 0000000..b1af0f3Binary files /dev/null and b/site/math-notebook/ch14/audio/en/wrap.mp3 differdiff --git a/site/math-notebook/ch14/index.html b/site/math-notebook/ch14/index.htmlnew file mode 100644index 0000000..93dcbe1--- /dev/null+++ b/site/math-notebook/ch14/index.html@@ -0,0 +1,45 @@+<!doctype html>+<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Inequalities — Elementary Mathematics</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"><style>.screen .grid .num{font-size:34px}.screen .blanks .math{font-size:32px}.side .keys{font-size:19px}.side .grid .row{grid-template-columns:65px minmax(0,1fr) 26px;gap:8px}.side .grid .why{padding-left:0;font-size:19px}.triplets .bline{gap:12px}.triplets .box{width:7ch!important}</style></head><body>+<script src="../lib/engine.js"></script><script src="audio/en/timings.js"></script><script>+'use strict';+const CHAPTER={number:14,title:'Inequalities',minutes:10,language:'en'};+const iqColor=v=>v>0?POS:v<0?NEG:COL.chalk;+const iqText=(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 iqMath=(p,s,x,y,t=0,size=52,col=COL.chalk,anchor='middle')=>{const e=M(p,Array.isArray(s)?s:[s],{x,y,size,fill:col,anchor,o:0});show(e,t);return e;};+const iqTitle=(p,s,sub='')=>{iqText(p,s,100,110,.1,43);if(sub)iqText(p,sub,100,165,.15,27,COL.dim);};+function iqLine(p,lo=-4,hi=4,u=160,y=520,o=800,step=1,labels=null){const g=G(p),x=v=>o+v*u;path(g,`M${x(lo)-15} ${y}H${x(hi)+15}`,{stroke:COL.chalk,'stroke-width':3});path(g,`M${x(lo)-5} ${y-7}L${x(lo)-15} ${y}L${x(lo)-5} ${y+7} M${x(hi)+5} ${y-7}L${x(hi)+15} ${y}L${x(hi)+5} ${y+7}`,{stroke:COL.chalk,'stroke-width':2,fill:'none'});for(let i=0;i<=Math.round((hi-lo)/step);i++){const v=lo+i*step;path(g,`M${x(v)} ${y-8}V${y+8}`,{stroke:COL.dim,'stroke-width':2});T(g,labels?labels(i,v):num(Number(v.toFixed(6))),{x:x(v),y:y+48,size:27,anchor:'middle',font:MATH,fill:Math.abs(v)<1e-10?COL.chalk:COL.dim});}return {g,x,lo,hi,u,y,o};}+function iqPoint(l,v,label=num(v),t=0,dy=-55,size=40,id='point'){const g=G(l.g,{x:l.x(v),y:l.y,o:0});g.dataset.pointId=id;g.dataset.value=v;const c=mk('circle',{r:11,fill:iqColor(v)},g);if(label!==null)M(g,Array.isArray(label)?label:[label],{x:0,y:dy,size,anchor:'middle',fill:iqColor(v)});show(g,t,.5);return {g,c,v};}+function iqComparison(p,a,sym,b,t=0,y=790,size=64){return tokens(p,[{t:a,fill:rat(a)?iqColor(rat(a)[0]):COL.chalk},' '+sym+' ',{t:b,fill:rat(b)?iqColor(rat(b)[0]):COL.chalk}],{x:800,y,size,anchor:'middle'}).map(e=>{put(e,{o:0});show(e,t);return e;});}+function iqDistance(l,v,t=0,y=340){const g=G(l.g,{o:0});const a=l.x(v),b=l.x(0);path(g,`M${a} ${y}H${b} M${a} ${y-8}V${y+8} M${b} ${y-8}V${y+8}`,{stroke:COL.task,'stroke-width':4});T(g,Math.abs(v)+' units',{x:(a+b)/2,y:y-25,size:28,fill:COL.task,anchor:'middle'});show(g,t);return g;}+function iqFractionModel(p){const l=iqLine(p,-1,0,1200,650,1400,.25),rows=[];for(const [n,den,y] of [[3,4,300],[3,5,470]]){const g=G(p),cells=[];for(let i=0;i<den;i++){const c=mk('rect',{x:200+i*1200/den,y,width:1200/den,height:70,fill:i>=den-n?mix(COL.board,NEG,.45):COL.board,stroke:COL.chalk,'stroke-width':2},g);c.dataset.cellId=`whole-${den}-${i}`;cells.push(c);}iqMath(g,['−',F(3,den)],130,y+45,0,40,NEG);rows.push({g,cells,den,y});}const pts=[iqPoint(l,-.75,['−',F(3,4)],0,-55,40,'fraction-fourths'),iqPoint(l,-.6,['−',F(3,5)],0,100,40,'fraction-fifths')];return {l,rows,pts};}+function iqSubdivide(model,t){const cuts=[];for(const row of model.rows)for(let i=1;i<20;i++)if(i%(20/row.den)){const e=path(row.g,`M${200+i*60} ${row.y}V${row.y+70}`,{stroke:COL.dim,'stroke-width':1.5},{d:0});draw(e,t,.9);cuts.push(e);}return cuts;}+function iqRegion(l,bound,dir,closed,t=0){const x=l.x(bound),edge=l.x(dir<0?l.lo:l.hi),g=G(l.g),r=mk('rect',{x,y:l.y-10,width:0,height:20,fill:COL.task,opacity:.3},g);put(r,{a_x:x,a_width:0});tw(r,{a_x:Math.min(x,edge),a_width:Math.abs(edge-x)},t,1.4,lin);const arrow=path(g,`M${edge-dir*15} ${l.y-10}L${edge} ${l.y}L${edge-dir*15} ${l.y+10}`,{stroke:COL.task,'stroke-width':4,fill:'none'},{o:0});show(arrow,t+1.2);const c=mk('circle',{cx:x,cy:l.y,r:13,fill:closed?COL.task:COL.board,stroke:COL.task,'stroke-width':4},g);g.dataset.bound=bound;g.dataset.closed=String(closed);g.dataset.direction=dir;return {g,r,c,bound,dir,closed};}+const iqNorm=s=>String(s).trim().replace(/^\+\s*/,'').replace(/(\d),(?=\d{3}\b)/g,'$1');+const iqCmp=(a,b)=>{const d=BigInt(a[0])*BigInt(b[1])-BigInt(b[0])*BigInt(a[1]);return d<0n?-1:d>0n?1:0;};+function iqQualify(values,bound,dir){const rs=values.map(v=>rat(iqNorm(v)));return rs.every(Boolean)&&rs.every(r=>dir<0?iqCmp(r,bound)<=0:iqCmp(r,bound)<0)&&rs.every((r,i)=>rs.slice(0,i).every(q=>iqCmp(r,q)!==0));}+// Exact rational membership uses original typed numerators/denominators, never floating division.+const iqTriplets=rows=>(body,api)=>{body.classList.add('blanks','triplets');const built=rows.map(it=>{const line=h('div','bline'),mark=h('span','mark'),why=h('div','why');line.append(mathEl(it.parts,32));const boxes=it.answers.map(a=>{const b=h('input','box');Object.assign(b,{type:'text',inputMode:'decimal',autocomplete:'off',spellcheck:false});b.dataset.ans=a;b.setAttribute('aria-label','Distinct qualifying value');line.append(b);return b;});line.append(mark);body.append(h('div','brow',[line,why]));return {it,boxes,mark,why};});const judge=r=>{const ok=iqQualify(r.boxes.map(b=>b.value),r.it.bound,r.it.dir);r.boxes.forEach(b=>{b.classList.toggle('good',ok);b.classList.toggle('bad',!ok)});r.mark.className='mark '+(ok?'good':'bad');r.mark.textContent=ok?'✓':'✗';r.why.replaceChildren(ok?'':rich(r.it.hint,20));return ok;};const all=built.flatMap(r=>r.boxes);requestAnimationFrame(()=>all[0].focus({preventScroll:true}));return {check(){const right=built.filter(judge).length;api.grade(right===built.length,right===built.length?'Every value meets its condition, and each row has three distinct values.':`${right} of ${built.length} right. Check the condition and distinctness in each row.`,{right,total:built.length});},reveal(){built.forEach(r=>{r.boxes.forEach((b,i)=>b.value=r.it.answers[i]);judge(r);r.why.replaceChildren(rich(r.it.why,20))});return 'One possible set is shown. Other distinct qualifying values work too.';},lock(){all.forEach(b=>b.disabled=true)},hint:['type integers, decimals, or fractions; ',kbd('Tab'),' next box, ',kbd('Enter'),' check, ',kbd('Esc'),' leave the box']};};+const iqOrderCols=[['l','<',COL.chalk],['e','=',COL.chalk],['g','>',COL.chalk]],iqTruthCols=[['t','true',COL.chalk],['f','false',COL.dim]];+const BEATS=[+['intro','Inequalities',(m,D)=>{const g=G(scene,{o:0,y:24});T(g,'Unit 1 · The Number System · Chapter 14',{x:800,y:230,size:28,fill:COL.dim,anchor:'middle'});T(g,'Inequalities',{x:800,y:370,size:86,weight:600,anchor:'middle'});M(g,['< > ≠ ≤ ≥'],{x:800,y:550,size:88,anchor:'middle',fill:COL.task});tw(g,{o:1,y:0},.2,1,out);iqText(g,'Compare positions · describe possibilities',800,700,m('sub'),35,COL.dim,'middle');hide(g,D-.8,.7);}],+['order','Left is smaller; right is greater',m=>{const p=panel(0);iqTitle(p,'Position explains the comparison');const l=iqLine(p,-4,6,115,530,660);S.iqLine=l;S.iqPoints=[iqPoint(l,-3,'−3',m('points')),iqPoint(l,5,'5',m('points'))];iqText(p,'← smaller',250,300,m('compare'),37,COL.task);iqText(p,'greater →',1320,300,m('compare'),37,COL.task,'end');iqComparison(p,'−3','<','5',m('compare'));iqText(p,'point toward the smaller value · open toward the greater',800,875,m('mouth'),27,COL.dim,'middle');}],+['reverse','Same order, reversed sentence',m=>{const p=panel(0);iqTitle(p,'The values stay in place');const l=iqLine(p,-4,6,115,560,660);iqPoint(l,-3,'−3',0);iqPoint(l,5,'5',0);const a=G(p,{x:580,y:300}),b=G(p,{x:1020,y:300}),s=G(p,{x:800,y:275});M(a,['−3'],{size:70,anchor:'middle',fill:NEG});M(b,['5'],{size:70,anchor:'middle',fill:POS});M(s,['<'],{y:25,size:82,anchor:'middle'});tw(a,{y:230},m('swap'),.5);tw(b,{y:390},m('swap'),.5);tw(a,{x:1020},m('swap',.5),1.4);tw(b,{x:580},m('swap',.5),1.4);tw(a,{y:300},m('swap',1.9),.5);tw(b,{y:300},m('swap',1.9),.5);hide(s,m('swap'),.15);show(s,m('sign'),.15);tw(s,{r:180},m('sign'),.7);iqMath(p,'−3 < 5 means 5 > −3',800,805,m('same'),53);S.iqSwap={a,b,s,l};}],+['negatives','Distance is not signed order',m=>{const p=panel(0);iqTitle(p,'−7 and −2','A larger negative magnitude sits farther left.');const l=iqLine(p,-8,2,118,610,1110);S.iqLine=l;iqPoint(l,-7,'−7',0);iqPoint(l,-2,'−2',0);iqDistance(l,-7,m('distance'),300);iqDistance(l,-2,m('distance',1),415);iqComparison(p,'−7','<','−2',m('order'),785);iqMath(p,'negative < 0 < positive',800,875,m('zero'),36);}],+['q1','Quick check',()=>{const p=panel(0);iqTitle(p,'Which temperature is warmer?','Temperatures rise toward the right. Units: °C.');const l=iqLine(p,-10,0,115,500,1380);S.iqChoices=[-9,-4,0].map(v=>{const e=iqPoint(l,v,num(v)+'°',0,-70,44,'temperature-'+v);return {el:e.g,box:[l.x(v)-35,410,70,120],label:num(v)+' degrees Celsius'};});},{ask:done=>quiz(BAND,[{id:'c-temperature',prompt:'Choose the warmer temperature: −9°C or −4°C.',build:pickEls(S.iqChoices,1,'−4°C is warmer: −4 is greater than −9 and lies farther right.',i=>i===0?'A nine-degree distance below zero is colder than four degrees below zero.':'Zero is warmer than both, but it is not one of the two given temperatures.')}],done)}],+['decimals','Compare equal place sizes',m=>{const p=panel(0);iqTitle(p,'A zoomed decimal line','Enlarged interval 2.30–2.40 · one small interval = 0.01');const l=iqLine(p,2.3,2.4,12000,540,-27400,.01,(_,v)=>v.toFixed(2));S.iqLine=l;iqPoint(l,2.34,'2.34',m('points'),-90,43);iqPoint(l,2.37,'2.37',m('points'),-90,43);iqComparison(p,'2.34','<','2.37',m('compare'),755);iqMath(p,'2.340 = 2.34',800,855,m('equal'),46);}],+['fractions','Fractions on the same unit',m=>{const p=panel(0);iqTitle(p,'Compare −3/4 and −3/5','Both rows: the same unit from −1 to 0; shaded distance extends left from zero.');const model=iqFractionModel(p);S.iqFraction=model;model.rows.forEach(r=>{put(r.g,{o:0});show(r.g,m('parts'))});model.pts.forEach(e=>{put(e.g,{o:0});show(e.g,m('points'))});iqMath(p,['−',F(3,4),' < −',F(3,5)],800,850,m('points',2),48);}],+['repartition','Equal-sized twentieths',m=>{const p=panel(0);iqTitle(p,'Subdivide without changing either value','Each original fourth → 5 pieces · each original fifth → 4 pieces');S.iqFraction=iqFractionModel(p);S.iqCuts=iqSubdivide(S.iqFraction,m('cuts'));iqMath(p,['−',F(3,4),' = −',F(15,20)],800,250,m('labels'),44);iqMath(p,['−',F(3,5),' = −',F(12,20)],800,435,m('labels',1),44);iqMath(p,['−',F(15,20),' < −',F(12,20)],800,855,m('compare'),48);}],+['q2','Quick check',()=>{const p=panel(0);iqTitle(p,'Choose the greater fraction','A point farther right has the greater value.');const l=iqLine(p,-1,0,1200,500,1400,.25);S.iqChoices=[[-.8,['−',F(4,5)],'−4/5'],[-.75,['−',F(3,4)],'−3/4']].map(([v,label,name],i)=>{const e=iqPoint(l,v,label,0,i===0?-120:110,43,'fraction-choice-'+i);if(i===1)put(e.g.querySelector('g'),{x:80});path(l.g,i===0?`M${l.x(v)} 425V482`:`M${l.x(v)} 518L${l.x(v)+80} 550V563`,{stroke:iqColor(v),'stroke-width':2});return {el:e.g,box:[l.x(v)-45+(i===1?80:0),i===0?335:560,90,95],label:name};});},{ask:done=>quiz(BAND,[{id:'c-negative-fractions',prompt:'Choose the greater value: −4/5 or −3/4.',build:pickEls(S.iqChoices,1,'−3/4 is greater. Exactly, −15/20 > −16/20; its point is farther right.',()=> 'Four fifths is a larger distance from zero. On the negative side, that puts −4/5 farther left.')}],done)}],+['notEqual','Different values, not different writing',m=>{const p=panel(0);iqTitle(p,'≠ means “not equal”');const l=iqLine(p,-2,3,220,480,690);iqPoint(l,-1,'−1',0);iqPoint(l,2,'2',0);iqComparison(p,'−1','≠','2',m('different'),280);iqMath(p,'2 ≠ −1',1190,350,m('different',2),40);const low=iqLine(p,0,1,800,740,400,.25);const half=iqPoint(low,.5,[F(1,2)],m('equal'),-55,43,'equivalent-half');const dec=G(p,{x:1250,y:670,o:0});M(dec,['0.5'],{size:43,fill:POS,anchor:'middle'});show(dec,m('equal'));tw(dec,{x:800,y:835},m('equal',2),1.5);iqText(p,'same point, equal value',1050,835,m('equal',4),27,COL.dim);S.iqEqual={low,half,dec};}],+['inclusive','At most two',m=>{const p=panel(0);iqTitle(p,'x ≤ 2','x is a placeholder. Every real value at most 2 qualifies.');const l=iqLine(p,-4,4,160,500);S.iqRegion=iqRegion(l,2,-1,true,m('region'));iqMath(p,'x ≤ 2',800,300,0,67);iqText(p,'2 is included',1120,395,m('endpoint'),32,COL.task,'middle');iqPoint(l,1.5,'1.5',m('candidates'),95,35);iqPoint(l,-1,'−1',m('candidates'),-65,38);iqPoint(l,2.5,'2.5',m('candidates'),-65,35);iqText(p,'qualifies',l.x(1.5),655,m('candidates'),26,COL.task,'middle');iqText(p,'does not',l.x(2.5),355,m('candidates'),26,COL.dim,'middle');iqText(p,'All points to the left, plus the boundary',800,815,m('candidates',2),35,COL.chalk,'middle');}],+['lower','At least negative one half',m=>{const p=panel(0);iqTitle(p,'x ≥ −1/2','All real values at least −1/2 qualify.');const l=iqLine(p,-2,2,300,540);S.iqRegion=iqRegion(l,-.5,1,true,m('region'));iqMath(p,['x ≥ −',F(1,2)],800,300,0,63);iqMath(p,['−',F(1,2),' is included'],l.x(-.5),435,m('endpoint'),36,COL.task);iqPoint(l,0,'0',m('candidates'),-65,38);iqPoint(l,1,'1',m('candidates'),-65,38);iqPoint(l,-.75,['−',F(3,4)],m('candidates'),100,40);iqText(p,'excluded',l.x(-.75),750,m('candidates'),28,COL.dim,'middle');iqText(p,'The qualifying set continues right without end →',800,840,m('candidates',2),33,COL.chalk,'middle');}],+['strict','Does the boundary qualify?',m=>{const p=panel(0);iqTitle(p,'Same direction; different boundary');const a=iqLine(p,0,3,320,390,300);const b=iqLine(p,0,3,320,650,300);const ra=iqRegion(a,2,-1,false,m('open')),rb=iqRegion(b,2,-1,true,m('closed'));iqMath(p,'x < 2',220,290,0,50);iqMath(p,'x ≤ 2',220,550,0,50);iqText(p,'open: 2 excluded',1160,345,m('open'),31,COL.task,'middle');iqText(p,'filled: 2 included',1160,610,m('closed'),31,COL.task,'middle');iqText(p,'< and > exclude · ≤ and ≥ include',800,835,m('rule'),38,COL.chalk,'middle');S.iqStrict={a,b,ra,rb};}],+['q3','Quick check',()=>{const p=panel(0);iqTitle(p,'Which points qualify?','The condition is x ≥ −1/2. Include the boundary.');const l=iqLine(p,-2,2,220,490,560);S.iqRegion=iqRegion(l,-.5,1,true,0);for(const [v,label,dy] of [[-1,'−1',-65],[-.5,['−',F(1,2)],100],[0,'0',-65],[1,'1',-65]])iqPoint(l,v,label,0,dy,38);},{ask:done=>quiz({x:1080,y:180,w:460,cls:'side'},[{id:'c-membership',prompt:['Does each value satisfy ',$m('x ≥ −',F(1,2)),'?'],build:grid([{parts:['−1'],ans:['n'],why:'−1 < −1/2: excluded.'},{parts:['−',F(1,2)],ans:['y'],why:'The ≥ boundary is included.'},{parts:['0'],ans:['y'],why:'0 > −1/2: included.'},{parts:['1'],ans:['y'],why:'1 > −1/2: included.'}],[['y','yes',COL.chalk],['n','no',COL.dim]],{multi:false})}],done)}],+['wrap','Read the symbols with a reason',m=>{const p=panel(0);iqTitle(p,'Inequalities describe order and possibilities');[['Left smaller · right greater · open side faces greater','w1'],['Larger negative magnitude → smaller signed value','w2'],['≠ means different VALUES; 1/2 = 0.5','w3'],['≤ and ≥ include the boundary; shade ALL qualifying values','w4']].forEach(([s,k],i)=>{const g=G(p,{x:-16,y:270+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(k),.6);});}],+['final1','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-comparisons',prompt:'Choose the sign that makes each comparison true.',build:grid([{parts:['−18 ? 6'],ans:['l'],why:'A negative value is less than a positive value.'},{parts:['−11 ? −13'],ans:['g'],why:'−11 is farther right than −13.'},{parts:['0 ? −0.2'],ans:['g'],why:'Zero is greater than any negative number.'},{parts:['0.046 ? 0.047'],ans:['l'],why:'The thousandths decide: 6<7.'},{parts:[F(3,7),' ? ',F(5,7)],ans:['l'],why:'Three equal-sized sevenths are less than five.'},{parts:['−',F(5,6),' ? −',F(4,5)],ans:['l'],why:'−5/6=−25/30<−24/30=−4/5.'}],iqOrderCols,{multi:false})}],done,'Chapter practice 1 of 3')}],+['final2','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-symbols',prompt:'Is each mathematical sentence true or false?',build:grid([{parts:['4 ≠ −4'],ans:['t'],why:'These have different signed values.'},{parts:[F(1,2),' ≠ 0.5'],ans:['f'],why:'1/2 and0.5 are the same value.'},{parts:['−2 ≤ −2'],ans:['t'],why:'Less than OR equal to includes equality.'},{parts:['−',F(3,4),' ≥ −',F(1,2)],ans:['f'],why:'−3/4 lies left of−1/2, so it is smaller.'}],iqTruthCols,{multi:false})}],done,'Chapter practice 2 of 3')}],+['final3','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-distinct-sets',prompt:'Give three DISTINCT values in each row. Integers, decimals, and fractions all work.',build:iqTriplets([{parts:['y ≤ −2: '],answers:['-2','-3','-4'],bound:[-2,1],dir:-1,hint:'Every value must be≤−2, and the three VALUES must differ. Equivalent forms count as the same value.',why:'Example only:−2,−3,−4. Any three distinct values at most−2 work.'},{parts:['Rejected by m ≥ 0: '],answers:['-1','-2','-3'],bound:[0,1],dir:1,hint:'Each rejected value must be strictly negative. Zero (including−0) qualifies for m≥0, so it cannot be listed. Use three distinct values.',why:'Example only:−1,−2,−3. Any three distinct negative values are rejected by m≥0.'}])},{id:'p-warmer',prompt:'Which temperature is warmer: −6°C or −10°C?',build:choice(['−6°C','−10°C'],0,'−6°C is warmer because−6>−10; it is closer to zero on the negative side.',['','A larger negative magnitude is farther left and colder.'])}],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 8336663..8557dea 100644--- a/site/math-notebook/index.html+++ b/site/math-notebook/index.html@@ -229,7 +229,7 @@ main#contents { padding-bottom: 80px; }'use strict';// 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]]],+ ['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]]],];const HUES = ['#f4a48c', '#86c9e8', '#f3c95c', '#e8a0c8', '#8fd6b0', '#bba8ee', '#f0b45a'];const id = n => 'ch' + String(n).padStart(2, '0');