An AI skill that turns books into animated, narrated, interactive web experiences
JavaScript ai-agentsai-educationanimationclaudeclaude-codeclaude-skillsedtecheducationinteractive-textbookscormtext-to-video
feat(math): add fraction operations chapter
yzrc2f50931857b
diff --git a/site/index.html b/site/index.htmlindex 48a2e29..10212a6 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, 6 narrated chapters">- <span class="book-caption"><strong>Elementary Mathematics <span aria-hidden="true">↗</span></strong><small>6 narrated chapters</small></span>+ <a class="book-hotspot math-book" data-book="math-notebook" href="math-notebook/" aria-label="Open Elementary Mathematics, 7 narrated chapters">+ <span class="book-caption"><strong>Elementary Mathematics <span aria-hidden="true">↗</span></strong><small>7 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 aaa8637..d5b6a37 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: 6 },+ chapterBase: 'math-notebook/', chapters: 7 },];for (const book of books) {const cover = document.querySelector(`[data-book="${book.id}"]`);diff --git a/site/math-notebook/ch06/index.html b/site/math-notebook/ch06/index.htmlindex 6a30ac6..646a43d 100644--- a/site/math-notebook/ch06/index.html+++ b/site/math-notebook/ch06/index.html@@ -8,7 +8,7 @@</head><body><script src="../lib/engine.js"></script><script src="audio/en/timings.js"></script><script>'use strict';-const CHAPTER = { number: 6, title: 'Fraction Basics: Types of Fractions and Adding and Subtracting Fractions', minutes: 13, language: 'en' };+const CHAPTER = { number: 6, title: 'Fraction Basics: Types of Fractions and Adding and Subtracting Fractions', minutes: 13, language: 'en', next: '../ch07/' };const FB_A=COL.whole,FB_B=COL.nat;const fbText=(p,s,x,y,t=0,size=32,col=COL.chalk,anchor='start')=>{const e=T(p,s,{x,y,size,fill:col,anchor,o:0});show(e,t);return e;};const fbMath=(p,s,x,y,t=0,size=48,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;};diff --git a/site/math-notebook/ch07/audio/en/cancel.mp3 b/site/math-notebook/ch07/audio/en/cancel.mp3new file mode 100644index 0000000..8e280b5Binary files /dev/null and b/site/math-notebook/ch07/audio/en/cancel.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/compare.mp3 b/site/math-notebook/ch07/audio/en/compare.mp3new file mode 100644index 0000000..17f4b79Binary files /dev/null and b/site/math-notebook/ch07/audio/en/compare.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/final1.mp3 b/site/math-notebook/ch07/audio/en/final1.mp3new file mode 100644index 0000000..2025e57Binary files /dev/null and b/site/math-notebook/ch07/audio/en/final1.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/final2.mp3 b/site/math-notebook/ch07/audio/en/final2.mp3new file mode 100644index 0000000..64a022fBinary files /dev/null and b/site/math-notebook/ch07/audio/en/final2.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/final3.mp3 b/site/math-notebook/ch07/audio/en/final3.mp3new file mode 100644index 0000000..6d5f0edBinary files /dev/null and b/site/math-notebook/ch07/audio/en/final3.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/final4.mp3 b/site/math-notebook/ch07/audio/en/final4.mp3new file mode 100644index 0000000..8c21957Binary files /dev/null and b/site/math-notebook/ch07/audio/en/final4.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/finish.mp3 b/site/math-notebook/ch07/audio/en/finish.mp3new file mode 100644index 0000000..347c979Binary files /dev/null and b/site/math-notebook/ch07/audio/en/finish.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/groups.mp3 b/site/math-notebook/ch07/audio/en/groups.mp3new file mode 100644index 0000000..ee1aa39Binary files /dev/null and b/site/math-notebook/ch07/audio/en/groups.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/intro.mp3 b/site/math-notebook/ch07/audio/en/intro.mp3new file mode 100644index 0000000..dbedc2fBinary files /dev/null and b/site/math-notebook/ch07/audio/en/intro.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/mixed.mp3 b/site/math-notebook/ch07/audio/en/mixed.mp3new file mode 100644index 0000000..795e83dBinary files /dev/null and b/site/math-notebook/ch07/audio/en/mixed.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/multiply.mp3 b/site/math-notebook/ch07/audio/en/multiply.mp3new file mode 100644index 0000000..826f592Binary files /dev/null and b/site/math-notebook/ch07/audio/en/multiply.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/of.mp3 b/site/math-notebook/ch07/audio/en/of.mp3new file mode 100644index 0000000..4aca493Binary files /dev/null and b/site/math-notebook/ch07/audio/en/of.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/partial.mp3 b/site/math-notebook/ch07/audio/en/partial.mp3new file mode 100644index 0000000..ef433b2Binary files /dev/null and b/site/math-notebook/ch07/audio/en/partial.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/q1.mp3 b/site/math-notebook/ch07/audio/en/q1.mp3new file mode 100644index 0000000..6005b6bBinary files /dev/null and b/site/math-notebook/ch07/audio/en/q1.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/q2.mp3 b/site/math-notebook/ch07/audio/en/q2.mp3new file mode 100644index 0000000..0b6763cBinary files /dev/null and b/site/math-notebook/ch07/audio/en/q2.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/q3.mp3 b/site/math-notebook/ch07/audio/en/q3.mp3new file mode 100644index 0000000..f82305eBinary files /dev/null and b/site/math-notebook/ch07/audio/en/q3.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/reciprocal.mp3 b/site/math-notebook/ch07/audio/en/reciprocal.mp3new file mode 100644index 0000000..39365beBinary files /dev/null and b/site/math-notebook/ch07/audio/en/reciprocal.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/rule.mp3 b/site/math-notebook/ch07/audio/en/rule.mp3new file mode 100644index 0000000..c78b938Binary files /dev/null and b/site/math-notebook/ch07/audio/en/rule.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/scale.mp3 b/site/math-notebook/ch07/audio/en/scale.mp3new file mode 100644index 0000000..c0bc841Binary files /dev/null and b/site/math-notebook/ch07/audio/en/scale.mp3 differdiff --git a/site/math-notebook/ch07/audio/en/timings.js b/site/math-notebook/ch07/audio/en/timings.jsnew file mode 100644index 0000000..cd9fe73--- /dev/null+++ b/site/math-notebook/ch07/audio/en/timings.js@@ -0,0 +1,709 @@+window.TIMINGS = {+ "intro": {+ "dur": 12.96,+ "marks": {+ "sub": 3.932+ },+ "cues": [+ [+ 0.104,+ "Chapter seven."+ ],+ [+ 1.328,+ "Multiplying and dividing fractions."+ ],+ [+ 3.932,+ "A fraction can name part of an amount, or the size of a group."+ ],+ [+ 7.565,+ "We will let the pictures explain both operations, so the rules have a reason behind them."+ ]+ ]+ },+ "of": {+ "dur": 37.296,+ "marks": {+ "blue": 5.352,+ "split": 11.237,+ "take": 17.826,+ "count": 26.497,+ "result": 31.628+ },+ "cues": [+ [+ 0.104,+ "What is two thirds of three fourths?"+ ],+ [+ 2.474,+ "The whole outlined rectangle is one unit."+ ],+ [+ 5.352,+ "First, fill three of its four equal columns blue."+ ],+ [+ 9.232,+ "That is three fourths of the whole."+ ],+ [+ 11.237,+ "Now divide the height into three equal rows."+ ],+ [+ 14.766,+ "Each row contains one third of the blue amount."+ ],+ [+ 17.826,+ "Take two of those three rows."+ ],+ [+ 19.935,+ "The moving outline selects two thirds of the blue area, not two thirds of the entire rectangle."+ ],+ [+ 26.497,+ "There are six selected little cells out of twelve equal cells in the whole."+ ],+ [+ 31.628,+ "Six twelfths is one half."+ ],+ [+ 33.711,+ "So two thirds times three fourths equals one half."+ ]+ ]+ },+ "multiply": {+ "dur": 42.048,+ "marks": {+ "vertical": 4.44,+ "horizontal": 9.883,+ "cells": 18.151,+ "rule": 26.51+ },+ "cues": [+ [+ 0.117,+ "Here is a new product: three fifths times two sevenths."+ ],+ [+ 4.44,+ "Five equal columns set the first piece size."+ ],+ [+ 7.708,+ "Select three columns."+ ],+ [+ 9.883,+ "Seven equal rows split each column into seven smaller pieces."+ ],+ [+ 15.456,+ "Select two rows of the colored amount."+ ],+ [+ 18.151,+ "The whole has five times seven, or thirty-five equal cells."+ ],+ [+ 22.5,+ "The overlap has three times two, or six cells."+ ],+ [+ 26.51,+ "That explains the multiplication rule: multiply the numerators to count selected cells, and multiply the denominators to count equal cells in one whole."+ ],+ [+ 36.758,+ "Matching denominators are not needed."+ ],+ [+ 39.062,+ "We are subdividing the pieces, not adding them."+ ]+ ]+ },+ "q1": {+ "dur": 5.4,+ "marks": {},+ "cues": [+ [+ 0.091,+ "Quick check."+ ],+ [+ 1.094,+ "Choose the picture for two thirds of three fourths of one whole."+ ]+ ]+ },+ "scale": {+ "dur": 38.016,+ "marks": {+ "split": 7.943,+ "take": 12.969,+ "result": 17.747,+ "smaller": 21.224+ },+ "cues": [+ [+ 0.104,+ "A smoothie recipe uses three fourths cup of yogurt."+ ],+ [+ 3.828,+ "Make half the recipe."+ ],+ [+ 5.391,+ "The strip outline represents one cup."+ ],+ [+ 7.943,+ "Split each quarter in half."+ ],+ [+ 9.974,+ "Now the three filled quarters are six eighths."+ ],+ [+ 12.969,+ "Move half of those six pieces into the result strip: three eighths cup."+ ],+ [+ 17.747,+ "One half times three fourths equals three eighths."+ ],+ [+ 21.224,+ "Multiplying a positive amount by a fraction between zero and one makes it smaller."+ ],+ [+ 26.992,+ "Multiplying by one keeps it unchanged."+ ],+ [+ 30.195,+ "Multiplying by a number greater than one makes it larger."+ ],+ [+ 33.919,+ "Multiplication does not always mean a larger answer."+ ]+ ]+ },+ "cancel": {+ "dur": 46.272,+ "marks": {+ "combine": 3.125,+ "five": 13.425,+ "three": 19.479,+ "result": 25.208,+ "why": 31.029+ },+ "cues": [+ [+ 0.104,+ "Multiply five sixths by nine tenths."+ ],+ [+ 3.125,+ "If we combine first, the numerator is five times nine, and the denominator is six times ten."+ ],+ [+ 10.208,+ "The fraction is forty-five sixtieths."+ ],+ [+ 13.425,+ "Five is a factor on top and bottom."+ ],+ [+ 15.911,+ "Divide both by five, leaving one and two."+ ],+ [+ 19.479,+ "Three is also a common factor: nine becomes three, and six becomes two."+ ],+ [+ 25.208,+ "The smaller numbers give one times three over two times two, or three fourths."+ ],+ [+ 31.029,+ "This is cross-canceling."+ ],+ [+ 32.826,+ "It works because we divide the entire numerator and denominator by the same factor."+ ],+ [+ 38.203,+ "Only cancel a numerator factor with a denominator factor."+ ],+ [+ 42.266,+ "The amount stays the same; the arithmetic gets smaller."+ ]+ ]+ },+ "q2": {+ "dur": 6.504,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Quick check."+ ],+ [+ 1.159,+ "Choose a numerator and denominator pair that can be reduced before multiplying."+ ]+ ]+ },+ "groups": {+ "dur": 42.0,+ "marks": {+ "units": 10.508,+ "group": 18.555,+ "move": 24.57,+ "count": 31.562+ },+ "cues": [+ [+ 0.104,+ "Division asks how many groups of a given size fit into an amount."+ ],+ [+ 5.117,+ "We have one and one half meters of ribbon."+ ],+ [+ 7.8,+ "Each piece should be three fourths meter long."+ ],+ [+ 10.508,+ "Two identical outlines show the unit size of one meter."+ ],+ [+ 14.505,+ "The six filled quarter pieces are one and one half meters."+ ],+ [+ 18.555,+ "A group needs three quarters, because each finished piece is three fourths meter."+ ],+ [+ 24.57,+ "Slide three quarters into the first group and three into the second."+ ],+ [+ 29.036,+ "No ribbon is created or lost."+ ],+ [+ 31.562,+ "Two groups fit."+ ],+ [+ 32.76,+ "One and one half divided by three fourths equals two."+ ],+ [+ 36.667,+ "The answer counts pieces; the divisor names the length of each piece."+ ]+ ]+ },+ "partial": {+ "dur": 34.512,+ "marks": {+ "quarters": 5.156,+ "groups": 7.435,+ "move": 10.286,+ "partial": 14.596,+ "answer": 25.924+ },+ "cues": [+ [+ 0.091,+ "What if there is a partial group?"+ ],+ [+ 1.667,+ "Divide one and one fourth liters by one half liter."+ ],+ [+ 5.156,+ "We have five quarter-liter pieces."+ ],+ [+ 7.435,+ "Each half-liter group needs two quarters."+ ],+ [+ 10.286,+ "Move two pieces into the first group, then two into the second."+ ],+ [+ 14.596,+ "One quarter-liter remains."+ ],+ [+ 16.823,+ "Compare it with a full half-liter group: it fills one of the two equal slots."+ ],+ [+ 21.992,+ "That is half of a group, even though it is one fourth of a liter."+ ],+ [+ 25.924,+ "The quotient is two and one half groups."+ ],+ [+ 28.841,+ "Always measure the partial group against the divisor, not against the original unit whole."+ ]+ ]+ },+ "q3": {+ "dur": 5.424,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Quick check."+ ],+ [+ 1.081,+ "Which grouping picture matches one and one half divided by one half?"+ ]+ ]+ },+ "reciprocal": {+ "dur": 45.72,+ "marks": {+ "divisor": 7.708,+ "stretch": 14.948,+ "first": 25.312,+ "quotient": 32.747+ },+ "cues": [+ [+ 0.104,+ "Why does division turn into multiplication by a reciprocal?"+ ],+ [+ 4.076,+ "Consider two thirds divided by four fifths."+ ],+ [+ 7.708,+ "The divisor is four fifths of a unit."+ ],+ [+ 10.43,+ "We want that group size to become one, so groups are easy to count."+ ],+ [+ 14.948,+ "Stretch every length by five fourths."+ ],+ [+ 18.49,+ "Four fifths times five fourths becomes one."+ ],+ [+ 21.393,+ "The divisor strip now exactly matches a whole unit."+ ],+ [+ 25.312,+ "Apply the same stretch to the first amount too."+ ],+ [+ 28.307,+ "Two thirds times five fourths is ten twelfths, or five sixths."+ ],+ [+ 32.747,+ "Because both lengths changed by the same scale, the number of divisor-sized groups has not changed."+ ],+ [+ 39.375,+ "Five sixths of the new unit means five sixths of a group."+ ],+ [+ 42.982,+ "This gives the quotient five sixths."+ ]+ ]+ },+ "rule": {+ "dur": 42.36,+ "marks": {+ "one": 3.464,+ "flip": 9.518,+ "multiply": 16.289,+ "zero": 30.872+ },+ "cues": [+ [+ 0.104,+ "A reciprocal is a number that makes a product of one."+ ],+ [+ 3.464,+ "Four fifths and five fourths are reciprocals, because their product is twenty twentieths."+ ],+ [+ 9.518,+ "To divide by a nonzero fraction, keep the first amount and replace the second fraction with its reciprocal."+ ],+ [+ 16.289,+ "Then multiply."+ ],+ [+ 17.578,+ "Two thirds divided by four fifths becomes two thirds times five fourths, which is five sixths."+ ],+ [+ 23.893,+ "For a whole number such as four, write four over one first; its reciprocal is one fourth."+ ],+ [+ 30.872,+ "Zero has no reciprocal."+ ],+ [+ 32.93,+ "No number times zero equals one, and division by zero is undefined."+ ],+ [+ 38.633,+ "The rule applies only when the divisor is nonzero."+ ]+ ]+ },+ "mixed": {+ "dur": 41.352,+ "marks": {+ "convert": 6.068,+ "reciprocal": 19.961,+ "cancel": 26.25,+ "answer": 29.31+ },+ "cues": [+ [+ 0.091,+ "Mixed numbers need one more step."+ ],+ [+ 2.734,+ "Divide one and one half by one and one eighth."+ ],+ [+ 6.068,+ "Convert both to improper fractions first."+ ],+ [+ 9.062,+ "One and one half is three halves."+ ],+ [+ 11.758,+ "One and one eighth is nine eighths."+ ],+ [+ 14.714,+ "Keep the amounts intact: a mixed number is a whole part plus a fractional part."+ ],+ [+ 19.961,+ "Now multiply three halves by eight ninths, the reciprocal of the second fraction."+ ],+ [+ 26.25,+ "Cancel two with eight, and three with nine."+ ],+ [+ 29.31,+ "We get four thirds, which is one and one third."+ ],+ [+ 32.708,+ "The same conversion comes first when multiplying mixed numbers."+ ],+ [+ 36.914,+ "Never multiply just the fractional parts and forget the wholes."+ ]+ ]+ },+ "compare": {+ "dur": 33.624,+ "marks": {+ "first": 1.81,+ "second": 5.091,+ "size": 12.357+ },+ "cues": [+ [+ 0.104,+ "Keep track of the operation."+ ],+ [+ 1.81,+ "In division, the first amount stays as it is."+ ],+ [+ 5.091,+ "Only the second fraction becomes its reciprocal."+ ],+ [+ 8.815,+ "Flipping both fractions answers a different question."+ ],+ [+ 12.357,+ "Here, multiplying three fourths by one half gives three eighths: half of the amount."+ ],+ [+ 18.177,+ "Dividing three fourths by one half gives one and one half: how many half-sized groups fit."+ ],+ [+ 24.635,+ "A divisor smaller than one can make the quotient larger than the original number."+ ],+ [+ 30.0,+ "Decide what the question means before choosing the rule."+ ]+ ]+ },+ "wrap": {+ "dur": 26.472,+ "marks": {+ "w1": 1.784,+ "w2": 8.307,+ "w3": 13.281,+ "w4": 18.958+ },+ "cues": [+ [+ 0.169,+ "Four ideas to keep."+ ],+ [+ 1.784,+ "Multiplication finds a fraction of an amount: multiply top by top and bottom by bottom."+ ],+ [+ 8.307,+ "Cross-cancel numerator and denominator factors without changing the value."+ ],+ [+ 13.281,+ "Division counts groups."+ ],+ [+ 15.104,+ "Multiply by the reciprocal of the nonzero divisor."+ ],+ [+ 18.958,+ "Convert mixed numbers to improper fractions first, then simplify the answer."+ ],+ [+ 24.258,+ "Now try the chapter practice."+ ]+ ]+ },+ "final1": {+ "dur": 4.68,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Chapter practice, one of four."+ ],+ [+ 2.409,+ "Multiply and simplify."+ ]+ ]+ },+ "final2": {+ "dur": 4.584,+ "marks": {},+ "cues": [+ [+ 0.091,+ "Chapter practice, two of four."+ ],+ [+ 2.227,+ "Find the reciprocal, then divide."+ ]+ ]+ },+ "final3": {+ "dur": 5.568,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Chapter practice, three of four."+ ],+ [+ 2.617,+ "Convert mixed numbers before calculating."+ ]+ ]+ },+ "final4": {+ "dur": 5.976,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Chapter practice, four of four."+ ],+ [+ 2.409,+ "Use the meaning of the operation in each situation."+ ]+ ]+ },+ "finish": {+ "dur": 9.528,+ "marks": {},+ "cues": [+ [+ 0.104,+ "Chapter complete."+ ],+ [+ 1.38,+ "You used area to explain multiplication and groups to explain division."+ ],+ [+ 6.341,+ "Those pictures give the fraction rules their meaning."+ ]+ ]+ }+};diff --git a/site/math-notebook/ch07/audio/en/wrap.mp3 b/site/math-notebook/ch07/audio/en/wrap.mp3new file mode 100644index 0000000..b09b68dBinary files /dev/null and b/site/math-notebook/ch07/audio/en/wrap.mp3 differdiff --git a/site/math-notebook/ch07/index.html b/site/math-notebook/ch07/index.htmlnew file mode 100644index 0000000..30564cc--- /dev/null+++ b/site/math-notebook/ch07/index.html@@ -0,0 +1,69 @@+<!doctype html>+<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">+<title>Multiplying and Dividing Fractions — Elementary Mathematics</title>+<link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render">+<style>.screen .blanks .line{gap:14px}.screen input.box{min-width:110px}</style></head><body>+<script src="../lib/engine.js"></script><script src="audio/en/timings.js"></script><script>+'use strict';+const CHAPTER={number:7,title:'Multiplying and Dividing Fractions',minutes:12,language:'en'};+const FM_A=COL.whole,FM_B=COL.nat;+const fmText=(p,s,x,y,t=0,size=32,col=COL.chalk,anchor='start')=>{const e=T(p,s,{x,y,size,fill:col,anchor,o:0});show(e,t);return e;};+const fmMath=(p,s,x,y,t=0,size=48,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;};+function fmTitle(p,s,sub=''){fmText(p,s,100,118,.1,43);if(sub)fmText(p,sub,100,173,.2,27,COL.dim);}+// Each outlined unit has exact width w; the cells do not change their unit size when moved.+function fmBar(p,x,y,w,d,n,col=FM_A,t=.2,h=80){const g=G(p,{x,y,o:0}),cells=[];mk('rect',{width:w,height:h,fill:COL.faint,'fill-opacity':.15},g);for(let i=0;i<n;i++){const e=G(g,{x:i*w/d});mk('rect',{width:w/d,height:h,fill:col,'fill-opacity':.65},e);cells.push(e);}for(let i=1;i<d;i++)path(g,`M${i*w/d} 0V${h}`,{stroke:COL.chalk,'stroke-width':2});mk('rect',{width:w,height:h,fill:'none',stroke:COL.chalk,'stroke-width':3},g);show(g,t);return {g,cells,w,d,h};}+function fmPieces(p,n,d,x,y,w,col,t=.2,h=80){return Array.from({length:n},(_,i)=>{const e=G(p,{x:x+i*w/d,y,o:0});mk('rect',{width:w/d,height:h,fill:col,'fill-opacity':.7,stroke:COL.chalk,'stroke-width':2},e);show(e,t+i*.035);return e;});}+// One rectangle = ONE whole; overlap cell area is exactly 1/(columns*rows).+function fmArea(p,{x=220,y=265,w=620,h=360,cols=4,rows=3,a=3,b=2,t=.2,vertical=t,horizontal=t,select=t}={}){+ const g=G(p,{x,y,o:0});mk('rect',{width:w,height:h,fill:COL.faint,'fill-opacity':.12},g);+ const blue=mk('rect',{width:w*a/cols,height:h,fill:FM_A,'fill-opacity':.48},g);+ const picked=G(g,{o:0});mk('rect',{width:w*a/cols,height:h*b/rows,fill:COL.task,'fill-opacity':.85},picked);+ const vs=[],hs=[];for(let i=1;i<cols;i++)vs.push(path(g,`M${i*w/cols} 0V${h}`,{stroke:COL.chalk,'stroke-width':2},{o:0}));for(let i=1;i<rows;i++)hs.push(path(g,`M0 ${i*h/rows}H${w}`,{stroke:COL.chalk,'stroke-width':2},{o:0}));+ mk('rect',{width:w,height:h,fill:'none',stroke:COL.chalk,'stroke-width':3},g);show(g,t);vs.forEach(e=>show(e,vertical));hs.forEach(e=>show(e,horizontal));show(picked,select+1.4,.6);+ const selector=G(g,{y:h-h*b/rows,o:0});mk('rect',{width:w*a/cols,height:h*b/rows,fill:'none',stroke:FM_B,'stroke-width':5,'stroke-dasharray':'12 8'},selector);show(selector,select,.2);tw(selector,{y:0},select+.2,1.2,io);return {g,blue,picked,selector,vs,hs};+}+function fmPair(p,a,b,x,y,label,t=.2){const g=G(p,{o:0});mk('rect',{x,y,width:330,height:145,rx:18,fill:COL.board,stroke:COL.dim,'stroke-width':2},g);T(g,label,{x:x+165,y:y+38,size:27,anchor:'middle',fill:COL.dim});M(g,[a,' ↔ ',b],{x:x+165,y:y+103,size:48,anchor:'middle'});show(g,t);return {el:g,box:[x,y,330,145],label:label};}+function fmGrouping(p,n,per,m,{x=350,y=290,w=260,d=4,gy=550,gxs=[310,770,1190],h=85}={}){+ for(let i=0;i<Math.ceil(n/d);i++)fmBar(p,x+i*w,y,w,d,0,FM_A,.2,h);const es=fmPieces(p,n,d,x,y,w,FM_A,.3,h);+ fmText(p,'1 unit',x+w/2,y-25,.2,28,COL.dim,'middle');if(n>d)fmText(p,'1 unit',x+w*1.5,y-25,.2,28,COL.dim,'middle');+ for(let j=0;j<Math.ceil(n/per);j++){const gx=gxs[j];const g=G(p,{o:0});for(let i=0;i<per;i++)mk('rect',{x:gx+i*w/d,y:gy,width:w/d,height:h,fill:'none',stroke:FM_B,'stroke-width':3},g);show(g,m.group);fmText(p,`group ${j+1}`,gx+per*w/d/2,gy+h+48,m.group,28,FM_B,'middle');}+ es.forEach((e,i)=>tw(e,{x:gxs[Math.floor(i/per)]+(i%per)*w/d,y:gy},m.move+Math.floor(i/per)*.6,1.3,io));return es;+}+const BEATS=[+['intro','Multiply and divide',(m,D)=>{const g=G(scene,{o:0,y:24});T(g,'Unit 1 · The Number System · Chapter 7',{x:800,y:250,size:28,fill:COL.dim,anchor:'middle'});T(g,'Multiplying and',{x:800,y:365,size:82,weight:600,anchor:'middle'});T(g,'Dividing Fractions',{x:800,y:465,size:82,weight:600,anchor:'middle'});tw(g,{o:1,y:0},.2,1,out);fmBar(g,580,520,440,4,3,FM_A,.5,80);const s=fmText(scene,'Part of an amount · Number of groups',800,735,m('sub'),34,COL.dim,'middle');hide(g,D-.8,.7);hide(s,D-.8,.7);}],+['of','A fraction of a fraction',m=>{const p=panel(0);fmTitle(p,'Two thirds OF three fourths','One outlined rectangle = one whole unit');const a=fmArea(p,{t:.2,vertical:m('blue'),horizontal:m('split'),select:m('take')});put(a.blue,{o:0});show(a.blue,m('blue'));fmMath(p,[F('3','4'),' of the whole'],1170,315,m('blue'),45,FM_A);fmText(p,'Take 2 of the 3 rows',1030,425,m('take'),32,FM_B);fmText(p,'inside the blue amount',1030,468,m('take'),28,COL.dim);fmText(p,'6 selected / 12 in ONE whole',1040,570,m('count'),29,COL.task);fmMath(p,[F('2','3'),' × ',F('3','4'),' = ',F('6','12'),' = ',F('1','2')],800,745,m('result'),61);}],+['multiply','Why top × top, bottom × bottom',m=>{const p=panel(0);fmTitle(p,'Three fifths × two sevenths','Different denominators work: split in both directions.');const a=fmArea(p,{cols:5,rows:7,a:3,b:2,vertical:m('vertical'),horizontal:m('horizontal'),select:m('cells')});put(a.blue,{o:0});show(a.blue,m('vertical'));fmText(p,'5 columns × 7 rows',1030,315,m('horizontal'),35,COL.dim);fmText(p,'35 equal cells in ONE whole',1030,365,m('cells'),28,COL.dim);fmText(p,'3 columns × 2 rows',1030,495,m('cells'),35,COL.task);fmText(p,'6 selected cells',1030,545,m('cells',1),29,COL.task);fmMath(p,[F('3','5'),' × ',F('2','7'),' = ',F('3 × 2','5 × 7'),' = ',F('6','35')],800,755,m('rule'),56);fmText(p,'Multiplication subdivides; addition combines same-size pieces.',800,835,m('rule',4),28,COL.dim,'middle');}],+['q1','Quick check',()=>{const p=panel(0);fmTitle(p,'Choose the result: two thirds of three fourths','Each outlined rectangle = one whole.');S.fmAreas=[3,6,8].map((n,i)=>{const x=150+i*480,g=G(p);fmBar(g,x,310,360,12,n,COL.task,.2,145);fmMath(g,[F(String(n),'12')],x+180,550,.2,52);return {el:g,box:[x-10,290,380,290],label:`${n} twelfths`};});},{ask:done=>quiz(BAND,[{id:'c-area',prompt:'Which area has TWO of THREE rows of the three-fourths amount?',build:pickEls(S.fmAreas,1,'Six twelfths equals one half: two selected rows each have three twelfth-sized cells.',i=>i===0?'Three twelfths is only one of the three rows of three fourths.':'Eight twelfths is two thirds of the entire whole. Take two thirds of the blue three-fourths amount.',()=>pulseFx(S.fmAreas[1].el,1.06))}],done)}],+['scale','Half a recipe',m=>{const p=panel(0);fmTitle(p,'Half of a recipe using ¾ cup of yogurt','Each outline = ONE cup');const a=fmBar(p,250,290,800,4,3,FM_A,.2,110);for(let i=1;i<8;i+=2)draw(path(a.g,`M${i*100} 0V110`,{stroke:COL.task,'stroke-width':2,'stroke-dasharray':'6 5'},{d:0}),m('split'),.7);fmBar(p,250,535,800,8,0,FM_A,.2,110);a.cells.forEach(e=>hide(e,m('take'),.1));const es=fmPieces(p,6,8,250,290,800,FM_A,m('take'),110);es.slice(0,3).forEach((e,i)=>tw(e,{x:250+i*100,y:535},m('take',.3)+i*.15,1.2));const before=fmText(p,'original recipe',1190,355,.2,30,FM_A,'middle');hide(before,m('take'),.3);fmText(p,'other half stays here',1210,355,m('take',1.5),30,FM_A,'middle');fmText(p,'half recipe',1190,600,m('take'),30,COL.task,'middle');fmMath(p,[F('1','2'),' × ',F('3','4'),' = ',F('3','8')],800,750,m('result'),62);fmText(p,'A multiplier between 0 and 1 shrinks a positive amount.',800,832,m('smaller'),30,COL.dim,'middle');}],+['cancel','Cross-cancel factors',m=>{const p=panel(0);fmTitle(p,'Five sixths × nine tenths','Cancel a TOP factor with a BOTTOM factor.');fmMath(p,[F('5','6'),' × ',F('9','10')],300,380,.2,70);fmMath(p,[F('5 × 9','6 × 10')],800,375,m('combine'),83);fmMath(p,[F('45','60')],1290,375,m('combine'),75);const diag1=path(p,'M709 330L891 414',{stroke:COL.task,'stroke-width':4},{d:0});draw(diag1,m('five'),.6);fmText(p,'5 → 1',665,235,m('five'),30,COL.task);fmText(p,'10 → 2',900,485,m('five'),30,COL.task);draw(path(p,'M890 330L710 414',{stroke:COL.task,'stroke-width':4},{d:0}),m('three'),.6);fmText(p,'9 → 3',900,235,m('three'),30,COL.task);fmText(p,'6 → 2',655,485,m('three'),30,COL.task);fmMath(p,[F('1 × 3','2 × 2'),' = ',F('3','4')],800,660,m('result'),68);fmText(p,'Divide the total numerator AND denominator by the same factor.',800,790,m('why'),31,COL.dim,'middle');}],+['q2','Quick check',()=>{const p=panel(0);fmTitle(p,'Which pair can cross-cancel?','A common factor must appear on TOP and BOTTOM.');fmMath(p,[F('4','9'),' × ',F('3','8')],800,285,.2,65);S.fmPairs=[fmPair(p,'4','3',160,410,'A · two numerators'),fmPair(p,'9','8',635,410,'B · two denominators'),fmPair(p,'3','9',1110,410,'C · top and bottom')];},{ask:done=>quiz(BAND,[{id:'c-cancel',prompt:'Choose a pair with a common factor that preserves the product when reduced.',build:pickEls(S.fmPairs,2,'3 on top and 9 on bottom share factor 3. Divide both by 3; 4 and 8 can also reduce by 4.',i=>i===0?'Both are numerators. Canceling them would change the product, and 4 and 3 have no common factor above 1.':'Both are denominators. Cross-cancel requires a numerator and denominator.',()=>pulseFx(S.fmPairs[2].el,1.04))}],done)}],+['groups','Division counts groups',m=>{const p=panel(0);fmTitle(p,'1½ meters ÷ ¾ meter per piece','Blue = available ribbon · Coral outline = size of each group');fmGrouping(p,6,3,{group:m('group'),move:m('move')});fmMath(p,['1 ',F('1','2'),' ÷ ',F('3','4'),' = 2'],1100,320,m('count'),57);fmText(p,'six quarter-meter pieces',1090,235,m('units'),31,FM_A,'middle');fmText(p,'2 groups · each group is ¾ meter',800,780,m('count'),37,COL.task,'middle');}],+['partial','A fraction of a group',m=>{const p=panel(0);fmTitle(p,'1¼ liters ÷ ½ liter per group','Keep the quarter-liter pieces the same size when moving.');fmGrouping(p,5,2,{group:m('groups'),move:m('move')},{gxs:[260,665,1070]});fmText(p,'five quarter-liter pieces',1090,235,m('quarters'),30,FM_A,'middle');fmText(p,'½ of a GROUP',1135,725,m('partial'),34,COL.task,'middle');fmText(p,'¼ liter ÷ ½ liter = ½ group',800,790,m('partial',2),33,COL.dim,'middle');fmMath(p,['1 ',F('1','4'),' ÷ ',F('1','2'),' = 2 ',F('1','2')],1120,320,m('answer'),52);}],+['q3','Quick check',()=>{const p=panel(0);fmTitle(p,'Choose the groups for 1½ ÷ ½','Each column contains the same total amount: 1½ units.');S.fmGroups=[{n:2,d:4,k:3,label:'A · 2 groups of ¾'},{n:3,d:2,k:1,label:'B · 3 groups of ½'},{n:6,d:4,k:1,label:'C · 6 groups of ¼'}].map((v,j)=>{const x=200+j*480,g=G(p),w=360;for(let i=0;i<v.n;i++){const y=265+i*52;mk('rect',{x,y,width:w*v.k/v.d,height:40,fill:FM_A,'fill-opacity':.65,stroke:FM_B,'stroke-width':3},g);}fmText(g,v.label,x,610,.2,30,COL.chalk);return {el:g,box:[x-15,250,390,390],label:v.label};});},{ask:done=>quiz(BAND,[{id:'c-groups',prompt:'The divisor is ONE HALF. Which picture uses half-sized groups?',build:pickEls(S.fmGroups,1,'Three half-sized groups fit into one and one half. The quotient is 3.',i=>i===0?'A uses three-fourths-sized groups. Match the group size to the divisor, one half.':'C uses quarter-sized groups. Two of those quarters make one half-sized group.',()=>pulseFx(S.fmGroups[1].el,1.05))}],done)}],+['reciprocal','Make the group size ONE',m=>{const p=panel(0);fmTitle(p,'Two thirds ÷ four fifths','Scale BOTH lengths by the same factor: group count stays the same.');const x=200,w=600;function row(y,n,d,col){const g=G(p,{x,y});mk('rect',{width:w,height:90,fill:'none',stroke:COL.dim,'stroke-width':2,'stroke-dasharray':'7 6'},g);const r=mk('rect',{width:w*n/d,height:90,fill:col,'fill-opacity':.65,stroke:col,'stroke-width':3},g);return r;}const a=row(310,4,5,FM_B),b=row(535,2,3,FM_A);fmText(p,'before: divisor 4/5',1090,370,m('divisor'),37,FM_B);fmText(p,'before: amount 2/3',1090,595,.2,37,FM_A);fmText(p,'× 5/4',500,250,m('stretch'),40,COL.task,'middle');tw(a,{a_width:600},m('stretch'),2,io);fmMath(p,[F('4','5'),' × ',F('5','4'),' = 1'],1115,450,m('stretch',2),44,FM_B);tw(b,{a_width:500},m('first'),2,io);fmMath(p,[F('2','3'),' × ',F('5','4'),' = ',F('5','6')],1115,680,m('first',2),44,FM_A);fmText(p,'new unit = ONE divisor-sized group',500,720,m('quotient'),28,COL.dim,'middle');fmMath(p,[F('2','3'),' ÷ ',F('4','5'),' = ',F('5','6'),' of a group'],800,820,m('quotient',1),48,COL.task);}],+['rule','Reciprocal means product ONE',m=>{const p=panel(0);fmTitle(p,'Keep · Multiply · Reciprocal','The divisor must be nonzero.');fmMath(p,[F('4','5'),' × ',F('5','4'),' = ',F('20','20'),' = 1'],800,300,m('one'),64);fmMath(p,[F('2','3'),' ÷ ',F('4','5')],490,500,.2,75);fmText(p,'keep',380,595,m('flip'),32,FM_A);fmText(p,'flip second',570,595,m('flip'),32,FM_B);fmMath(p,['= ',F('2','3'),' × ',F('5','4'),' = ',F('5','6')],1120,500,m('multiply'),62);fmText(p,'4 = 4/1 → reciprocal 1/4',800,720,m('multiply',5),34,COL.dim,'middle');fmText(p,'Zero has no reciprocal. Division by zero is undefined.',800,815,m('zero'),33,COL.task,'middle');}],+['mixed','Convert mixed numbers FIRST',m=>{const p=panel(0);fmTitle(p,'One and one half ÷ one and one eighth');fmMath(p,['1 ',F('1','2'),' ÷ 1 ',F('1','8')],800,270,.2,70);fmMath(p,['= ',F('3','2'),' ÷ ',F('9','8')],800,420,m('convert'),65);fmMath(p,['= ',F('3','2'),' × ',F('8','9')],800,555,m('reciprocal'),65);fmText(p,'2 with 8 → 1 with 4 · 3 with 9 → 1 with 3',800,655,m('cancel'),30,COL.task,'middle');fmMath(p,['= ',F('1 × 4','1 × 3'),' = ',F('4','3'),' = 1 ',F('1','3')],800,770,m('answer'),60);fmText(p,'A mixed number means whole part PLUS fractional part.',800,850,m('answer',5),28,COL.dim,'middle');}],+['compare','The operation changes the question',m=>{const p=panel(0);fmTitle(p,'Keep the first fraction. Flip the second for division.');fmMath(p,[F('3','4'),' ÷ ',F('1','2')],400,330,.2,65);fmMath(p,['= ',F('3','4'),' × ',F('2','1')],1110,330,m('second'),65);fmText(p,'first amount stays',330,430,m('first'),32,FM_A);fmText(p,'second becomes reciprocal',950,430,m('second'),32,FM_B);fmMath(p,[F('3','4'),' × ',F('1','2'),' = ',F('3','8')],430,610,m('size'),58);fmText(p,'half OF the amount',430,705,m('size'),31,FM_B,'middle');fmMath(p,[F('3','4'),' ÷ ',F('1','2'),' = 1 ',F('1','2')],1140,610,m('size',3),58);fmText(p,'number OF half-sized groups',1140,705,m('size',3),31,FM_B,'middle');fmText(p,'First decide: part of an amount, or number of groups?',800,835,m('size',7),32,COL.task,'middle');}],+['wrap','Summary',m=>{const p=panel(0);[['Multiply top × top and bottom × bottom.','w1'],['Cross-cancel TOP and BOTTOM factors.','w2'],['Divide: multiply by the NONZERO divisor’s reciprocal.','w3'],['Mixed → improper first. Simplify at the end.','w4']].forEach(([s,k],i)=>{const g=G(p,{x:-16,y:260+i*140,o:0});mk('circle',{cx:155,cy:-12,r:26,fill:COL.task},g);T(g,String(i+1),{x:155,y:-1,size:30,fill:COL.board,anchor:'middle',weight:700});T(g,s,{x:215,size:35,weight:600});tw(g,{x:0,o:1},m(k),.6);});}],+['final1','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-multiply',prompt:'Multiply. Give answers in lowest terms; equivalent mixed numbers are accepted.',build:blanks([+{parts:[F('2','5'),' × ',F('3','7'),' = ',{box:'6/35',lowest:true}],why:'Two times three is six; five times seven is thirty-five. No common factor remains.'},+{parts:[F('7','12'),' × ',F('6','7'),' = ',{box:'1/2',lowest:true}],why:'Cancel the sevens, and reduce six with twelve. The product is one half.'},+{parts:[F('3','8'),' × 4 = ',{box:'3/2',lowest:true}],why:'Write four as four over one. Twelve eighths simplifies to three halves, or one and one half.'}+])}],done,'Chapter practice 1 of 4')}],+['final2','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-divide',prompt:'The divisors are nonzero. Use their reciprocals; simplify.',build:blanks([+{parts:['Reciprocal of ',F('7','9'),': ',{box:'9/7',lowest:true}],why:'Seven ninths times nine sevenths is one.'},+{parts:[F('5','6'),' ÷ ',F('2','3'),' = ',{box:'5/4',lowest:true}],why:'Five sixths times three halves is fifteen twelfths, or five fourths.'},+{parts:[F('3','5'),' ÷ 4 = ',{box:'3/20',lowest:true}],why:'The reciprocal of four is one fourth. Three fifths times one fourth is three twentieths.'}+])}],done,'Chapter practice 2 of 4')}],+['final3','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-mixed',prompt:'Convert mixed numbers to improper fractions first. Give a simplified fraction or mixed number.',build:blanks([+{parts:['1 ',F('2','3'),' × 2 ',F('1','4'),' = ',{box:'15/4',lowest:true}],why:'Five thirds times nine fourths is forty-five twelfths, or fifteen fourths (three and three fourths).'},+{parts:['2 ',F('2','5'),' ÷ 1 ',F('1','2'),' = ',{box:'8/5',lowest:true}],why:'Twelve fifths times two thirds is twenty-four fifteenths, or eight fifths (one and three fifths).'}+])}],done,'Chapter practice 3 of 4')}],+['final4','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[+{id:'p-lengths',prompt:['A ',$m('2 ',F('3','4')),' meter ribbon is measured in ',$m(F('3','4')),' meter lengths. How many lengths is it, including a partial length?'],build:blanks([{parts:[{box:'11/3',lowest:true},' lengths'],why:'Eleven fourths divided by three fourths is eleven thirds. That is three complete lengths plus two thirds of another length.'}])},+{id:'p-sharing',prompt:['Five friends share ',$m(F('5','6')),' kilogram of trail mix equally. How much does each friend receive?'],build:blanks([{parts:[{box:'1/6',lowest:true},' kilogram each'],why:'Five sixths divided by five is five sixths times one fifth, which equals one sixth kilogram.'}])}+],done,'Chapter practice 4 of 4')}],+['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 b70a22a..1a0e4fa 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]]],+ ['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]]],];const HUES = ['#f4a48c', '#86c9e8', '#f3c95c', '#e8a0c8', '#8fd6b0', '#bba8ee', '#f0b45a'];const id = n => 'ch' + String(n).padStart(2, '0');