Skip to content

An AI skill that turns books into animated, narrated, interactive web experiences

feat(linear-algebra): split chapter 14; chapter 15, More Numbers Than Axes, closes Unit 1

yzr8882ac299e80
diff --git a/site/linear-algebra/ch14/audio/en/final3.mp3 b/site/linear-algebra/ch14/audio/en/final3.mp3
deleted file mode 100644
index f2c453f..0000000
Binary files a/site/linear-algebra/ch14/audio/en/final3.mp3 and /dev/null differ
diff --git a/site/linear-algebra/ch14/audio/en/final4.mp3 b/site/linear-algebra/ch14/audio/en/final4.mp3
index ca444be..3951df0 100644
Binary files a/site/linear-algebra/ch14/audio/en/final4.mp3 and b/site/linear-algebra/ch14/audio/en/final4.mp3 differ
diff --git a/site/linear-algebra/ch14/audio/en/finish.mp3 b/site/linear-algebra/ch14/audio/en/finish.mp3
index 6cd0ad9..5148d64 100644
Binary files a/site/linear-algebra/ch14/audio/en/finish.mp3 and b/site/linear-algebra/ch14/audio/en/finish.mp3 differ
diff --git a/site/linear-algebra/ch14/audio/en/intro.mp3 b/site/linear-algebra/ch14/audio/en/intro.mp3
index 00cecdf..96180e8 100644
Binary files a/site/linear-algebra/ch14/audio/en/intro.mp3 and b/site/linear-algebra/ch14/audio/en/intro.mp3 differ
diff --git a/site/linear-algebra/ch14/audio/en/timings.js b/site/linear-algebra/ch14/audio/en/timings.js
index c551d2e..93fee28 100644
--- a/site/linear-algebra/ch14/audio/en/timings.js
+++ b/site/linear-algebra/ch14/audio/en/timings.js
@@ -1,9 +1,9 @@
window.TIMINGS = {
"intro": {
- "dur": 14.592,
+ "dur": 12.936,
"marks": {
- "sub": 3.307,
- "move": 8.06
+ "sub": 3.425,
+ "move": 6.068
},
"cues": [
[
@@ -11,15 +11,15 @@ window.TIMINGS = {
"Chapter fourteen."
],
[
- 1.458,
+ 1.523,
"Can we solve for every b?"
],
[
- 3.307,
- "This is the big question of lecture one, and the last chapter of unit one."
+ 3.425,
+ "This is the big question of lecture one."
],
[
- 8.06,
+ 6.068,
"We keep the columns, move the target b anywhere we like, and ask: is there always a mix that reaches it?"
]
]
@@ -461,332 +461,14 @@ window.TIMINGS = {
]
]
},
- "bars": {
- "dur": 35.496,
- "marks": {
- "two": 1.849,
- "bars": 5.586,
- "drag": 12.734,
- "follow": 13.997,
- "three": 18.424,
- "four": 23.346,
- "no": 27.969,
- "fourb": 31.849
- },
- "cues": [
- [
- 0.104,
- "What about four numbers?"
- ],
- [
- 1.849,
- "Here's b in the plane: two numbers, and an arrow."
- ],
- [
- 5.586,
- "Now draw each number as a bar instead: up for positive, down for negative, as long as the number is big."
- ],
- [
- 12.734,
- "Move the arrow, and the bars move with it."
- ],
- [
- 15.755,
- "Same two numbers, two pictures."
- ],
- [
- 18.424,
- "In space, three numbers: three axes, or three bars."
- ],
- [
- 23.346,
- "Four numbers would need a fourth axis, at right angles to all three."
- ],
- [
- 27.969,
- "Our space has no room for it, so we can't draw that arrow."
- ],
- [
- 31.849,
- "But the bars don't mind."
- ],
- [
- 33.372,
- "Four numbers: four bars."
- ]
- ]
- },
- "four": {
- "dur": 47.616,
- "marks": {
- "names": 4.167,
- "e1": 11.328,
- "e2": 13.021,
- "e3": 16.068,
- "e4": 19.206,
- "cols": 22.331,
- "c1": 24.648,
- "asbars": 28.854,
- "call": 30.339,
- "b": 32.435,
- "mix": 36.055,
- "ax": 39.935
- },
- "cues": [
- [
- 0.117,
- "Here's a system with four equations and four unknowns."
- ],
- [
- 4.167,
- "We've run out of letters, so we number the unknowns: x one, x two, x three, x four."
- ],
- [
- 11.328,
- "x one equals one."
- ],
- [
- 13.021,
- "x one plus x two equals three."
- ],
- [
- 16.068,
- "x two plus x three equals four."
- ],
- [
- 19.206,
- "And x three plus x four equals two."
- ],
- [
- 22.331,
- "Read down the columns, as always."
- ],
- [
- 24.648,
- "Column one is one, one, zero, zero, drawn as bars."
- ],
- [
- 30.339,
- "And the other three columns."
- ],
- [
- 32.435,
- "On the right, b: one, three, four, two."
- ],
- [
- 36.055,
- "In front of each column, its amount: x one to x four."
- ],
- [
- 39.935,
- "The bars in the middle are A x, the mix of the columns."
- ],
- [
- 43.971,
- "The dashed outlines are b's bars: the targets."
- ]
- ]
- },
- "match": {
- "dur": 51.168,
- "marks": {
- "zero": 1.419,
- "x1": 6.68,
- "x1b": 8.294,
- "top": 12.8,
- "x2": 14.544,
- "x2v": 18.411,
- "x2b": 20.065,
- "two": 24.219,
- "x3": 25.664,
- "x3v": 28.464,
- "x3b": 30.273,
- "x4": 33.112,
- "all": 38.594,
- "row": 44.505
- },
- "cues": [
- [
- 0.104,
- "Let's find the mix."
- ],
- [
- 1.419,
- "With every amount zero, A x is all zeros: no bars."
- ],
- [
- 6.68,
- "Turn x one up to one."
- ],
- [
- 8.294,
- "Column one adds one to the top row and one to the second row."
- ],
- [
- 12.8,
- "The top bar matches b."
- ],
- [
- 14.544,
- "The second row needs three and has one."
- ],
- [
- 17.461,
- "Two more: so x two is two."
- ],
- [
- 20.065,
- "Column two adds two to rows two and three."
- ],
- [
- 24.219,
- "Row two matches."
- ],
- [
- 25.664,
- "Row three needs four and has two: so x three is two."
- ],
- [
- 30.273,
- "Now rows three and four both match."
- ],
- [
- 33.112,
- "Row four needs two, and already has two, so x four stays zero."
- ],
- [
- 38.594,
- "Every bar matches."
- ],
- [
- 40.104,
- "A x equals b, with the mix one, two, two, zero."
- ],
- [
- 44.505,
- "And reading across a row gives back its equation: row two says one plus two is three."
- ]
- ]
- },
- "q4": {
- "dur": 5.352,
- "marks": {},
- "cues": [
- [
- 0.104,
- "Your turn."
- ],
- [
- 0.99,
- "Change the amounts until every bar of A x matches b."
- ]
- ]
- },
- "nine": {
- "dur": 33.0,
- "marks": {
- "nine": 1.576,
- "same": 5.898,
- "move": 10.404,
- "match": 13.242,
- "cant": 15.404,
- "q": 21.693,
- "yes": 26.12
- },
- "cues": [
- [
- 0.104,
- "And nine equations?"
- ],
- [
- 1.576,
- "Nine unknowns, nine columns, nine numbers in each."
- ],
- [
- 5.898,
- "The same rules: each amount times its column, added row by row."
- ],
- [
- 10.404,
- "Change the amounts, and the bars move, until every row matches."
- ],
- [
- 15.404,
- "We cannot draw nine axes."
- ],
- [
- 17.721,
- "But we can still compute, and still see the numbers move."
- ],
- [
- 21.693,
- "And the big question is the same: do the columns reach every b?"
- ],
- [
- 26.12,
- "Yes, when each column points in a truly new direction, one that no mix of the others can make."
- ]
- ]
- },
- "unit": {
- "dur": 44.28,
- "marks": {
- "sys": 1.849,
- "row": 3.19,
- "col": 10.599,
- "ax": 17.669,
- "big": 21.302,
- "yes": 24.427,
- "no": 29.805,
- "next": 38.698
- },
- "cues": [
- [
- 0.104,
- "That closes unit one."
- ],
- [
- 1.849,
- "One system, and the row picture: each equation is a line, or in space a plane, and the solution is where they all meet."
- ],
- [
- 10.599,
- "The column picture: each column is an arrow, and the solution is the mix of the columns that lands on b."
- ],
- [
- 17.669,
- "And one short name for both: A x equals b."
- ],
- [
- 21.302,
- "The big question: can we solve it for every b?"
- ],
- [
- 24.427,
- "Yes, when the columns point in different directions and fill the whole space."
- ],
- [
- 29.805,
- "No, when they lie flat, on a line or in a plane."
- ],
- [
- 33.776,
- "Then some b are out of reach, and the others have endlessly many mixes."
- ],
- [
- 38.698,
- "In unit two, we learn how to find the mix for any system, step by step."
- ]
- ]
- },
"wrap": {
- "dur": 31.296,
+ "dur": 31.224,
"marks": {
- "w1": 0.99,
- "w2": 9.31,
- "w3": 16.094,
- "w4": 22.786,
- "end": 29.102
+ "w1": 1.016,
+ "w2": 9.206,
+ "w3": 15.898,
+ "w4": 22.656,
+ "end": 29.062
},
"cues": [
[
@@ -794,35 +476,35 @@ window.TIMINGS = {
"To sum up."
],
[
- 0.99,
+ 1.016,
"Can we solve A x equals b for every b?"
],
[
- 5.143,
+ 5.221,
"Ask whether the mixes of the columns fill the whole space."
],
[
- 9.31,
+ 9.206,
"Two columns that point different ways fill the plane."
],
[
- 12.682,
+ 12.63,
"Two along one line fill only that line."
],
[
- 16.094,
+ 15.898,
"Three columns not in one plane fill space."
],
[
- 19.635,
+ 19.388,
"Three in one plane fill only that plane."
],
[
- 22.786,
- "With more numbers we can't draw the axes, but the rules are the same, and the bars show the numbers move."
+ 22.656,
+ "And when the columns lie flat, some b have no mix at all, and the others have endlessly many."
],
[
- 29.102,
+ 29.062,
"Now try the chapter practice."
]
]
@@ -851,18 +533,8 @@ window.TIMINGS = {
]
]
},
- "final3": {
- "dur": 2.832,
- "marks": {},
- "cues": [
- [
- 0.091,
- "Work out these mixes, number by number."
- ]
- ]
- },
"final4": {
- "dur": 5.424,
+ "dur": 6.048,
"marks": {},
"cues": [
[
@@ -870,8 +542,8 @@ window.TIMINGS = {
"Last set."
],
[
- 1.237,
- "Move b, or the amounts, until A x equals b."
+ 1.159,
+ "Move b, or a column, until the picture does what the question asks."
]
]
},
@@ -900,7 +572,7 @@ window.TIMINGS = {
]
},
"finish": {
- "dur": 13.104,
+ "dur": 10.416,
"marks": {},
"cues": [
[
@@ -908,12 +580,12 @@ window.TIMINGS = {
"Well done."
],
[
- 1.12,
- "That's the end of chapter fourteen, can we solve for every b, and the end of unit one."
+ 1.133,
+ "That's the end of chapter fourteen, can we solve for every b."
],
[
- 7.201,
- "Next: elimination, a way to find the mix for any system, step by step."
+ 5.586,
+ "Next: more numbers than axes, where b has four numbers, or nine."
]
]
}
diff --git a/site/linear-algebra/ch14/audio/en/wrap.mp3 b/site/linear-algebra/ch14/audio/en/wrap.mp3
index 6b503a1..d889753 100644
Binary files a/site/linear-algebra/ch14/audio/en/wrap.mp3 and b/site/linear-algebra/ch14/audio/en/wrap.mp3 differ
diff --git a/site/linear-algebra/ch14/index.html b/site/linear-algebra/ch14/index.html
index 4d16e5d..0a20c3a 100644
--- a/site/linear-algebra/ch14/index.html
+++ b/site/linear-algebra/ch14/index.html
@@ -12,12 +12,11 @@
<script src="../lib/math.js"></script>
<script src="../lib/linsys.js"></script>
<script src="../lib/space3.js"></script>
-<script src="../lib/bars.js"></script>
<script src="../lib/play.js"></script>
<script src="audio/en/timings.js"></script>
<script>
'use strict';
-const CHAPTER = { number: 14, title: 'Can We Solve for Every b?', minutes: 14, language: 'en' };
+const CHAPTER = { number: 14, title: 'Can We Solve for Every b?', minutes: 10, language: 'en' , next: '../ch15/' };
/* ---------- the systems of this chapter ---------- */
const LA = [[2, -1], [-1, 2]]; // the lecture's 2 × 2: columns (2, −1), (−1, 2)
@@ -26,9 +25,6 @@ const LEC3 = [[2, -1, 0], [-1, 2, -1], [0, -3, 4]]; // the lecture's 3 × 3
const FLAT3 = [[2, -1, 1], [-1, 2, 1], [0, -3, -3]]; // column 3 = column 1 + column 2 = (1, 1, −3)
const N3 = [1, 2, 1]; // col 1 × col 2 / 3: the sheet of col 1, col 2 is x + 2y + z = 0
const VIEW = { yaw: 50, pitch: 20 }; // chapter 13's view: the lecture columns land far apart
-const BID = [[1, 0, 0, 0], [1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]; // x₁ = …, x₁ + x₂ = …, x₂ + x₃ = …, x₃ + x₄ = …
-const AXC = [COL.whole, COL.nat, COL.int]; // steps along x, y, z (chapter 11's walk)
-const SUB = BR_SUB;
/* ---------- chapter drawing helpers ---------- */
const CARD = { x: 40, y: 600, w: 720, cls: 'side' }; // under the column form, beside the plane
@@ -174,23 +170,6 @@ const sys3 = (p, A, b, { t0 = .1, mixAt } = {}) => {
return sys;
};
-/* ---------- bars: row labels beside a vector of bars ---------- */
-const rowNames = (p, bs, names, x, t0, colors = []) => names.map((n, i) => say(p, [n], x, bs.zeroY(i) + 12, t0 + i * .15, { size: 34, fill: colors[i] || COL.dim, anchor: 'end' }));
-// The equations of the 4 × 4 system written above the bars: each term over its own column of bars.
-const eqsAbove = (p, bs, A, b, y0, t0, { gap = 42, size = 32 } = {}) => A.map((row, i) => {
- const g = G(p, { o: 0 }), y = y0 + i * gap;
- row.forEach((a, j) => {
- const x = bs.cols[j].bx, zero = a === 0;
- if (j) T(g, '+', { x: st(bs.plusSigns[j - 1]).x, y, size, fill: COL.chalk, font: MATH, anchor: 'middle', o: zero ? .3 : 1 });
- M(g, [(zero ? '0' : a === 1 ? '' : num(a)) + 'x' + SUB[j + 1]], { x, y, size, fill: COL.chalk, anchor: 'middle', o: zero ? .3 : 1 });
- });
- T(g, '=', { x: st(bs.eqs[0]).x, y, size, fill: COL.chalk, font: MATH, anchor: 'middle' });
- T(g, num(b[i]), { x: bs.b.bx, y, size, fill: COL.task, font: MATH, anchor: 'middle' });
- show(g, t0[i] ?? t0);
- return g;
-});
-const barsFlash = (bs, keys, t0) => flash(keys.flatMap(k => bs.num(k)), t0);
-
/* ---------- practice data ---------- */
const FILLQ = [
{ parts: [$m('[1, 0]'), ' and ', $m('[0, 1]')], ans: ['y'], why: 'Right and up: different directions. x·[1, 0] + y·[0, 1] = [x, y] is every point.' },
@@ -223,15 +202,6 @@ const REACH3Q = [
{ parts: ['sheet columns, b = ', $m('(0, −1, 4)')], ans: ['n'], why: '0 − 2 + 4 = 2, not 0: off the sheet.' },
{ parts: ['sheet columns, b = ', $m('(1, 1, 1)')], ans: ['n'], why: '1 + 2 + 1 = 4, not 0.' },
];
-const COMBQ = [
- { parts: ['2·(1, 0, 3, −1) + (0, 2, −1, 4) = (', { box: '2' }, ', ', { box: '2' }, ', ', { box: '5' }, ', ', { box: '2' }, ')'], why: '(2, 0, 6, −2) + (0, 2, −1, 4) = (2, 2, 5, 2).', hint: 'Double the first: (2, 0, 6, −2). Then add number by number.' },
- { parts: ['3·(1, −1, 0, 2) − (2, 0, 1, 1) = (', { box: '1' }, ', ', { box: '-3' }, ', ', { box: '-1' }, ', ', { box: '5' }, ')'], why: '(3, −3, 0, 6) − (2, 0, 1, 1) = (1, −3, −1, 5).', hint: 'Triple the first: (3, −3, 0, 6). Then take away (2, 0, 1, 1).' },
- { parts: ['−(1, 2, 3, 4) + (4, 3, 2, 1) = (', { box: '3' }, ', ', { box: '1' }, ', ', { box: '-1' }, ', ', { box: '-3' }, ')'], why: '(−1, −2, −3, −4) + (4, 3, 2, 1) = (3, 1, −1, −3).', hint: 'The minus flips every sign: (−1, −2, −3, −4).' },
-];
-const MIX4Q = [
- { parts: ['b = (2, 5, 4, 1): x₁, x₂, x₃, x₄ = ', { box: '2' }, ', ', { box: '3' }, ', ', { box: '1' }, ', ', { box: '0' }], why: 'x₁ = 2; 2 + x₂ = 5, x₂ = 3; 3 + x₃ = 4, x₃ = 1; 1 + x₄ = 1, x₄ = 0.', hint: 'Go from the top: x₁ is the first number of b. Then x₁ + x₂ must be the second.' },
- { parts: ['b = (−1, 0, 2, 2): x₁, x₂, x₃, x₄ = ', { box: '-1' }, ', ', { box: '1' }, ', ', { box: '1' }, ', ', { box: '1' }], why: 'x₁ = −1; −1 + x₂ = 0, x₂ = 1; 1 + x₃ = 2, x₃ = 1; 1 + x₄ = 2, x₄ = 1.', hint: 'x₁ = −1. Then −1 + x₂ = 0.' },
-];
const YN = [['y', 'Yes', COL.good, 'Y'], ['n', 'No', COL.bad, 'N']];
/* ---------- beats: [id, title, run(m, D), { ask }?] ---------- */
@@ -388,7 +358,7 @@ const BEATS = [
});
hide(S.rule, .1, .3);
sys.view('row', m('rowp')); hide(lat.g, m('rowp'), .4); hide(trips, m('rowp'), .4);
- const sameT = text(p, 'the same line: every point on it solves both', 760, 860, m('same'), { size: 26, fill: COL.task, weight: 600, anchor: 'middle' });
+ const sameT = text(p, 'the same line: every point on it solves both', 90, 830, m('same'), { size: 28, fill: COL.task, weight: 600 });
hide(onT, m('sum') - .3, .3);
const sum = G(p, { o: 0 });
T(sum, 'columns on one line:', { x: 90, y: 790, size: 28, fill: COL.dim });
@@ -505,7 +475,7 @@ const BEATS = [
text(p, 'Your turn', 60, 110, .2, { size: 40, weight: 600 });
const sys = S.sys = lin3(p, { A: FLAT3, b: [2, -1, 0], eq: [90, 180], size: 44, mat: null, mix: [90, 450], view: 'col', sol: false, space: { ...VIEW } });
sys.labels(['col 1', 'col 2', 'col 3', 'A x']);
- sys.set({ x0: 1, x1: 0, x2: 0 });
+ sys.set({ x0: 0, x1: 0, x2: 0 }); // A x starts at zero, not on top of a column
sheet(sys.space, 0);
ring3(sys.space, [3, 0, -3], '(3, 0, −3)');
}, { ask: done => quiz({ x: 40, y: 615, w: 720, cls: 'side' }, [{
@@ -516,176 +486,12 @@ const BEATS = [
() => S.sys.set({ x0: 2, x1: 1, x2: 0 }), ['x0', 'x1', 'x2']),
}], done) }],
- ['bars', 'Numbers as bars', (m) => {
- const p = panel(0);
- text(p, 'More numbers than axes', 60, 110, .2, { size: 40, weight: 600 });
- // 2D: b as an arrow (with its x and y steps) and as two bars, one state
- const g2 = G(p, {}), P2 = plane(g2, { cx: 1160, cy: 450, u: 52, t0: m('two') - .3 });
- const bs2 = bars(g2, { b: [3, 2], x0: 330, top: 250, band: 170, unit: 18, bw: 60, size: 40, t0: m('bars') });
- rowNames(g2, bs2, ['x', 'y'], 300, m('bars') + .3, AXC);
- const legX = path(g2, '', { stroke: AXC[0], 'stroke-width': 4, 'stroke-dasharray': '8 7', fill: 'none' });
- const legY = path(g2, '', { stroke: AXC[1], 'stroke-width': 4, 'stroke-dasharray': '8 7', fill: 'none' });
- const arr = path(g2, '', { stroke: COL.task, fill: COL.task, 'stroke-width': 6, 'stroke-linejoin': 'round' });
- const tipT = T(g2, 'b', { size: 30, fill: COL.task, font: MATH, weight: 600 });
- tipT.setAttribute('font-style', 'italic');
- const hand2 = G(g2, { o: 0 });
- path(hand2, 'M0 0L0 30L8 23L14 36L20 33L14 21L24 21Z', { fill: COL.chalk, stroke: COL.board, 'stroke-width': 2.5 });
- const draw2 = v => {
- const X = P2.PX(v.b0), Y = P2.PY(v.b1), O = [P2.PX(0), P2.PY(0)], L = Math.hypot(X - O[0], Y - O[1]) || 1, ux = (X - O[0]) / L, uy = (Y - O[1]) / L;
- legX.setAttribute('d', `M${O[0]} ${O[1]}H${X.toFixed(1)}`); legY.setAttribute('d', `M${X.toFixed(1)} ${O[1]}V${Y.toFixed(1)}`);
- arr.setAttribute('d', L < 2 ? '' : `M${O[0]} ${O[1]}L${(X - ux * 11).toFixed(1)} ${(Y - uy * 11).toFixed(1)}M${(X - 18 * ux - 9 * uy).toFixed(1)} ${(Y - 18 * uy + 9 * ux).toFixed(1)}L${X.toFixed(1)} ${Y.toFixed(1)}L${(X - 18 * ux + 9 * uy).toFixed(1)} ${(Y - 18 * uy - 9 * ux).toFixed(1)}Z`);
- put(tipT, { x: X + ux * 22 - 8, y: Y + uy * 22 + 10 }); put(hand2, { x: X + 6, y: Y + 6 });
- };
- bs2.onChange(draw2); draw2(bs2.v);
- [legX, legY, arr, tipT].forEach(e => { put(e, { o: 0 }); show(e, m('two') + .2, .5); });
- show(hand2, m('drag'), .3); hide(hand2, m('three') - .6, .3);
- bs2.to({ b0: -2 }, m('bars') + 2.6, 1); bs2.to({ b0: 3 }, m('bars') + 4.6, 1);
- bs2.to({ b0: -2, b1: 4 }, m('drag') + .2, 1.3); bs2.to({ b0: 4, b1: -3 }, m('follow') + 1, 1.3); bs2.to({ b0: 3, b1: 2 }, m('follow') + 2.6, 1.1);
- barsFlash(bs2, ['b0', 'b1'], m('follow'));
- hide(g2, m('three') - .4, .4);
- // 3D: three numbers, three steps, three bars
- const g3 = G(p, { o: 0 });
- show(g3, m('three') - .1, .4);
- const V = space3(g3, { ...VIEW, t0: m('three') }), O3 = [0, 0, 0];
- V.sway(5, 14);
- const legs = AXC.map(c => { const l = V.line(null, null, { color: c, w: 4, dash: '8 7' }); return l; });
- const arr3 = V.arrow(O3, [3, 2, 2], { color: COL.task, w: 6 });
- const bs3 = bars(g3, { b: [3, 2, 2], x0: 330, top: 230, band: 140, unit: 15, bw: 60, size: 40, t0: m('three') + .3 });
- rowNames(g3, bs3, ['x', 'y', 'z'], 300, m('three') + .5, AXC);
- const draw3 = v => { const b = [v.b0, v.b1, v.b2]; legs[0].set(O3, [b[0], 0, 0]); legs[1].set([b[0], 0, 0], [b[0], b[1], 0]); legs[2].set([b[0], b[1], 0], b); arr3.set(O3, b); };
- bs3.onChange(draw3); draw3(bs3.v);
- bs3.to({ b0: -2, b1: 1, b2: 3 }, m('three') + 1.8, 1.4);
- // a fourth axis has nowhere to go
- const ax4 = V.line([0, 0, 0], [3, -3, 3], { color: COL.chalk, w: 3, dash: '6 8' }); // (−3, −3, 3.5) lay over the z axis in this view
- put(ax4.e, { o: 0 }); show(ax4.e, m('four') + .3, .4);
- const q4 = text(g3, '4th axis?', 1420, 290, m('four') + .6, { size: 30, fill: COL.chalk, anchor: 'middle', weight: 600 });
- const no = text(g3, 'no room: every direction here is already a mix of x, y and z', 1150, 860, m('no'), { size: 26, fill: COL.bad, anchor: 'middle', weight: 600 });
- hide(g3, m('fourb') - .4, .4);
- // four numbers: four bars
- const g4 = G(p, { o: 0 });
- show(g4, m('fourb'), .3);
- const bs4 = bars(g4, { b: [3, -1, 2, 0], x0: 720, top: 220, band: 130, unit: 14, bw: 60, size: 40, t0: m('fourb') });
- rowNames(g4, bs4, ['1st', '2nd', '3rd', '4th'], 690, m('fourb') + .2);
- bs4.to({ b0: 1, b1: 2, b2: -2, b3: 3 }, m('fourb') + 1.4, 1.2);
- S.keep = [q4, no];
- }],
-
- ['four', 'Four equations, four unknowns', (m) => {
- const p = S.p = panel(0);
- text(p, 'Four equations, four unknowns', 60, 110, .2, { size: 40, weight: 600 });
- const bs = S.bs = bars(p, { A: BID, b: [1, 3, 4, 2], x0: 110, top: 360, band: 100, unit: 10, bw: 30, size: 30, t0: .1 });
- // the parts appear on their words
- [...bs.cols.map(c => c.g), ...bs.mixG, ...bs.plusSigns, bs.eqSign, bs.ax.g, ...bs.eqs, bs.b.g, bs.zeros].forEach(e => put(e, { o: 0 }));
- [1, 2, 3, 4].forEach(j => hide(say(p, ['x' + SUB[j]], 500 + j * 120, 250, m('names') + .6 + j * .9, { size: 56, anchor: 'middle', fill: BR_COLS[j - 1] }), m('e1') - .3, .3));
- eqsAbove(p, bs, BID, [1, 3, 4, 2], 175, ['e1', 'e2', 'e3', 'e4'].map(k => m(k)));
- show(bs.zeros, m('cols'), .5);
- box(p, bs.cols[0].bx - 52, 140, 104, 170, LS_COLS[0], m('c1'), m('call') + 1);
- show(bs.cols[0].g, m('asbars'), .6);
- [1, 2, 3].forEach(j => { show(bs.cols[j].g, m('call') + (j - 1) * .5, .5); show(bs.plusSigns[j - 1], m('call') + (j - 1) * .5, .4); });
- box(p, bs.b.bx - 48, 140, 96, 170, COL.task, m('b'), m('b') + 2.5);
- show(bs.b.g, m('b') + .3, .5);
- bs.mixG.forEach((g, j) => show(g, m('mix') + j * .3, .4));
- show(bs.eqSign, m('ax'), .4); show(bs.ax.g, m('ax'), .6); bs.eqs.forEach((e, i) => show(e, m('ax') + 2 + i * .2, .3));
- flash(bs.b.rows.map(r => r.s.t), m('ax') + 3.2);
- }],
-
- ['match', 'Matching b, row by row', (m) => {
- const p = S.p, bs = S.bs;
- [['x1', 'x0', 1, 'x1b', ['a00', 'a10']], ['x2v', 'x1', 2, 'x2b', ['a11', 'a21']], ['x3v', 'x2', 2, 'x3b', ['a22', 'a32']]].forEach(([k, key, val, kb, cells]) => {
- bs.to({ [key]: val }, m(k), 1);
- barsFlash(bs, [key], m(k));
- barsFlash(bs, cells, m(kb));
- });
- const glow = (rows, t, color = COL.task, dur = 1.6) => rows.forEach(i => {
- const r = mk('rect', { x: 96, y: bs.zeroY(i) - 35, width: 1430, height: 70, rx: 10, fill: color, 'fill-opacity': .1, stroke: color, 'stroke-opacity': .5, 'stroke-width': 2 }, p);
- put(r, { o: 0 }); show(r, t, .3); hide(r, t + dur, .4);
- });
- glow([0, 1, 2, 3], m('zero') + .4, COL.chalk, 2.4);
- glow([0, 1], m('x1b')); glow([1], m('x2'), COL.nat, 2.6); glow([1, 2], m('x2b')); glow([2], m('x3'), COL.int, 2.4); glow([2, 3], m('x3b'));
- glow([3], m('x4'), COL.chalk, 3); glow([0, 1, 2, 3], m('all'), COL.good, 3);
- pulse(bs.eqs[0], m('top'), 1.6);
- pulse(bs.eqs[1], m('two'), 1.6);
- pulse(bs.eqs[2], m('x3b') + .6, 1.6); pulse(bs.eqs[3], m('x3b') + 1.2, 1.6);
- barsFlash(bs, ['x3'], m('x4') + 2);
- const all = G(p, { o: 0 });
- M(all, ['A x = b, mix (1, 2, 2, 0)'], { x: 800, y: 858, size: 38, fill: COL.good, anchor: 'middle' });
- show(all, m('all'), .5); hide(all, m('row') - .3, .3);
- const zy = bs.zeroY(1);
- box(p, 96, zy - 35, 1430, 70, COL.nat, m('row'));
- box(p, 96, 175 + 42 - 34, 1430, 46, COL.nat, m('row'));
- say(p, ['row 2: x₁ + x₂ = 1 + 2 = 3'], 800, 858, m('row') + .5, { size: 34, fill: COL.nat, anchor: 'middle' });
- }],
-
- ['q4', 'Your turn', () => {
- const p = panel(0);
- text(p, 'Your turn', 60, 110, .2, { size: 40, weight: 600 });
- S.sys = bars(p, { A: BID, b: [2, 1, 2, 4], x0: 110, top: 175, band: 90, unit: 9, bw: 30, size: 30 }); // the column names clear the card
- }, { ask: done => quiz(BAND, [{
- id: 'c-bars', prompt: ['Change the amounts ', $m('x₁'), ' to ', $m('x₄'), ' until every bar of ', $m('A x'), ' matches ', $m('b'), '.'],
- build: barsTask(S.sys, (v, ax, ok) => ok, 'x₁ = 2, x₂ = −1, x₃ = 3, x₄ = 1: (2, 2 − 1, −1 + 3, 3 + 1) = (2, 1, 2, 4).',
- (v, ax) => { // aimed at the first row that does not match yet
- const b = [2, 1, 2, 4], i = ax.findIndex((t, k) => Math.abs(t - b[k]) > 1e-9);
- if (i <= 0) return 'Go row by row from the top. Row 1 is x₁ alone: it must be 2.';
- const have = v[`x${i - 1}`], need = b[i] - have;
- return `${i > 1 ? `Rows 1 to ${i} match` : 'Row 1 matches'}. Row ${i + 1} is x${SUB[i]} + x${SUB[i + 1]} = ${num(b[i])}, and x${SUB[i]} is ${num(have)}: so x${SUB[i + 1]} = ${num(b[i])} − ${num(have) === num(Math.abs(have)) ? num(have) : '(' + num(have) + ')'} = ${num(need)}.`;
- },
- () => S.sys.set({ x0: 2, x1: -1, x2: 3, x3: 1 }), { only: ['x0', 'x1', 'x2', 'x3'] }),
- }], done) }],
-
- ['nine', 'Nine equations', (m) => {
- const p = panel(0);
- text(p, 'Nine equations, nine unknowns', 60, 110, .2, { size: 40, weight: 600 });
- const A9 = Array.from({ length: 9 }, (_, i) => Array.from({ length: 9 }, (_, j) => +(j === i || j === i - 1)));
- const x9 = [1, 1, -1, 2, 0, -2, 1, 1, -1], b9 = A9.map(r => r.reduce((s, a, j) => s + a * x9[j], 0));
- const names = Array(9).fill(''); names.push('A x', 'b');
- const bs = bars(p, { A: A9, b: b9, x0: 50, top: 180, band: 62, unit: 11, bw: 22, size: 22, numbers: false, mw: 50, gap: 18, names, t0: m('nine') - .3 });
- put(bs.ax.g, { o: 0 }); bs.eqs.forEach(e => put(e, { o: 0 }));
- show(bs.ax.g, m('same'), .5); bs.eqs.forEach(e => show(e, m('same') + .3, .3));
- const span = m('match') - m('move') + 1.2;
- x9.forEach((x, j) => bs.to({ [`x${j}`]: x }, m('move') + j * span / 9, .55));
- const cant = text(p, 'nine axes: we can’t draw them. nine numbers: we can compute, and watch them move.', 800, 855, m('cant'), { size: 28, fill: COL.task, anchor: 'middle', weight: 600 });
- hide(cant, m('q') - .3, .3);
- text(p, 'every b? yes, when each column brings a new direction', 800, 855, m('yes'), { size: 28, fill: COL.good, anchor: 'middle', weight: 600 });
- // keep the bars alive while the voice talks: the amounts step back and land again
- x9.forEach((x, j) => { bs.to({ [`x${j}`]: 0 }, m('cant') + 1.5 + j * .15, .5); bs.to({ [`x${j}`]: x }, m('q') + .4 + j * .35, .6); });
- bs.eqs.forEach((e, i) => pulse(e, m('yes') + .3 + i * .12, 1.5));
- }],
-
- ['unit', 'Unit 1 in one picture', (m) => {
- const p = panel(0);
- text(p, 'Unit 1: one system, three views', 60, 110, .2, { size: 40, weight: 600 });
- const row = linsys(p, { A: LA, b: [0, 3], eq: [610, 200], size: 44, mat: null, sol: false, view: 'row', plane: { cx: 300, cy: 560, u: 24, step: 2 }, t0: m('sys') - .3 });
- const col = linsys(p, { A: LA, b: [0, 3], eq: [610, 200], size: 44, mat: null, sol: false, view: 'col', plane: { cx: 800, cy: 560, u: 24, step: 2 }, t0: m('col') });
- col.E.style.display = 'none';
- put(row.stage, { o: 0 }); show(row.stage, m('row'), .5);
- col.labels(['col 1', 'col 2', 'b']);
- const mat = linsys(p, { A: LA, b: [0, 3], eq: [610, 200], size: 44, mat: [1090, 500], sol: false, hidePlane: true, t0: m('ax') - .4 });
- mat.E.style.display = 'none';
- const head = (s, x, t) => text(p, s, x, 770, t, { size: 28, fill: COL.dim, anchor: 'middle', weight: 600 });
- head('row picture: lines meet', 300, m('row') + .5); head('column picture: a mix makes b', 800, m('col') + .5); head('A x = b', 1330, m('ax'));
- row.lines.forEach((l, i) => thick(l.l, m('row') + 1.5 + i * .8));
- thick(col.combo[0], m('col') + 2.5, 4); thick(col.combo[1], m('col') + 3.3, 4); thick(col.bArrow, m('col') + 4.6, 6);
- // the three views stay one system: column 2 lies down on column 1 in all of them (rows: parallel lines)
- const all3 = (v, t, d) => [row, col, mat].forEach(s => s.to(v, t, d));
- all3({ a01: 4, a11: -2 }, m('no') + .8, 1.6); // they lie flat: b = (0, 3) is out of reach
- thick(col.bArrow, m('no') + 3.2, 6);
- prog(() => col.labels(['', 'col 2', 'b']), m('no') + .8, 0); prog(() => col.labels(['col 1', 'col 2', 'b']), m('next') + 1.2, 0);
- all3({ b0: -4, b1: 2 }, m('no') + 5.6, 1.2); // a b on their line: endlessly many mixes (rows: one line)
- all3({ a01: -1, a11: 2, b0: 0, b1: 3 }, m('next'), 1.2);
- const big = G(p, { o: 0 });
- T(big, 'every b?', { x: 90, y: 830, size: 30, fill: COL.task, weight: 600 });
- show(big, m('big'), .4);
- text(p, 'yes: the columns fill the space', 270, 830, m('yes'), { size: 30, fill: COL.good, weight: 600 });
- text(p, 'no: they lie flat (a line, a plane)', 810, 830, m('no'), { size: 30, fill: COL.bad, weight: 600 });
- text(p, 'next: Unit 2, elimination', 1520, 110, m('next'), { size: 30, fill: COL.task, anchor: 'end', weight: 600 });
- }],
-
['wrap', 'Summary', (m) => {
const p = panel(0);
[['Every b? Ask whether the mixes of the columns fill the whole space.', 'w1'],
['2 columns, different ways: the plane. Along one line: only that line.', 'w2'],
['3 columns not in one plane: all of space. In one plane: only that plane.', 'w3'],
- ['More numbers: no axes to draw, the same rules; bars show the numbers.', 'w4']].forEach(([str, mark], i) => {
+ ['Columns that lie flat: some b have no mix, the others endlessly many.', 'w4']].forEach(([str, mark], i) => {
const g = G(p, { x: -16, y: 230 + i * 130, o: 0 });
mk('circle', { cx: 150, cy: -12, r: 26, fill: COL.task }, g);
T(g, String(i + 1), { x: 150, y: -1, size: 30, fill: COL.board, weight: 700, anchor: 'middle' });
@@ -699,21 +505,14 @@ const BEATS = [
}, {
id: 'p-fill3', prompt: ['Can a mix of these three columns reach every b in space?'],
build: grid(FILL3Q, YN, { multi: false, text: true }),
- }], done, 'Chapter practice · set 1 of 4') }],
+ }], done, 'Chapter practice · set 1 of 3') }],
['final2', 'Chapter practice', () => {}, { ask: done => quiz(SCREEN, [{
id: 'p-reach2', prompt: ['Columns ', $m('(1, −1)'), ' and ', $m('(−3, 3)'), '. Every mix has its bottom equal to minus its top. Can a mix reach b?'],
build: grid(REACH2Q, YN, { multi: false, text: true }),
}, {
id: 'p-reach3', prompt: ['Floor columns: ', $m('(1, 0, 0), (0, 1, 0), (1, 1, 0)'), '. Sheet columns: ', $m('(2, −1, 0), (−1, 2, −3), (1, 1, −3)'), ' (on the sheet, top + 2·middle + bottom = 0). Can a mix reach b?'],
build: grid(REACH3Q, YN, { multi: false, text: true }),
- }], done, 'Chapter practice · set 2 of 4') }],
- ['final3', 'Chapter practice', () => {}, { ask: done => quiz(SCREEN, [{
- id: 'p-comb4', prompt: ['Work out each mix, number by number.'],
- build: blanks(COMBQ),
- }, {
- id: 'p-mix4', prompt: ['With the columns of this chapter, ', $m('A x = (x₁, x₁ + x₂, x₂ + x₃, x₃ + x₄)'), '. Find the mix for each b.'],
- build: blanks(MIX4Q),
- }], done, 'Chapter practice · set 3 of 4') }],
+ }], done, 'Chapter practice · set 2 of 3') }],
['final4', 'Chapter practice', () => {
const p = panel(0);
text(p, 'Move b', 60, 110, .2, { size: 40, weight: 600 });
@@ -729,7 +528,7 @@ const BEATS = [
id: 'p-swing', prompt: ['Now move a column so that every b has a mix, with ', $m('b = (3, 5)'), '.'],
build: (body, api) => { S.sys.set({ b0: 3, b1: 5 }); return lsTask(S.sys, (v, s) => s.x !== undefined, 'The columns now point different ways: the grid fills the plane, and b has exactly one mix.',
'Drag the tip of column 1 or column 2 off the line, so the two point different ways.', () => S.sys.set({ a01: -1, a11: 2 }), { only: ['a00', 'a10', 'a01', 'a11'] })(body, api); },
- }], done, 'Chapter practice · set 4 of 4') }],
+ }], done, 'Chapter practice · set 3 of 3') }],
['play', 'Playground', (m) => {
const p = panel(0);
text(p, 'Playground', 60, 110, .2, { size: 40, weight: 600 });
diff --git a/site/linear-algebra/ch14/audio/en/bars.mp3 b/site/linear-algebra/ch15/audio/en/bars.mp3
similarity index 100%
rename from site/linear-algebra/ch14/audio/en/bars.mp3
rename to site/linear-algebra/ch15/audio/en/bars.mp3
diff --git a/site/linear-algebra/ch15/audio/en/final1.mp3 b/site/linear-algebra/ch15/audio/en/final1.mp3
new file mode 100644
index 0000000..fb2aa9f
Binary files /dev/null and b/site/linear-algebra/ch15/audio/en/final1.mp3 differ
diff --git a/site/linear-algebra/ch15/audio/en/final2.mp3 b/site/linear-algebra/ch15/audio/en/final2.mp3
new file mode 100644
index 0000000..f479646
Binary files /dev/null and b/site/linear-algebra/ch15/audio/en/final2.mp3 differ
diff --git a/site/linear-algebra/ch15/audio/en/final3.mp3 b/site/linear-algebra/ch15/audio/en/final3.mp3
new file mode 100644
index 0000000..669967c
Binary files /dev/null and b/site/linear-algebra/ch15/audio/en/final3.mp3 differ
diff --git a/site/linear-algebra/ch15/audio/en/finish.mp3 b/site/linear-algebra/ch15/audio/en/finish.mp3
new file mode 100644
index 0000000..f90e8bc
Binary files /dev/null and b/site/linear-algebra/ch15/audio/en/finish.mp3 differ
diff --git a/site/linear-algebra/ch14/audio/en/four.mp3 b/site/linear-algebra/ch15/audio/en/four.mp3
similarity index 100%
rename from site/linear-algebra/ch14/audio/en/four.mp3
rename to site/linear-algebra/ch15/audio/en/four.mp3
diff --git a/site/linear-algebra/ch15/audio/en/intro.mp3 b/site/linear-algebra/ch15/audio/en/intro.mp3
new file mode 100644
index 0000000..f66adbd
Binary files /dev/null and b/site/linear-algebra/ch15/audio/en/intro.mp3 differ
diff --git a/site/linear-algebra/ch14/audio/en/match.mp3 b/site/linear-algebra/ch15/audio/en/match.mp3
similarity index 100%
rename from site/linear-algebra/ch14/audio/en/match.mp3
rename to site/linear-algebra/ch15/audio/en/match.mp3
diff --git a/site/linear-algebra/ch14/audio/en/nine.mp3 b/site/linear-algebra/ch15/audio/en/nine.mp3
similarity index 100%
rename from site/linear-algebra/ch14/audio/en/nine.mp3
rename to site/linear-algebra/ch15/audio/en/nine.mp3
diff --git a/site/linear-algebra/ch15/audio/en/play.mp3 b/site/linear-algebra/ch15/audio/en/play.mp3
new file mode 100644
index 0000000..7e76613
Binary files /dev/null and b/site/linear-algebra/ch15/audio/en/play.mp3 differ
diff --git a/site/linear-algebra/ch14/audio/en/q4.mp3 b/site/linear-algebra/ch15/audio/en/q4.mp3
similarity index 100%
rename from site/linear-algebra/ch14/audio/en/q4.mp3
rename to site/linear-algebra/ch15/audio/en/q4.mp3
diff --git a/site/linear-algebra/ch15/audio/en/qa.mp3 b/site/linear-algebra/ch15/audio/en/qa.mp3
new file mode 100644
index 0000000..9f19b61
Binary files /dev/null and b/site/linear-algebra/ch15/audio/en/qa.mp3 differ
diff --git a/site/linear-algebra/ch15/audio/en/qb.mp3 b/site/linear-algebra/ch15/audio/en/qb.mp3
new file mode 100644
index 0000000..aad5040
Binary files /dev/null and b/site/linear-algebra/ch15/audio/en/qb.mp3 differ
diff --git a/site/linear-algebra/ch15/audio/en/timings.js b/site/linear-algebra/ch15/audio/en/timings.js
new file mode 100644
index 0000000..5405c98
--- /dev/null
+++ b/site/linear-algebra/ch15/audio/en/timings.js
@@ -0,0 +1,505 @@
+window.TIMINGS = {
+ "intro": {
+ "dur": 18.96,
+ "marks": {
+ "sub": 3.047,
+ "move": 9.427
+ },
+ "cues": [
+ [
+ 0.091,
+ "Chapter fifteen."
+ ],
+ [
+ 1.38,
+ "More numbers than axes."
+ ],
+ [
+ 3.047,
+ "In the last chapter we asked whether the columns reach every b, in the plane and in space."
+ ],
+ [
+ 9.427,
+ "Now b gets four numbers, and then nine."
+ ],
+ [
+ 12.474,
+ "We can't draw the axes any more, but we can still draw the numbers, and still ask the same question."
+ ]
+ ]
+ },
+ "bars": {
+ "dur": 35.496,
+ "marks": {
+ "two": 1.849,
+ "bars": 5.586,
+ "drag": 12.734,
+ "follow": 13.997,
+ "three": 18.424,
+ "four": 23.346,
+ "no": 27.969,
+ "fourb": 31.849
+ },
+ "cues": [
+ [
+ 0.104,
+ "What about four numbers?"
+ ],
+ [
+ 1.849,
+ "Here's b in the plane: two numbers, and an arrow."
+ ],
+ [
+ 5.586,
+ "Now draw each number as a bar instead: up for positive, down for negative, as long as the number is big."
+ ],
+ [
+ 12.734,
+ "Move the arrow, and the bars move with it."
+ ],
+ [
+ 15.755,
+ "Same two numbers, two pictures."
+ ],
+ [
+ 18.424,
+ "In space, three numbers: three axes, or three bars."
+ ],
+ [
+ 23.346,
+ "Four numbers would need a fourth axis, at right angles to all three."
+ ],
+ [
+ 27.969,
+ "Our space has no room for it, so we can't draw that arrow."
+ ],
+ [
+ 31.849,
+ "But the bars don't mind."
+ ],
+ [
+ 33.372,
+ "Four numbers: four bars."
+ ]
+ ]
+ },
+ "qa": {
+ "dur": 5.64,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Quick check."
+ ],
+ [
+ 1.133,
+ "These bars show one b, with four numbers."
+ ],
+ [
+ 4.401,
+ "Which numbers are they?"
+ ]
+ ]
+ },
+ "four": {
+ "dur": 47.616,
+ "marks": {
+ "names": 4.167,
+ "e1": 11.328,
+ "e2": 13.021,
+ "e3": 16.068,
+ "e4": 19.206,
+ "cols": 22.331,
+ "c1": 24.648,
+ "asbars": 28.854,
+ "call": 30.339,
+ "b": 32.435,
+ "mix": 36.055,
+ "ax": 39.935
+ },
+ "cues": [
+ [
+ 0.117,
+ "Here's a system with four equations and four unknowns."
+ ],
+ [
+ 4.167,
+ "We've run out of letters, so we number the unknowns: x one, x two, x three, x four."
+ ],
+ [
+ 11.328,
+ "x one equals one."
+ ],
+ [
+ 13.021,
+ "x one plus x two equals three."
+ ],
+ [
+ 16.068,
+ "x two plus x three equals four."
+ ],
+ [
+ 19.206,
+ "And x three plus x four equals two."
+ ],
+ [
+ 22.331,
+ "Read down the columns, as always."
+ ],
+ [
+ 24.648,
+ "Column one is one, one, zero, zero, drawn as bars."
+ ],
+ [
+ 30.339,
+ "And the other three columns."
+ ],
+ [
+ 32.435,
+ "On the right, b: one, three, four, two."
+ ],
+ [
+ 36.055,
+ "In front of each column, its amount: x one to x four."
+ ],
+ [
+ 39.935,
+ "The bars in the middle are A x, the mix of the columns."
+ ],
+ [
+ 43.971,
+ "The dashed outlines are b's bars: the targets."
+ ]
+ ]
+ },
+ "match": {
+ "dur": 51.168,
+ "marks": {
+ "zero": 1.419,
+ "x1": 6.68,
+ "x1b": 8.294,
+ "top": 12.8,
+ "x2": 14.544,
+ "x2v": 18.411,
+ "x2b": 20.065,
+ "two": 24.219,
+ "x3": 25.664,
+ "x3v": 28.464,
+ "x3b": 30.273,
+ "x4": 33.112,
+ "all": 38.594,
+ "row": 44.505
+ },
+ "cues": [
+ [
+ 0.104,
+ "Let's find the mix."
+ ],
+ [
+ 1.419,
+ "With every amount zero, A x is all zeros: no bars."
+ ],
+ [
+ 6.68,
+ "Turn x one up to one."
+ ],
+ [
+ 8.294,
+ "Column one adds one to the top row and one to the second row."
+ ],
+ [
+ 12.8,
+ "The top bar matches b."
+ ],
+ [
+ 14.544,
+ "The second row needs three and has one."
+ ],
+ [
+ 17.461,
+ "Two more: so x two is two."
+ ],
+ [
+ 20.065,
+ "Column two adds two to rows two and three."
+ ],
+ [
+ 24.219,
+ "Row two matches."
+ ],
+ [
+ 25.664,
+ "Row three needs four and has two: so x three is two."
+ ],
+ [
+ 30.273,
+ "Now rows three and four both match."
+ ],
+ [
+ 33.112,
+ "Row four needs two, and already has two, so x four stays zero."
+ ],
+ [
+ 38.594,
+ "Every bar matches."
+ ],
+ [
+ 40.104,
+ "A x equals b, with the mix one, two, two, zero."
+ ],
+ [
+ 44.505,
+ "And reading across a row gives back its equation: row two says one plus two is three."
+ ]
+ ]
+ },
+ "qb": {
+ "dur": 4.944,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Quick check."
+ ],
+ [
+ 1.133,
+ "Every amount is one."
+ ],
+ [
+ 2.773,
+ "Work out A x, row by row."
+ ]
+ ]
+ },
+ "q4": {
+ "dur": 5.352,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Your turn."
+ ],
+ [
+ 0.99,
+ "Change the amounts until every bar of A x matches b."
+ ]
+ ]
+ },
+ "nine": {
+ "dur": 33.0,
+ "marks": {
+ "nine": 1.576,
+ "same": 5.898,
+ "move": 10.404,
+ "match": 13.242,
+ "cant": 15.404,
+ "q": 21.693,
+ "yes": 26.12
+ },
+ "cues": [
+ [
+ 0.104,
+ "And nine equations?"
+ ],
+ [
+ 1.576,
+ "Nine unknowns, nine columns, nine numbers in each."
+ ],
+ [
+ 5.898,
+ "The same rules: each amount times its column, added row by row."
+ ],
+ [
+ 10.404,
+ "Change the amounts, and the bars move, until every row matches."
+ ],
+ [
+ 15.404,
+ "We cannot draw nine axes."
+ ],
+ [
+ 17.721,
+ "But we can still compute, and still see the numbers move."
+ ],
+ [
+ 21.693,
+ "And the big question is the same: do the columns reach every b?"
+ ],
+ [
+ 26.12,
+ "Yes, when each column points in a truly new direction, one that no mix of the others can make."
+ ]
+ ]
+ },
+ "unit": {
+ "dur": 44.28,
+ "marks": {
+ "sys": 1.849,
+ "row": 3.19,
+ "col": 10.599,
+ "ax": 17.669,
+ "big": 21.302,
+ "yes": 24.427,
+ "no": 29.805,
+ "next": 38.698
+ },
+ "cues": [
+ [
+ 0.104,
+ "That closes unit one."
+ ],
+ [
+ 1.849,
+ "One system, and the row picture: each equation is a line, or in space a plane, and the solution is where they all meet."
+ ],
+ [
+ 10.599,
+ "The column picture: each column is an arrow, and the solution is the mix of the columns that lands on b."
+ ],
+ [
+ 17.669,
+ "And one short name for both: A x equals b."
+ ],
+ [
+ 21.302,
+ "The big question: can we solve it for every b?"
+ ],
+ [
+ 24.427,
+ "Yes, when the columns point in different directions and fill the whole space."
+ ],
+ [
+ 29.805,
+ "No, when they lie flat, on a line or in a plane."
+ ],
+ [
+ 33.776,
+ "Then some b are out of reach, and the others have endlessly many mixes."
+ ],
+ [
+ 38.698,
+ "In unit two, we learn how to find the mix for any system, step by step."
+ ]
+ ]
+ },
+ "wrap": {
+ "dur": 31.848,
+ "marks": {
+ "w1": 0.99,
+ "w2": 6.628,
+ "w3": 14.453,
+ "w4": 23.581,
+ "end": 29.701
+ },
+ "cues": [
+ [
+ 0.104,
+ "To sum up."
+ ],
+ [
+ 0.99,
+ "A column of numbers can be drawn as bars: up for positive, down for negative."
+ ],
+ [
+ 6.628,
+ "A x is still each amount times its column, added row by row, and reading across a row gives back its equation."
+ ],
+ [
+ 14.453,
+ "With four or nine numbers we can't draw the axes, but the rules are the same, and so is the question: do the columns reach every b?"
+ ],
+ [
+ 23.581,
+ "And that is unit one: the row picture, the column picture, and A x equals b."
+ ],
+ [
+ 29.701,
+ "Now try the chapter practice."
+ ]
+ ]
+ },
+ "final1": {
+ "dur": 4.416,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Chapter practice."
+ ],
+ [
+ 1.523,
+ "Work out these mixes, number by number."
+ ]
+ ]
+ },
+ "final2": {
+ "dur": 3.648,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Now backwards: find the amounts for each b."
+ ]
+ ]
+ },
+ "final3": {
+ "dur": 4.392,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Last set."
+ ],
+ [
+ 1.237,
+ "Change the amounts until every bar matches."
+ ]
+ ]
+ },
+ "play": {
+ "dur": 17.136,
+ "marks": {
+ "go": 4.05
+ },
+ "cues": [
+ [
+ 0.104,
+ "Playground."
+ ],
+ [
+ 1.081,
+ "Nothing here is marked right or wrong."
+ ],
+ [
+ 4.05,
+ "Change the amounts, the columns or b, drag any bar, and watch A x follow."
+ ],
+ [
+ 10.768,
+ "Try making two columns the same, and see which b you can still match."
+ ],
+ [
+ 15.482,
+ "Press continue when you're done."
+ ]
+ ]
+ },
+ "finish": {
+ "dur": 12.528,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Well done."
+ ],
+ [
+ 1.068,
+ "That's the end of chapter fifteen, more numbers than axes, and the end of unit one."
+ ],
+ [
+ 6.55,
+ "Next: elimination, a way to find the mix for any system, step by step."
+ ]
+ ]
+ }
+};
diff --git a/site/linear-algebra/ch14/audio/en/unit.mp3 b/site/linear-algebra/ch15/audio/en/unit.mp3
similarity index 100%
rename from site/linear-algebra/ch14/audio/en/unit.mp3
rename to site/linear-algebra/ch15/audio/en/unit.mp3
diff --git a/site/linear-algebra/ch15/audio/en/wrap.mp3 b/site/linear-algebra/ch15/audio/en/wrap.mp3
new file mode 100644
index 0000000..75aa690
Binary files /dev/null and b/site/linear-algebra/ch15/audio/en/wrap.mp3 differ
diff --git a/site/linear-algebra/ch15/index.html b/site/linear-algebra/ch15/index.html
new file mode 100644
index 0000000..a1b64cc
--- /dev/null
+++ b/site/linear-algebra/ch15/index.html
@@ -0,0 +1,344 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>More Numbers Than Axes</title>
+<link rel="stylesheet" href="../lib/engine.css">
+<link rel="expect" href="#bar" blocking="render"><!-- hold the first frame until the player exists, so the page transition can run -->
+</head>
+<body>
+<script src="../lib/engine.js"></script>
+<script src="../lib/math.js"></script>
+<script src="../lib/linsys.js"></script>
+<script src="../lib/space3.js"></script>
+<script src="../lib/bars.js"></script>
+<script src="../lib/play.js"></script>
+<script src="audio/en/timings.js"></script>
+<script>
+'use strict';
+const CHAPTER = { number: 15, title: 'More Numbers Than Axes', minutes: 9, language: 'en' };
+
+/* ---------- the systems of this chapter ---------- */
+const LA = [[2, -1], [-1, 2]]; // the lecture's 2 × 2 (the unit close)
+const BID = [[1, 0, 0, 0], [1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]; // x₁ = …, x₁ + x₂ = …, x₂ + x₃ = …, x₃ + x₄ = …
+const VIEW = { yaw: 50, pitch: 20 }; // chapter 13's view
+const AXC = [COL.whole, COL.nat, COL.int]; // steps along x, y, z (chapter 11's walk)
+const SUB = BR_SUB;
+
+/* ---------- chapter drawing helpers ---------- */
+const say = (p, parts, x, y, t0, { size = 40, fill = COL.chalk, anchor = 'start' } = {}) => { const e = M(p, [].concat(parts), { x, y, size, fill, anchor, o: 0 }); show(e, t0); return e; };
+const text = (p, str, x, y, t0, { size = 30, fill = COL.chalk, anchor = 'start', weight = 500 } = {}) => { const e = T(p, str, { x, y, size, fill, anchor, weight, o: 0 }); show(e, t0); return e; };
+// A number changes: it lights amber and goes back to its own colour.
+const flash = (els, t0) => els.forEach(e => {
+ const base = e.getAttribute('fill');
+ tw(e, { c_fill: base === COL.task ? COL.chalk : COL.task }, t0, .25); tw(e, { c_fill: base }, t0 + .7, .4);
+});
+const thick = (e, t0, w = 5) => { tw(e, { 'a_stroke-width': w + 5 }, t0, .3); tw(e, { 'a_stroke-width': w }, t0 + .8, .5); };
+const box = (p, x, y, w, h, color, t, until) => {
+ const r = mk('rect', { x, y, width: w, height: h, rx: 12, fill: color, 'fill-opacity': .08, stroke: color, 'stroke-width': 2.5, 'stroke-dasharray': '6 6' }, p);
+ put(r, { o: 0 }); show(r, t, .3); if (until !== undefined) hide(r, until, .3);
+ return r;
+};
+const rowNames = (p, bs, names, x, t0, colors = []) => names.map((n, i) => say(p, [n], x, bs.zeroY(i) + 12, t0 + i * .15, { size: 34, fill: colors[i] || COL.dim, anchor: 'end' }));
+// The equations of the 4 × 4 system written above the bars: each term over its own column of bars.
+const eqsAbove = (p, bs, A, b, y0, t0, { gap = 42, size = 32 } = {}) => A.map((row, i) => {
+ const g = G(p, { o: 0 }), y = y0 + i * gap;
+ row.forEach((a, j) => {
+ const x = bs.cols[j].bx, zero = a === 0;
+ if (j) T(g, '+', { x: st(bs.plusSigns[j - 1]).x, y, size, fill: COL.chalk, font: MATH, anchor: 'middle', o: zero ? .3 : 1 });
+ M(g, [(zero ? '0' : a === 1 ? '' : num(a)) + 'x' + SUB[j + 1]], { x, y, size, fill: COL.chalk, anchor: 'middle', o: zero ? .3 : 1 });
+ });
+ T(g, '=', { x: st(bs.eqs[0]).x, y, size, fill: COL.chalk, font: MATH, anchor: 'middle' });
+ T(g, num(b[i]), { x: bs.b.bx, y, size, fill: COL.task, font: MATH, anchor: 'middle' });
+ show(g, t0[i] ?? t0);
+ return g;
+});
+const barsFlash = (bs, keys, t0) => flash(keys.flatMap(k => bs.num(k)), t0);
+// The 4 × 4 system as bars, sized so a bottom card leaves the column names clear.
+const bars4 = (p, b, opts = {}) => bars(p, { A: BID, b, x0: 110, top: 175, band: 90, unit: 9, bw: 30, size: 30, ...opts });
+// The hint of a matching task: the first row of A x that is off, and the amount that fixes it.
+const rowHint = b => (v, ax) => {
+ const i = ax.findIndex((t, k) => Math.abs(t - b[k]) > 1e-9);
+ if (i <= 0) return `Go row by row from the top. Row 1 is x₁ alone: it must be ${num(b[0])}.`;
+ const have = v[`x${i - 1}`], need = b[i] - have;
+ return `${i > 1 ? `Rows 1 to ${i} match` : 'Row 1 matches'}. Row ${i + 1} is x${SUB[i]} + x${SUB[i + 1]} = ${num(b[i])}, and x${SUB[i]} is ${num(have)}: so x${SUB[i + 1]} = ${num(b[i])} − ${have < 0 ? '(' + num(have) + ')' : num(have)} = ${num(need)}.`;
+};
+
+/* ---------- practice data (columns of this chapter: A x = (x₁, x₁ + x₂, x₂ + x₃, x₃ + x₄)) ---------- */
+const COMBQ = [
+ { parts: ['2·(1, 0, 3, −1) + (0, 2, −1, 4) = (', { box: '2' }, ', ', { box: '2' }, ', ', { box: '5' }, ', ', { box: '2' }, ')'], why: '(2, 0, 6, −2) + (0, 2, −1, 4) = (2, 2, 5, 2).', hint: 'Double the first: (2, 0, 6, −2). Then add number by number.' },
+ { parts: ['3·(1, −1, 0, 2) − (2, 0, 1, 1) = (', { box: '1' }, ', ', { box: '-3' }, ', ', { box: '-1' }, ', ', { box: '5' }, ')'], why: '(3, −3, 0, 6) − (2, 0, 1, 1) = (1, −3, −1, 5).', hint: 'Triple the first: (3, −3, 0, 6). Then take away (2, 0, 1, 1).' },
+ { parts: ['−(1, 2, 3, 4) + (4, 3, 2, 1) = (', { box: '3' }, ', ', { box: '1' }, ', ', { box: '-1' }, ', ', { box: '-3' }, ')'], why: '(−1, −2, −3, −4) + (4, 3, 2, 1) = (3, 1, −1, −3).', hint: 'The minus flips every sign: (−1, −2, −3, −4).' },
+];
+const AXQ = [
+ { parts: ['x = (2, 0, 1, 0): A x = (', { box: '2' }, ', ', { box: '2' }, ', ', { box: '1' }, ', ', { box: '1' }, ')'], why: '(2, 2 + 0, 0 + 1, 1 + 0) = (2, 2, 1, 1).', hint: 'Row 1 is x₁. Row 2 is x₁ + x₂, row 3 is x₂ + x₃, row 4 is x₃ + x₄.' },
+ { parts: ['x = (0, 3, 0, −1): A x = (', { box: '0' }, ', ', { box: '3' }, ', ', { box: '3' }, ', ', { box: '-1' }, ')'], why: '(0, 0 + 3, 3 + 0, 0 − 1) = (0, 3, 3, −1).', hint: 'Row 3 is x₂ + x₃ = 3 + 0. Row 4 is x₃ + x₄ = 0 + (−1).' },
+ { parts: ['x = (1, −1, 1, −1): A x = (', { box: '1' }, ', ', { box: '0' }, ', ', { box: '0' }, ', ', { box: '0' }, ')'], why: '(1, 1 − 1, −1 + 1, 1 − 1) = (1, 0, 0, 0).', hint: 'Row 2 is x₁ + x₂ = 1 + (−1).' },
+];
+const MIX4Q = [
+ { parts: ['b = (2, 5, 4, 1): x₁, x₂, x₃, x₄ = ', { box: '2' }, ', ', { box: '3' }, ', ', { box: '1' }, ', ', { box: '0' }], why: 'x₁ = 2; 2 + x₂ = 5, x₂ = 3; 3 + x₃ = 4, x₃ = 1; 1 + x₄ = 1, x₄ = 0.', hint: 'Go from the top: x₁ is the first number of b. Then x₁ + x₂ must be the second.' },
+ { parts: ['b = (−1, 0, 2, 2): x₁, x₂, x₃, x₄ = ', { box: '-1' }, ', ', { box: '1' }, ', ', { box: '1' }, ', ', { box: '1' }], why: 'x₁ = −1; −1 + x₂ = 0, x₂ = 1; 1 + x₃ = 2, x₃ = 1; 1 + x₄ = 2, x₄ = 1.', hint: 'x₁ = −1. Then −1 + x₂ = 0.' },
+ { parts: ['b = (3, 3, 3, 3): x₁, x₂, x₃, x₄ = ', { box: '3' }, ', ', { box: '0' }, ', ', { box: '3' }, ', ', { box: '0' }], why: 'x₁ = 3; 3 + x₂ = 3, x₂ = 0; 0 + x₃ = 3, x₃ = 3; 3 + x₄ = 3, x₄ = 0.', hint: 'x₁ = 3, and 3 + x₂ = 3: so x₂ = 0. Keep going down.' },
+ { parts: ['b = (0, 1, 0, 1): x₁, x₂, x₃, x₄ = ', { box: '0' }, ', ', { box: '1' }, ', ', { box: '-1' }, ', ', { box: '2' }], why: 'x₁ = 0; x₂ = 1; 1 + x₃ = 0, x₃ = −1; −1 + x₄ = 1, x₄ = 2.', hint: 'x₂ + x₃ = 0 with x₂ = 1: x₃ is negative.' },
+];
+
+/* ---------- beats: [id, title, run(m, D), { ask }?] ---------- */
+const BEATS = [
+ ['intro', 'More numbers than axes', (m, D) => {
+ const g = G(scene, { o: 0, y: 24 });
+ T(g, 'Unit 1, Chapter 15', { x: 800, y: 300, size: 28, fill: COL.dim, anchor: 'middle' });
+ T(g, 'More Numbers Than Axes', { x: 800, y: 410, size: 84, weight: 600, anchor: 'middle' });
+ tw(g, { o: 1, y: 0 }, .2, 1.1, out);
+ const r = text(scene, 'four numbers, nine numbers: no axes to draw, but the same rules', 800, 530, m('sub'), { size: 34, fill: COL.dim, anchor: 'middle' });
+ // a vector of four numbers as bars, changing
+ const lg = G(scene, { o: 0 });
+ const bs = bars(lg, { b: [2, -1, 3, 1], x0: 760, top: 580, band: 64, unit: 9, bw: 34, numbers: false, names: ['', ''], t0: 0 });
+ show(lg, m('sub') + 1, .6);
+ [[-2, 3, 1, 2], [3, 1, -2, -1], [1, 2, 2, 3]].forEach((b, i) => bs.to({ b0: b[0], b1: b[1], b2: b[2], b3: b[3] }, m('move') + .4 + i * 1.8, 1.1));
+ tw(g, { o: 0, y: -24 }, D - .9, .8); hide(r, D - .9, .8); hide(lg, D - .9, .8);
+ }],
+
+ ['bars', 'Numbers as bars', (m) => {
+ const p = panel(0);
+ text(p, 'More numbers than axes', 60, 110, .2, { size: 40, weight: 600 });
+ // 2D: b as an arrow (with its x and y steps) and as two bars, one state
+ const g2 = G(p, {}), P2 = plane(g2, { cx: 1160, cy: 450, u: 52, t0: m('two') - .3 });
+ const bs2 = bars(g2, { b: [3, 2], x0: 330, top: 250, band: 170, unit: 18, bw: 60, size: 40, t0: m('bars') });
+ rowNames(g2, bs2, ['x', 'y'], 300, m('bars') + .3, AXC);
+ const legX = path(g2, '', { stroke: AXC[0], 'stroke-width': 4, 'stroke-dasharray': '8 7', fill: 'none' });
+ const legY = path(g2, '', { stroke: AXC[1], 'stroke-width': 4, 'stroke-dasharray': '8 7', fill: 'none' });
+ const arr = path(g2, '', { stroke: COL.task, fill: COL.task, 'stroke-width': 6, 'stroke-linejoin': 'round' });
+ const tipT = T(g2, 'b', { size: 30, fill: COL.task, font: MATH, weight: 600 });
+ tipT.setAttribute('font-style', 'italic');
+ const hand2 = G(g2, { o: 0 });
+ path(hand2, 'M0 0L0 30L8 23L14 36L20 33L14 21L24 21Z', { fill: COL.chalk, stroke: COL.board, 'stroke-width': 2.5 });
+ const draw2 = v => {
+ const X = P2.PX(v.b0), Y = P2.PY(v.b1), O = [P2.PX(0), P2.PY(0)], L = Math.hypot(X - O[0], Y - O[1]) || 1, ux = (X - O[0]) / L, uy = (Y - O[1]) / L;
+ legX.setAttribute('d', `M${O[0]} ${O[1]}H${X.toFixed(1)}`); legY.setAttribute('d', `M${X.toFixed(1)} ${O[1]}V${Y.toFixed(1)}`);
+ arr.setAttribute('d', L < 2 ? '' : `M${O[0]} ${O[1]}L${(X - ux * 11).toFixed(1)} ${(Y - uy * 11).toFixed(1)}M${(X - 18 * ux - 9 * uy).toFixed(1)} ${(Y - 18 * uy + 9 * ux).toFixed(1)}L${X.toFixed(1)} ${Y.toFixed(1)}L${(X - 18 * ux + 9 * uy).toFixed(1)} ${(Y - 18 * uy - 9 * ux).toFixed(1)}Z`);
+ put(tipT, { x: X + ux * 22 - 8, y: Y + uy * 22 + 10 }); put(hand2, { x: X + 6, y: Y + 6 });
+ };
+ bs2.onChange(draw2); draw2(bs2.v);
+ [legX, legY, arr, tipT].forEach(e => { put(e, { o: 0 }); show(e, m('two') + .2, .5); });
+ show(hand2, m('drag'), .3); hide(hand2, m('three') - .6, .3);
+ bs2.to({ b0: -2 }, m('bars') + 2.6, 1); bs2.to({ b0: 3 }, m('bars') + 4.6, 1);
+ bs2.to({ b0: -2, b1: 4 }, m('drag') + .2, 1.3); bs2.to({ b0: 4, b1: -3 }, m('follow') + 1, 1.3); bs2.to({ b0: 3, b1: 2 }, m('follow') + 2.6, 1.1);
+ barsFlash(bs2, ['b0', 'b1'], m('follow'));
+ hide(g2, m('three') - .4, .4);
+ // 3D: three numbers, three steps, three bars
+ const g3 = G(p, { o: 0 });
+ show(g3, m('three') - .1, .4);
+ const V = space3(g3, { ...VIEW, t0: m('three') }), O3 = [0, 0, 0];
+ V.sway(5, 14);
+ const legs = AXC.map(c => { const l = V.line(null, null, { color: c, w: 4, dash: '8 7' }); return l; });
+ const arr3 = V.arrow(O3, [3, 2, 2], { color: COL.task, w: 6 });
+ const bs3 = bars(g3, { b: [3, 2, 2], x0: 330, top: 230, band: 140, unit: 15, bw: 60, size: 40, t0: m('three') + .3 });
+ rowNames(g3, bs3, ['x', 'y', 'z'], 300, m('three') + .5, AXC);
+ const draw3 = v => { const b = [v.b0, v.b1, v.b2]; legs[0].set(O3, [b[0], 0, 0]); legs[1].set([b[0], 0, 0], [b[0], b[1], 0]); legs[2].set([b[0], b[1], 0], b); arr3.set(O3, b); };
+ bs3.onChange(draw3); draw3(bs3.v);
+ bs3.to({ b0: -2, b1: 1, b2: 3 }, m('three') + 1.8, 1.4);
+ // a fourth axis has nowhere to go
+ const ax4 = V.line([0, 0, 0], [3, -3, 3], { color: COL.chalk, w: 3, dash: '6 8' }); // (−3, −3, 3.5) lay over the z axis in this view
+ put(ax4.e, { o: 0 }); show(ax4.e, m('four') + .3, .4);
+ const q4 = text(g3, '4th axis?', 1420, 290, m('four') + .6, { size: 30, fill: COL.chalk, anchor: 'middle', weight: 600 });
+ const no = text(g3, 'no room: every direction here is already a mix of x, y and z', 1150, 860, m('no'), { size: 26, fill: COL.bad, anchor: 'middle', weight: 600 });
+ hide(g3, m('fourb') - .4, .4);
+ // four numbers: four bars
+ const g4 = G(p, { o: 0 });
+ show(g4, m('fourb'), .3);
+ const bs4 = bars(g4, { b: [3, -1, 2, 0], x0: 720, top: 220, band: 130, unit: 14, bw: 60, size: 40, t0: m('fourb') });
+ rowNames(g4, bs4, ['1st', '2nd', '3rd', '4th'], 690, m('fourb') + .2);
+ bs4.to({ b0: 1, b1: 2, b2: -2, b3: 3 }, m('fourb') + 1.4, 1.2);
+ S.keep = [q4, no];
+ }],
+
+ ['qa', 'Quick check', () => {
+ const p = panel(0);
+ text(p, 'Quick check', 60, 110, .2, { size: 40, weight: 600 });
+ const bs = S.sys = bars(p, { b: [3, -1, 0, 2], x0: 1120, top: 180, band: 125, unit: 15, bw: 60, numbers: false, t0: .2 });
+ rowNames(p, bs, ['1st', '2nd', '3rd', '4th'], 1090, .3);
+ }, { ask: done => quiz({ x: 40, y: 290, w: 720, cls: 'side' }, [{
+ id: 'c-read', prompt: ['These bars show one ', $m('b'), ' with four numbers. Which numbers?'],
+ build: choice([[$m('b = (3, −1, 0, 2)')], [$m('b = (3, 1, 0, 2)')], [$m('b = (2, 0, −1, 3)')], [$m('b = (3, −1, 2, 0)')]], 0,
+ 'Top to bottom: up 3, down 1, nothing, up 2. b = (3, −1, 0, 2).',
+ [null, 'The 2nd bar hangs down from its line: that number is negative, −1.', 'That reads the bars from the bottom up. The 1st number is the top bar.', 'The 3rd bar has no height: it is 0. The 4th bar is the one that is 2.']),
+ }], done) }],
+
+ ['four', 'Four equations, four unknowns', (m) => {
+ const p = S.p = panel(0);
+ text(p, 'Four equations, four unknowns', 60, 110, .2, { size: 40, weight: 600 });
+ const bs = S.bs = bars(p, { A: BID, b: [1, 3, 4, 2], x0: 110, top: 360, band: 100, unit: 10, bw: 30, size: 30, t0: .1 });
+ // the parts appear on their words
+ [...bs.cols.map(c => c.g), ...bs.mixG, ...bs.plusSigns, bs.eqSign, bs.ax.g, ...bs.eqs, bs.b.g, bs.zeros].forEach(e => put(e, { o: 0 }));
+ [1, 2, 3, 4].forEach(j => hide(say(p, ['x' + SUB[j]], 500 + j * 120, 250, m('names') + .6 + j * .9, { size: 56, anchor: 'middle', fill: BR_COLS[j - 1] }), m('e1') - .3, .3));
+ eqsAbove(p, bs, BID, [1, 3, 4, 2], 175, ['e1', 'e2', 'e3', 'e4'].map(k => m(k)));
+ show(bs.zeros, m('cols'), .5);
+ box(p, bs.cols[0].bx - 52, 140, 104, 170, LS_COLS[0], m('c1'), m('call') + 1);
+ show(bs.cols[0].g, m('asbars'), .6);
+ [1, 2, 3].forEach(j => { show(bs.cols[j].g, m('call') + (j - 1) * .5, .5); show(bs.plusSigns[j - 1], m('call') + (j - 1) * .5, .4); });
+ box(p, bs.b.bx - 48, 140, 96, 170, COL.task, m('b'), m('b') + 2.5);
+ show(bs.b.g, m('b') + .3, .5);
+ bs.mixG.forEach((g, j) => show(g, m('mix') + j * .3, .4));
+ show(bs.eqSign, m('ax'), .4); show(bs.ax.g, m('ax'), .6); bs.eqs.forEach((e, i) => show(e, m('ax') + 2 + i * .2, .3));
+ flash(bs.b.rows.map(r => r.s.t), m('ax') + 3.2);
+ }],
+
+ ['match', 'Matching b, row by row', (m) => {
+ const p = S.p, bs = S.bs;
+ [['x1', 'x0', 1, 'x1b', ['a00', 'a10']], ['x2v', 'x1', 2, 'x2b', ['a11', 'a21']], ['x3v', 'x2', 2, 'x3b', ['a22', 'a32']]].forEach(([k, key, val, kb, cells]) => {
+ bs.to({ [key]: val }, m(k), 1);
+ barsFlash(bs, [key], m(k));
+ barsFlash(bs, cells, m(kb));
+ });
+ const glow = (rows, t, color = COL.task, dur = 1.6) => rows.forEach(i => {
+ const r = mk('rect', { x: 96, y: bs.zeroY(i) - 35, width: 1430, height: 70, rx: 10, fill: color, 'fill-opacity': .1, stroke: color, 'stroke-opacity': .5, 'stroke-width': 2 }, p);
+ put(r, { o: 0 }); show(r, t, .3); hide(r, t + dur, .4);
+ });
+ glow([0, 1, 2, 3], m('zero') + .4, COL.chalk, 2.4);
+ glow([0, 1], m('x1b')); glow([1], m('x2'), COL.nat, 2.6); glow([1, 2], m('x2b')); glow([2], m('x3'), COL.int, 2.4); glow([2, 3], m('x3b'));
+ glow([3], m('x4'), COL.chalk, 3); glow([0, 1, 2, 3], m('all'), COL.good, 3);
+ pulse(bs.eqs[0], m('top'), 1.6);
+ pulse(bs.eqs[1], m('two'), 1.6);
+ pulse(bs.eqs[2], m('x3b') + .6, 1.6); pulse(bs.eqs[3], m('x3b') + 1.2, 1.6);
+ barsFlash(bs, ['x3'], m('x4') + 2);
+ const all = G(p, { o: 0 });
+ M(all, ['A x = b, mix (1, 2, 2, 0)'], { x: 800, y: 858, size: 38, fill: COL.good, anchor: 'middle' });
+ show(all, m('all'), .5); hide(all, m('row') - .3, .3);
+ const zy = bs.zeroY(1);
+ box(p, 96, zy - 35, 1430, 70, COL.nat, m('row'));
+ box(p, 96, 175 + 42 - 34, 1430, 46, COL.nat, m('row'));
+ say(p, ['row 2: x₁ + x₂ = 1 + 2 = 3'], 800, 858, m('row') + .5, { size: 34, fill: COL.nat, anchor: 'middle' });
+ }],
+
+ ['qb', 'Quick check', () => {
+ const p = panel(0);
+ text(p, 'Quick check', 60, 110, .2, { size: 40, weight: 600 });
+ const bs = S.sys = bars4(p, [1, 2, 2, 2], { mix: [1, 1, 1, 1] });
+ [bs.ax.g, bs.b.g, bs.eqSign, ...bs.eqs].forEach(e => put(e, { o: 0 })); // A x waits for the reader's answer
+ }, { ask: done => quiz(BAND, [{
+ id: 'c-ax', prompt: ['Every amount is 1. Work out ', $m('A x'), ', row by row.'],
+ build: blanks([{ parts: ['A x = (', { box: '1' }, ', ', { box: '2' }, ', ', { box: '2' }, ', ', { box: '2' }, ')'],
+ why: 'Row 1: x₁ = 1. Row 2: x₁ + x₂ = 1 + 1 = 2. Row 3: x₂ + x₃ = 2. Row 4: x₃ + x₄ = 2.',
+ hint: 'Read across each row: row 1 has only column 1, row 2 has columns 1 and 2, and so on. Each amount is 1.',
+ fx: () => [S.sys.ax.g, S.sys.eqSign].forEach(e => fx(e, { o: 1 }, 0, .5)) }]),
+ }], done) }],
+
+ ['q4', 'Your turn', () => {
+ const p = panel(0);
+ text(p, 'Your turn', 60, 110, .2, { size: 40, weight: 600 });
+ S.sys = bars4(p, [2, 1, 2, 4]); // the column names clear the card
+ }, { ask: done => quiz(BAND, [{
+ id: 'c-bars', prompt: ['Change the amounts ', $m('x₁'), ' to ', $m('x₄'), ' until every bar of ', $m('A x'), ' matches ', $m('b'), '.'],
+ build: barsTask(S.sys, (v, ax, ok) => ok, 'x₁ = 2, x₂ = −1, x₃ = 3, x₄ = 1: (2, 2 − 1, −1 + 3, 3 + 1) = (2, 1, 2, 4).',
+ rowHint([2, 1, 2, 4]),
+ () => S.sys.set({ x0: 2, x1: -1, x2: 3, x3: 1 }), { only: ['x0', 'x1', 'x2', 'x3'] }),
+ }], done) }],
+
+ ['nine', 'Nine equations', (m) => {
+ const p = panel(0);
+ text(p, 'Nine equations, nine unknowns', 60, 110, .2, { size: 40, weight: 600 });
+ const A9 = Array.from({ length: 9 }, (_, i) => Array.from({ length: 9 }, (_, j) => +(j === i || j === i - 1)));
+ const x9 = [1, 1, -1, 2, 0, -2, 1, 1, -1], b9 = A9.map(r => r.reduce((s, a, j) => s + a * x9[j], 0));
+ const names = Array(9).fill(''); names.push('A x', 'b');
+ const bs = bars(p, { A: A9, b: b9, x0: 50, top: 180, band: 62, unit: 11, bw: 22, size: 22, numbers: false, mw: 50, gap: 18, names, t0: m('nine') - .3 });
+ put(bs.ax.g, { o: 0 }); bs.eqs.forEach(e => put(e, { o: 0 }));
+ show(bs.ax.g, m('same'), .5); bs.eqs.forEach(e => show(e, m('same') + .3, .3));
+ const span = m('match') - m('move') + 1.2;
+ x9.forEach((x, j) => bs.to({ [`x${j}`]: x }, m('move') + j * span / 9, .55));
+ const cant = text(p, 'nine axes: we can’t draw them. nine numbers: we can compute, and watch them move.', 800, 855, m('cant'), { size: 28, fill: COL.task, anchor: 'middle', weight: 600 });
+ hide(cant, m('q') - .3, .3);
+ text(p, 'every b? yes, when each column brings a new direction', 800, 855, m('yes'), { size: 28, fill: COL.good, anchor: 'middle', weight: 600 });
+ // keep the bars alive while the voice talks: the amounts step back and land again
+ x9.forEach((x, j) => { bs.to({ [`x${j}`]: 0 }, m('cant') + 1.5 + j * .15, .5); bs.to({ [`x${j}`]: x }, m('q') + .4 + j * .35, .6); });
+ bs.eqs.forEach((e, i) => pulse(e, m('yes') + .3 + i * .12, 1.5));
+ }],
+
+ ['unit', 'Unit 1 in one picture', (m) => {
+ const p = panel(0);
+ text(p, 'Unit 1: one system, three views', 60, 110, .2, { size: 40, weight: 600 });
+ const row = linsys(p, { A: LA, b: [0, 3], eq: [610, 200], size: 44, mat: null, sol: false, view: 'row', plane: { cx: 300, cy: 560, u: 24, step: 2 }, t0: m('sys') - .3 });
+ const col = linsys(p, { A: LA, b: [0, 3], eq: [610, 200], size: 44, mat: null, sol: false, view: 'col', plane: { cx: 800, cy: 560, u: 24, step: 2 }, t0: m('col') });
+ col.E.style.display = 'none';
+ put(row.stage, { o: 0 }); show(row.stage, m('row'), .5);
+ col.labels(['col 1', 'col 2', 'b']);
+ const mat = linsys(p, { A: LA, b: [0, 3], eq: [610, 200], size: 44, mat: [1090, 500], sol: false, hidePlane: true, t0: m('ax') - .4 });
+ mat.E.style.display = 'none';
+ const head = (s, x, t, until) => { const e = text(p, s, x, 770, t, { size: 28, fill: COL.dim, anchor: 'middle', weight: 600 }); if (until) hide(e, until, .3); return e; };
+ // the captions say what the pictures show: when column 2 lies down they change with them, and come back on "next"
+ const lie = m('no') + .8, onLine = m('no') + 5.6, back = m('next') + .6;
+ [[300, 'row picture: lines meet', 'row picture: parallel lines', 'row picture: one line', m('row') + .5],
+ [800, 'column picture: a mix makes b', 'column picture: no mix makes b', 'column picture: many mixes make b', m('col') + .5]].forEach(([x, a, b, c, t]) => {
+ const first = head(a, x, t, lie); show(first, back, .4);
+ head(b, x, lie + .3, onLine); head(c, x, onLine + .3, back);
+ });
+ head('A x = b', 1330, m('ax'));
+ row.lines.forEach((l, i) => thick(l.l, m('row') + 1.5 + i * .8));
+ thick(col.combo[0], m('col') + 2.5, 4); thick(col.combo[1], m('col') + 3.3, 4); thick(col.bArrow, m('col') + 4.6, 6);
+ // the three views stay one system: column 2 lies down on column 1 in all of them (rows: parallel lines)
+ const all3 = (v, t, d) => [row, col, mat].forEach(s => s.to(v, t, d));
+ all3({ a01: 4, a11: -2 }, m('no') + .8, 1.6); // they lie flat: b = (0, 3) is out of reach
+ thick(col.bArrow, m('no') + 3.2, 6);
+ prog(() => col.labels(['', 'col 2', 'b']), m('no') + .8, 0); prog(() => col.labels(['col 1', 'col 2', 'b']), m('next') + 1.2, 0);
+ all3({ b0: -4, b1: 2 }, m('no') + 5.6, 1.2); // a b on their line: endlessly many mixes (rows: one line)
+ all3({ a01: -1, a11: 2, b0: 0, b1: 3 }, m('next'), 1.2);
+ const big = G(p, { o: 0 });
+ T(big, 'every b?', { x: 90, y: 830, size: 30, fill: COL.task, weight: 600 });
+ show(big, m('big'), .4);
+ text(p, 'yes: the columns fill the space', 270, 830, m('yes'), { size: 30, fill: COL.good, weight: 600 });
+ text(p, 'no: they lie flat (a line, a plane)', 810, 830, m('no'), { size: 30, fill: COL.bad, weight: 600 });
+ text(p, 'next: Unit 2, elimination', 1520, 110, m('next'), { size: 30, fill: COL.task, anchor: 'end', weight: 600 });
+ }],
+
+ ['wrap', 'Summary', (m) => {
+ const p = panel(0);
+ [['A column of numbers can be drawn as bars: up is plus, down is minus.', 'w1'],
+ ['A x: each amount times its column, added row by row.', 'w2'],
+ ['4 or 9 numbers: no axes to draw, the same rules, the same question.', 'w3'],
+ ['Unit 1: row picture, column picture, and A x = b.', 'w4']].forEach(([str, mark], i) => {
+ const g = G(p, { x: -16, y: 230 + i * 130, o: 0 });
+ mk('circle', { cx: 150, cy: -12, r: 26, fill: COL.task }, g);
+ T(g, String(i + 1), { x: 150, y: -1, size: 30, fill: COL.board, weight: 700, anchor: 'middle' });
+ T(g, str, { x: 210, size: 34, weight: 600 });
+ tw(g, { o: 1, x: 0 }, m(mark), .6);
+ });
+ }],
+ ['final1', 'Chapter practice', () => { panel(0); }, { ask: done => quiz(SCREEN, [{
+ id: 'p-comb4', prompt: ['Work out each mix, number by number.'],
+ build: blanks(COMBQ),
+ }, {
+ id: 'p-ax4', prompt: ['With the columns of this chapter, ', $m('A x = (x₁, x₁ + x₂, x₂ + x₃, x₃ + x₄)'), '. Work out ', $m('A x'), '.'],
+ build: blanks(AXQ),
+ }], done, 'Chapter practice · set 1 of 3') }],
+ ['final2', 'Chapter practice', () => {}, { ask: done => quiz(SCREEN, [{
+ id: 'p-mix4', prompt: ['Same columns, now backwards: ', $m('A x = (x₁, x₁ + x₂, x₂ + x₃, x₃ + x₄)'), '. Find the amounts for each ', $m('b'), ', from the top row down.'],
+ build: blanks(MIX4Q),
+ }], done, 'Chapter practice · set 2 of 3') }],
+ ['final3', 'Chapter practice', () => {
+ const p = panel(0);
+ text(p, 'Match the bars', 60, 110, .2, { size: 40, weight: 600 });
+ S.sys = bars4(p, [1, 4, 3, 0]);
+ }, { ask: done => quiz(BAND, [{
+ id: 'p-bars1', prompt: ['Change the amounts until every bar of ', $m('A x'), ' matches ', $m('b = (1, 4, 3, 0)'), '.'],
+ build: barsTask(S.sys, (v, ax, ok) => ok, 'x = (1, 3, 0, 0): (1, 1 + 3, 3 + 0, 0 + 0) = (1, 4, 3, 0).',
+ rowHint([1, 4, 3, 0]), () => S.sys.set({ x0: 1, x1: 3, x2: 0, x3: 0 }), { only: ['x0', 'x1', 'x2', 'x3'] }),
+ }, {
+ id: 'p-bars2', prompt: ['A new ', $m('b = (−2, 0, 1, 3)'), '. Match it again.'],
+ build: (body, api) => { S.sys.set({ b0: -2, b1: 0, b2: 1, b3: 3, x0: 0, x1: 0, x2: 0, x3: 0 });
+ return barsTask(S.sys, (v, ax, ok) => ok, 'x = (−2, 2, −1, 4): (−2, −2 + 2, 2 − 1, −1 + 4) = (−2, 0, 1, 3).',
+ rowHint([-2, 0, 1, 3]), () => S.sys.set({ x0: -2, x1: 2, x2: -1, x3: 4 }), { only: ['x0', 'x1', 'x2', 'x3'] })(body, api); },
+ }], done, 'Chapter practice · set 3 of 3') }],
+ ['play', 'Playground', (m) => {
+ const p = panel(0);
+ text(p, 'Playground', 60, 110, .2, { size: 40, weight: 600 });
+ S.sys = bars(p, { A: BID, b: [1, 3, 4, 2], x0: 110, top: 172, band: 78, unit: 8, bw: 30, size: 28, t0: .3 });
+ const hint = text(p, 'try: make column 2 the same as column 1, then try to match b; drag b’s bars', 330, 110, m('go'), { size: 24, fill: COL.dim });
+ hide(hint, m('go') + 8, .6);
+ }, { ask: playAsk(() => S.sys, { pos: { x: 40, y: 560, w: 1000, cls: 'side' }, tip: 'Four columns, their amounts, A x and b. Change any number or drag any bar. Nothing is marked.' }) }],
+ ['finish', 'Finished', () => { panel(0); }, { ask: finishCard }],
+].map(([id, title, run, extra]) => ({ id, title, run, ...extra }));
+
+boot();
+</script>
+</body>
+</html>
diff --git a/site/linear-algebra/index.html b/site/linear-algebra/index.html
index dcb202d..9cd266b 100644
--- a/site/linear-algebra/index.html
+++ b/site/linear-algebra/index.html
@@ -72,7 +72,7 @@
Contents.book({
start: { unit: 1, chapter: 1 },
units: [ // [unit title, [[chapter title, minutes], ...]]
- ['The Geometry of Linear Equations', [['One Equation, One Line', 10], ['Two Equations, One Point', 11], ['Crossing, Parallel or the Same Line', 10], ['Vectors: Arrows and Columns of Numbers', 9], ['Adding and Stretching Vectors', 10], ['Linear Combinations', 10], ['The Column Picture', 10], ['Matrices and Ax = b', 10], ['Matrix Times Vector, Two Ways', 10], ['A Matrix Moves the Whole Plane', 10], ['Three Unknowns: A Plane in Space', 12], ['Three Planes, One Point', 14], ['Three Columns in Space', 13], ['Can We Solve for Every b?', 10]]],
+ ['The Geometry of Linear Equations', [['One Equation, One Line', 10], ['Two Equations, One Point', 11], ['Crossing, Parallel or the Same Line', 10], ['Vectors: Arrows and Columns of Numbers', 9], ['Adding and Stretching Vectors', 10], ['Linear Combinations', 10], ['The Column Picture', 10], ['Matrices and Ax = b', 10], ['Matrix Times Vector, Two Ways', 10], ['A Matrix Moves the Whole Plane', 10], ['Three Unknowns: A Plane in Space', 12], ['Three Planes, One Point', 14], ['Three Columns in Space', 13], ['Can We Solve for Every b?', 10], ['More Numbers Than Axes', 9]]],
],
hues: ['#f4a48c', '#86c9e8', '#f3c95c', '#e8a0c8', '#8fd6b0', '#bba8ee', '#f0b45a'], // one colour per unit, cycling
});