Update math chapter weights, enhance content clarity in directed numbers section, and add new curriculum category for Foundation. Implement chapter navigation improvements and style updates for better user experience across the platform.

This commit is contained in:
Hananoshika Yomaru 2026-05-19 23:35:40 -07:00
parent be5b3dba75
commit dc3f9d193b
35 changed files with 5314 additions and 26 deletions

View file

@ -0,0 +1,437 @@
+++
title = "Algebraic fractions & formulas"
description = "Simplify and combine algebraic fractions; rearrange formulas in science contexts."
template = "chapter.html"
weight = 2
[extra]
subject = "math"
chapter_id = "algebraic-fractions-formulas"
strand = "Number & Algebra"
+++
<div class="book-prose">
<p>
An <strong>algebraic fraction</strong> is a fraction whose numerator and denominator are
polynomials (or monomials). The same ideas you use for numbers — simplify, find a common
denominator, and combine — apply here, with extra care: you may only cancel
<strong>common factors</strong>, and you must note values of the variable that would make a
denominator zero.
</p>
<h2 id="prerequisite-recap" class="book-prose__heading">Assumed knowledge recap</h2>
<p>
This chapter builds on expanding and factorising polynomials. If you have not studied those
topics yet, use the callout below as a minimal toolkit.
</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Before you start</p>
<ul>
<li>Expand: \((x+a)(x+b) = x^2 + (a+b)x + ab\).</li>
<li>
Factorise quadratics such as \(x^2 + 5x + 6 = (x+2)(x+3)\) (find two numbers that multiply
to \(6\) and add to \(5\)).
</li>
<li>Factorise by common factor: \(6x^2 - 9x = 3x(2x - 3)\).</li>
<li>
When simplifying \(\dfrac{P}{Q}\), factorise \(P\) and \(Q\) first, then cancel factors
that appear in <em>both</em> numerator and denominator — never cancel terms that are only
added or subtracted.
</li>
</ul>
</div>
<h2 id="simplify" class="book-prose__heading">Simplifying algebraic fractions</h2>
<p>
To simplify, factorise the numerator and denominator completely, then divide out any common
factors.
</p>
<div class="book-callout book-callout--formula" role="note">
<p class="book-callout__label">Rule</p>
<p class="book-formula">
\[ \frac{ac}{bc} = \frac{a}{b} \quad (b \neq 0,\; c \neq 0) \]
</p>
<p>Here \(c\) is a <em>common factor</em> of the top and bottom, not a term added to each.</p>
</div>
<p><strong>Example.</strong> Simplify \(\dfrac{x^2 - 1}{x^2 + x}\).</p>
<p>
Factorise: \(x^2 - 1 = (x-1)(x+1)\) and \(x^2 + x = x(x+1)\). Cancel the common factor
\((x+1)\):
\[ \frac{(x-1)(x+1)}{x(x+1)} = \frac{x-1}{x}, \quad x \neq 0,\; x \neq -1. \]
The restrictions matter: at \(x = -1\) the original denominator is zero.
</p>
<p><strong>Example.</strong> Simplify \(\dfrac{2x^2 - 8}{x^2 - 4}\).</p>
<p>
\[ \frac{2(x^2-4)}{x^2-4} = \frac{2(x-2)(x+2)}{(x-2)(x+2)} = 2, \quad x \neq 2,\; x \neq -2. \]
</p>
<h2 id="add-subtract" class="book-prose__heading">Adding and subtracting</h2>
<p>
Use a <strong>common denominator</strong> (the LCM of the denominators), as with numeric
fractions.
</p>
<p><strong>Example.</strong> \(\dfrac{2}{x} + \dfrac{3}{x+1}\).</p>
<p>
LCD is \(x(x+1)\):
\[ \frac{2}{x} + \frac{3}{x+1} = \frac{2(x+1) + 3x}{x(x+1)} = \frac{5x+2}{x(x+1)}, \quad x \neq 0,\; x \neq -1. \]
</p>
<p><strong>Example.</strong> \(\dfrac{1}{x-2} - \dfrac{3}{x^2 - 4}\).</p>
<p>
Note \(x^2 - 4 = (x-2)(x+2)\). With LCD \((x-2)(x+2)\):
\[ \frac{x+2}{(x-2)(x+2)} - \frac{3}{(x-2)(x+2)} = \frac{x-1}{(x-2)(x+2)}, \quad x \neq 2,\; x \neq -2. \]
</p>
<h2 id="multiply-divide" class="book-prose__heading">Multiplying and dividing</h2>
<p>
Multiply numerators and denominators; factorise before cancelling. To divide, multiply by the
reciprocal of the divisor.
</p>
<div class="book-callout book-callout--formula" role="note">
<p class="book-callout__label">Divide</p>
<p class="book-formula">
\[ \frac{A}{B} \div \frac{C}{D} = \frac{A}{B} \times \frac{D}{C} \]
</p>
</div>
<p><strong>Example.</strong> \(\dfrac{x^2 - 9}{2x} \times \dfrac{4}{x+3}\).</p>
<p>
\[ \frac{(x-3)(x+3)}{2x} \times \frac{4}{x+3} = \frac{4(x-3)}{2x} = \frac{2(x-3)}{x}, \quad x \neq 0,\; x \neq -3. \]
</p>
<p><strong>Example.</strong> \(\dfrac{x^2 - 1}{x+1} \div \dfrac{x-1}{2}\).</p>
<p>
\[ \frac{(x-1)(x+1)}{x+1} \times \frac{2}{x-1} = 2, \quad x \neq -1,\; x \neq 1. \]
</p>
<h2 id="harder-cases" class="book-prose__heading">Harder examples</h2>
<p>
These use the same rules; the algebra is longer. Work factorisation and the LCD carefully.
</p>
<p><strong>Example.</strong> \(\dfrac{1}{x} + \dfrac{1}{x+1}\) (already seen) gives
\(\dfrac{5x+2}{x(x+1)}\).</p>
<p><strong>Example.</strong> Simplify \(\dfrac{x}{x^2 - 5x + 6}\).</p>
<p>
Factorise \(x^2 - 5x + 6 = (x-2)(x-3)\):
\[ \frac{x}{(x-2)(x-3)}, \quad x \neq 2,\; x \neq 3. \]
</p>
<h2 id="change-subject" class="book-prose__heading">Changing the subject of a formula</h2>
<p>
A <strong>formula</strong> links several quantities. <strong>Changing the subject</strong> means
rewriting the formula so that one chosen letter stands alone on one side — like solving an
equation for that letter.
</p>
<p>
Undo operations in <strong>reverse order</strong> to how they build the right-hand side: if the
target variable is multiplied, divide; if it is inside a bracket, expand or divide through;
if it appears in a denominator, multiply both sides by that denominator.
</p>
<p><strong>Example.</strong> Make \(t\) the subject of \(v = \dfrac{d}{t}\) (\(t \neq 0\)).</p>
<p>
Multiply both sides by \(t\): \(vt = d\). Divide by \(v\) (assuming \(v \neq 0\)):
\[ t = \frac{d}{v}. \]
</p>
<p><strong>Example.</strong> Make \(A\) the subject of \(P = \dfrac{F}{A}\) (\(A \neq 0\)).</p>
<p>
Multiply by \(A\): \(PA = F\), so \(A = \dfrac{F}{P}\) (\(P \neq 0\)).
</p>
<p><strong>Example.</strong> Make \(R\) the subject of \(V = IR\).</p>
<p>
Divide by \(I\) (assuming \(I \neq 0\)): \(R = \dfrac{V}{I}\).
</p>
<div class="book-table-wrap">
<table class="book-table">
<thead>
<tr>
<th scope="col">Formula</th>
<th scope="col">Meaning (typical units)</th>
</tr>
</thead>
<tbody>
<tr>
<td>\(v = d/t\)</td>
<td>speed = distance ÷ time</td>
</tr>
<tr>
<td>\(P = F/A\)</td>
<td>pressure = force ÷ area</td>
</tr>
<tr>
<td>\(V = IR\)</td>
<td>voltage = current × resistance</td>
</tr>
<tr>
<td>\(\rho = m/V\)</td>
<td>density = mass ÷ volume</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="book-prose">
<h2 id="history" class="book-prose__heading">History</h2>
<p>
For centuries, algebra was written in words. In the 16th and 17th centuries, mathematicians such
as <strong>François Viète</strong> began to use letters systematically for both unknowns and
known parameters. That made <strong>formulas</strong> — general relationships such as
\(v = d/t\) — easy to rearrange without repeating long verbal rules.
</p>
<p>
Rational expressions (fractions built from polynomials) appear whenever you divide one polynomial
by another. Scientists from <strong>Galileo</strong> onward used ratios and proportionalities in
motion; later, <strong>Newton’s</strong> laws and electrical laws (e.g. \(V = IR\)) relied on
changing the subject of a formula to solve for the quantity you can measure.
</p>
<p>
Today, algebraic fractions show up in simplifying models, in calculus limits, and whenever a
relationship is written as one quantity divided by another.
</p>
<h2 id="derivation" class="book-prose__heading">Derivation</h2>
<h3 id="why-cancel" class="book-prose__heading">Why can we cancel a common factor?</h3>
<p>
If \(c \neq 0\), then \(\dfrac{ac}{bc} = \dfrac{a}{b}\) because multiplying numerator and
denominator by the same non-zero number does not change the value of a numeric fraction; the
same idea holds when \(c\) is a polynomial factor shared by top and bottom.
</p>
<p>
You <em>cannot</em> cancel in \(\dfrac{a+c}{b+c}\) in general — that would mean, for example,
\(\dfrac{1+2}{3+2} = \dfrac{1}{3}\), which is false. Only <strong>factors</strong>, not
<strong>terms</strong>, may be cancelled.
</p>
<h3 id="why-reverse-ops" class="book-prose__heading">Why reverse the order of operations?</h3>
<p>
A formula like \(v = d/t\) builds \(v\) by first dividing \(d\) by \(t\). To recover \(t\),
undo division by multiplying: \(vt = d\), then undo multiplication by \(v\) (when \(v \neq 0\))
to get \(t = d/v\). Each step reverses one operation that was applied to the subject you want.
</p>
<h2 id="checkpoints" class="book-prose__heading">Checkpoints</h2>
<p>
Pause and reason before continuing. Discuss with a partner or write your work in a notebook.
</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Simplify \(\dfrac{x^2 - 4}{x + 2}\). What value of \(x\) must be excluded?
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Can you cancel the \(x\) in \(\dfrac{x + 1}{x}\)? Explain briefly.
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Write \(\dfrac{3}{x} - \dfrac{1}{2x}\) as a single fraction in simplest form.
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Make \(d\) the subject of \(v = \dfrac{d}{t}\). State any conditions on \(t\) and \(v\).
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
A wire obeys \(V = IR\). If voltage and resistance are known, which formula gives current?
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Simplify \(\dfrac{1}{x} + \dfrac{1}{x+1}\). What is the common denominator?
</p>
</div>
<h2 id="applications" class="book-prose__heading">Applications</h2>
<h3 id="uniform-motion" class="book-prose__heading">Uniform motion</h3>
<p>
For constant speed, distance \(d\), speed \(v\), and time \(t\) are related by \(v = d/t\). If a
train travels \(240\) km in \(3\) h, then \(v = 240/3 = 80\) km/h. If you know \(v\) and \(t\)
but need distance, rearrange to \(d = vt\).
</p>
<div class="math-widget-mount" data-widget="formula-rearrange-demo" data-pagefind-ignore></div>
<h3 id="density" class="book-prose__heading">Density</h3>
<p>
Density \(\rho\) (rho) is mass per unit volume: \(\rho = m/V\). A block of mass \(2.7\) kg with
volume \(0.001\) m³ has \(\rho = 2.7/0.001 = 2700\) kg/m³. To find mass from \(\rho\) and \(V\),
use \(m = \rho V\).
</p>
<h3 id="pressure-circuits" class="book-prose__heading">Pressure and electric circuits</h3>
<p>
Pressure \(P = F/A\) links force \(F\) and area \(A\). Hydraulic and weather models often solve
for \(F = PA\). In a resistor, \(V = IR\) gives voltage from current and resistance; rearrange
to \(I = V/R\) when you know voltage and resistance.
</p>
<div class="math-widget-mount" data-widget="fraction-simplify-demo" data-pagefind-ignore></div>
<h2 id="question-bank" class="book-prose__heading">Question bank</h2>
<p>
Work each question, then open the solution to check your reasoning. Difficulty increases
through the sets.
</p>
<h3 id="questions-easy" class="book-prose__heading">Easy</h3>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(\dfrac{6x}{3x}\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(2\), with \(x \neq 0\).</p>
<p><strong>Steps:</strong> Cancel the common factor \(3x\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(\dfrac{x^2}{x}\) for \(x \neq 0\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(x\).</p>
<p><strong>Explanation:</strong> Cancel one factor \(x\) from numerator and denominator.</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Make \(d\) the subject of \(v = d/t\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(d = vt\) (\(t \neq 0\) when rearranging from the original).</p>
<p><strong>Steps:</strong> Multiply both sides by \(t\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Make \(R\) the subject of \(V = IR\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(R = V/I\) (\(I \neq 0\)).</p>
<p><strong>Steps:</strong> Divide both sides by \(I\).</p>
</div>
</details>
<h3 id="questions-intermediate" class="book-prose__heading">Intermediate</h3>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(\dfrac{x^2 - 9}{x + 3}\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(x - 3\), with \(x \neq -3\).</p>
<p><strong>Steps:</strong> \(x^2 - 9 = (x-3)(x+3)\); cancel \((x+3)\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">\(\dfrac{2}{x} + \dfrac{1}{x} = \) ______</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(\dfrac{3}{x}\), \(x \neq 0\).</p>
<p><strong>Explanation:</strong> Same denominator already.</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(\dfrac{x^2 - 1}{x^2 + x}\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(\dfrac{x-1}{x}\), \(x \neq 0,\; x \neq -1\).</p>
<p><strong>Steps:</strong> Factorise; cancel \((x+1)\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Make \(m\) the subject of \(\rho = m/V\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(m = \rho V\) (\(V \neq 0\) in the original).</p>
<p><strong>Steps:</strong> Multiply both sides by \(V\).</p>
</div>
</details>
<h3 id="questions-difficult" class="book-prose__heading">Difficult</h3>
<details class="book-question">
<summary class="book-question__prompt">\(\dfrac{1}{x} + \dfrac{2}{x+1} = \) ______</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(\dfrac{3x+1}{x(x+1)}\), \(x \neq 0,\; x \neq -1\).</p>
<p><strong>Steps:</strong> LCD \(x(x+1)\); numerator \( (x+1) + 2x = 3x+1\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">\(\dfrac{x}{2} \times \dfrac{4}{x^2} = \) ______</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(\dfrac{2}{x}\), \(x \neq 0\).</p>
<p><strong>Steps:</strong> Multiply; cancel a factor \(x\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(\dfrac{1}{x-2} - \dfrac{3}{x^2 - 4}\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(\dfrac{x-1}{(x-2)(x+2)}\), \(x \neq 2,\; x \neq -2\).</p>
<p><strong>Steps:</strong> Write \(x^2-4 = (x-2)(x+2)\); common denominator \((x-2)(x+2)\).</p>
</div>
</details>
<h3 id="questions-hardcore" class="book-prose__heading">Hardcore</h3>
<details class="book-question">
<summary class="book-question__prompt">\(\dfrac{x^2 - 1}{x+1} \div \dfrac{x-1}{2} = \) ______</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(2\), with \(x \neq -1,\; x \neq 1\).</p>
<p><strong>Steps:</strong> Factorise \(x^2-1\); multiply by reciprocal; cancel \((x-1)\) and \((x+1)\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Make \(t\) the subject of \(v = \dfrac{d}{t}\) and then find \(t\) when \(d = 150\) km and \(v = 75\) km/h.</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(t = d/v = 2\) h.</p>
<p><strong>Steps:</strong> \(vt = d \Rightarrow t = d/v\); substitute values.</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Simplify fully: \(\dfrac{2x^2 - 8}{x^2 - 4}\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(2\), \(x \neq 2,\; x \neq -2\).</p>
<p><strong>Steps:</strong> Factorise numerator \(2(x^2-4)\) and denominator \((x-2)(x+2)\); cancel \((x-2)(x+2)\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">A formula is \(P = \dfrac{F}{A}\). The force is \(120\) N and the area is \(0.05\) m². Find \(P\), then make \(F\) the subject and verify your force value.</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(P = 120/0.05 = 2400\) Pa; \(F = PA = 2400 \times 0.05 = 120\) N.</p>
<p><strong>Explanation:</strong> Rearranging checks that the formula is consistent.</p>
</div>
</details>
<h2 id="references" class="book-prose__heading">References</h2>
<ul>
<li>Viète, <em>In artem analyticem isagoge</em> (1591) — early systematic use of letters in algebra.</li>
<li>HKDSE Compulsory Part — Number and Algebra (algebraic fractions, formulas and identities).</li>
</ul>
</div>

View file

@ -0,0 +1,49 @@
.formula-rearrange-demo__select {
width: 100%;
max-width: 100%;
padding: 0.5rem 0.65rem;
border: 1px solid var(--line);
border-radius: 8px;
font-family: var(--body);
font-size: 0.9rem;
color: var(--ink);
background: var(--card-bg);
}
.fraction-simplify-demo__steps,
.formula-rearrange-demo__steps {
margin: 0;
padding: 0;
list-style: none;
display: flex;
flex-direction: column;
gap: 14px;
}
.fraction-simplify-demo__steps > li,
.formula-rearrange-demo__steps > li {
display: flex;
flex-direction: column;
gap: 6px;
padding: 12px;
border: 1px solid var(--line);
border-radius: 10px;
background: rgba(154, 107, 46, 0.04);
}
.fraction-simplify-demo__step-label {
font-family: var(--mono);
font-size: 0.65rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--muted);
}
.scenario-demo__formula--inline {
font-size: 0.95rem;
}
.fraction-simplify-demo__restriction .katex {
font-size: 0.95rem;
}

View file

@ -0,0 +1,171 @@
<div class="book-prose">
<p>
An <strong>algebraic fraction</strong> is a fraction whose numerator and denominator are
polynomials (or monomials). The same ideas you use for numbers — simplify, find a common
denominator, and combine — apply here, with extra care: you may only cancel
<strong>common factors</strong>, and you must note values of the variable that would make a
denominator zero.
</p>
<h2 id="prerequisite-recap" class="book-prose__heading">Assumed knowledge recap</h2>
<p>
This chapter builds on expanding and factorising polynomials. If you have not studied those
topics yet, use the callout below as a minimal toolkit.
</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Before you start</p>
<ul>
<li>Expand: \((x+a)(x+b) = x^2 + (a+b)x + ab\).</li>
<li>
Factorise quadratics such as \(x^2 + 5x + 6 = (x+2)(x+3)\) (find two numbers that multiply
to \(6\) and add to \(5\)).
</li>
<li>Factorise by common factor: \(6x^2 - 9x = 3x(2x - 3)\).</li>
<li>
When simplifying \(\dfrac{P}{Q}\), factorise \(P\) and \(Q\) first, then cancel factors
that appear in <em>both</em> numerator and denominator — never cancel terms that are only
added or subtracted.
</li>
</ul>
</div>
<h2 id="simplify" class="book-prose__heading">Simplifying algebraic fractions</h2>
<p>
To simplify, factorise the numerator and denominator completely, then divide out any common
factors.
</p>
<div class="book-callout book-callout--formula" role="note">
<p class="book-callout__label">Rule</p>
<p class="book-formula">
\[ \frac{ac}{bc} = \frac{a}{b} \quad (b \neq 0,\; c \neq 0) \]
</p>
<p>Here \(c\) is a <em>common factor</em> of the top and bottom, not a term added to each.</p>
</div>
<p><strong>Example.</strong> Simplify \(\dfrac{x^2 - 1}{x^2 + x}\).</p>
<p>
Factorise: \(x^2 - 1 = (x-1)(x+1)\) and \(x^2 + x = x(x+1)\). Cancel the common factor
\((x+1)\):
\[ \frac{(x-1)(x+1)}{x(x+1)} = \frac{x-1}{x}, \quad x \neq 0,\; x \neq -1. \]
The restrictions matter: at \(x = -1\) the original denominator is zero.
</p>
<p><strong>Example.</strong> Simplify \(\dfrac{2x^2 - 8}{x^2 - 4}\).</p>
<p>
\[ \frac{2(x^2-4)}{x^2-4} = \frac{2(x-2)(x+2)}{(x-2)(x+2)} = 2, \quad x \neq 2,\; x \neq -2. \]
</p>
<h2 id="add-subtract" class="book-prose__heading">Adding and subtracting</h2>
<p>
Use a <strong>common denominator</strong> (the LCM of the denominators), as with numeric
fractions.
</p>
<p><strong>Example.</strong> \(\dfrac{2}{x} + \dfrac{3}{x+1}\).</p>
<p>
LCD is \(x(x+1)\):
\[ \frac{2}{x} + \frac{3}{x+1} = \frac{2(x+1) + 3x}{x(x+1)} = \frac{5x+2}{x(x+1)}, \quad x \neq 0,\; x \neq -1. \]
</p>
<p><strong>Example.</strong> \(\dfrac{1}{x-2} - \dfrac{3}{x^2 - 4}\).</p>
<p>
Note \(x^2 - 4 = (x-2)(x+2)\). With LCD \((x-2)(x+2)\):
\[ \frac{x+2}{(x-2)(x+2)} - \frac{3}{(x-2)(x+2)} = \frac{x-1}{(x-2)(x+2)}, \quad x \neq 2,\; x \neq -2. \]
</p>
<h2 id="multiply-divide" class="book-prose__heading">Multiplying and dividing</h2>
<p>
Multiply numerators and denominators; factorise before cancelling. To divide, multiply by the
reciprocal of the divisor.
</p>
<div class="book-callout book-callout--formula" role="note">
<p class="book-callout__label">Divide</p>
<p class="book-formula">
\[ \frac{A}{B} \div \frac{C}{D} = \frac{A}{B} \times \frac{D}{C} \]
</p>
</div>
<p><strong>Example.</strong> \(\dfrac{x^2 - 9}{2x} \times \dfrac{4}{x+3}\).</p>
<p>
\[ \frac{(x-3)(x+3)}{2x} \times \frac{4}{x+3} = \frac{4(x-3)}{2x} = \frac{2(x-3)}{x}, \quad x \neq 0,\; x \neq -3. \]
</p>
<p><strong>Example.</strong> \(\dfrac{x^2 - 1}{x+1} \div \dfrac{x-1}{2}\).</p>
<p>
\[ \frac{(x-1)(x+1)}{x+1} \times \frac{2}{x-1} = 2, \quad x \neq -1,\; x \neq 1. \]
</p>
<h2 id="harder-cases" class="book-prose__heading">Harder examples</h2>
<p>
These use the same rules; the algebra is longer. Work factorisation and the LCD carefully.
</p>
<p><strong>Example.</strong> \(\dfrac{1}{x} + \dfrac{1}{x+1}\) (already seen) gives
\(\dfrac{5x+2}{x(x+1)}\).</p>
<p><strong>Example.</strong> Simplify \(\dfrac{x}{x^2 - 5x + 6}\).</p>
<p>
Factorise \(x^2 - 5x + 6 = (x-2)(x-3)\):
\[ \frac{x}{(x-2)(x-3)}, \quad x \neq 2,\; x \neq 3. \]
</p>
<h2 id="change-subject" class="book-prose__heading">Changing the subject of a formula</h2>
<p>
A <strong>formula</strong> links several quantities. <strong>Changing the subject</strong> means
rewriting the formula so that one chosen letter stands alone on one side — like solving an
equation for that letter.
</p>
<p>
Undo operations in <strong>reverse order</strong> to how they build the right-hand side: if the
target variable is multiplied, divide; if it is inside a bracket, expand or divide through;
if it appears in a denominator, multiply both sides by that denominator.
</p>
<p><strong>Example.</strong> Make \(t\) the subject of \(v = \dfrac{d}{t}\) (\(t \neq 0\)).</p>
<p>
Multiply both sides by \(t\): \(vt = d\). Divide by \(v\) (assuming \(v \neq 0\)):
\[ t = \frac{d}{v}. \]
</p>
<p><strong>Example.</strong> Make \(A\) the subject of \(P = \dfrac{F}{A}\) (\(A \neq 0\)).</p>
<p>
Multiply by \(A\): \(PA = F\), so \(A = \dfrac{F}{P}\) (\(P \neq 0\)).
</p>
<p><strong>Example.</strong> Make \(R\) the subject of \(V = IR\).</p>
<p>
Divide by \(I\) (assuming \(I \neq 0\)): \(R = \dfrac{V}{I}\).
</p>
<div class="book-table-wrap">
<table class="book-table">
<thead>
<tr>
<th scope="col">Formula</th>
<th scope="col">Meaning (typical units)</th>
</tr>
</thead>
<tbody>
<tr>
<td>\(v = d/t\)</td>
<td>speed = distance ÷ time</td>
</tr>
<tr>
<td>\(P = F/A\)</td>
<td>pressure = force ÷ area</td>
</tr>
<tr>
<td>\(V = IR\)</td>
<td>voltage = current × resistance</td>
</tr>
<tr>
<td>\(\rho = m/V\)</td>
<td>density = mass ÷ volume</td>
</tr>
</tbody>
</table>
</div>
</div>

View file

@ -0,0 +1,254 @@
<div class="book-prose">
<h2 id="history" class="book-prose__heading">History</h2>
<p>
For centuries, algebra was written in words. In the 16th and 17th centuries, mathematicians such
as <strong>François Viète</strong> began to use letters systematically for both unknowns and
known parameters. That made <strong>formulas</strong> — general relationships such as
\(v = d/t\) — easy to rearrange without repeating long verbal rules.
</p>
<p>
Rational expressions (fractions built from polynomials) appear whenever you divide one polynomial
by another. Scientists from <strong>Galileo</strong> onward used ratios and proportionalities in
motion; later, <strong>Newton’s</strong> laws and electrical laws (e.g. \(V = IR\)) relied on
changing the subject of a formula to solve for the quantity you can measure.
</p>
<p>
Today, algebraic fractions show up in simplifying models, in calculus limits, and whenever a
relationship is written as one quantity divided by another.
</p>
<h2 id="derivation" class="book-prose__heading">Derivation</h2>
<h3 id="why-cancel" class="book-prose__heading">Why can we cancel a common factor?</h3>
<p>
If \(c \neq 0\), then \(\dfrac{ac}{bc} = \dfrac{a}{b}\) because multiplying numerator and
denominator by the same non-zero number does not change the value of a numeric fraction; the
same idea holds when \(c\) is a polynomial factor shared by top and bottom.
</p>
<p>
You <em>cannot</em> cancel in \(\dfrac{a+c}{b+c}\) in general — that would mean, for example,
\(\dfrac{1+2}{3+2} = \dfrac{1}{3}\), which is false. Only <strong>factors</strong>, not
<strong>terms</strong>, may be cancelled.
</p>
<h3 id="why-reverse-ops" class="book-prose__heading">Why reverse the order of operations?</h3>
<p>
A formula like \(v = d/t\) builds \(v\) by first dividing \(d\) by \(t\). To recover \(t\),
undo division by multiplying: \(vt = d\), then undo multiplication by \(v\) (when \(v \neq 0\))
to get \(t = d/v\). Each step reverses one operation that was applied to the subject you want.
</p>
<h2 id="checkpoints" class="book-prose__heading">Checkpoints</h2>
<p>
Pause and reason before continuing. Discuss with a partner or write your work in a notebook.
</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Simplify \(\dfrac{x^2 - 4}{x + 2}\). What value of \(x\) must be excluded?
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Can you cancel the \(x\) in \(\dfrac{x + 1}{x}\)? Explain briefly.
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Write \(\dfrac{3}{x} - \dfrac{1}{2x}\) as a single fraction in simplest form.
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Make \(d\) the subject of \(v = \dfrac{d}{t}\). State any conditions on \(t\) and \(v\).
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
A wire obeys \(V = IR\). If voltage and resistance are known, which formula gives current?
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Simplify \(\dfrac{1}{x} + \dfrac{1}{x+1}\). What is the common denominator?
</p>
</div>
<h2 id="applications" class="book-prose__heading">Applications</h2>
<h3 id="uniform-motion" class="book-prose__heading">Uniform motion</h3>
<p>
For constant speed, distance \(d\), speed \(v\), and time \(t\) are related by \(v = d/t\). If a
train travels \(240\) km in \(3\) h, then \(v = 240/3 = 80\) km/h. If you know \(v\) and \(t\)
but need distance, rearrange to \(d = vt\).
</p>
<div class="math-widget-mount" data-widget="formula-rearrange-demo" data-pagefind-ignore></div>
<h3 id="density" class="book-prose__heading">Density</h3>
<p>
Density \(\rho\) (rho) is mass per unit volume: \(\rho = m/V\). A block of mass \(2.7\) kg with
volume \(0.001\) m³ has \(\rho = 2.7/0.001 = 2700\) kg/m³. To find mass from \(\rho\) and \(V\),
use \(m = \rho V\).
</p>
<h3 id="pressure-circuits" class="book-prose__heading">Pressure and electric circuits</h3>
<p>
Pressure \(P = F/A\) links force \(F\) and area \(A\). Hydraulic and weather models often solve
for \(F = PA\). In a resistor, \(V = IR\) gives voltage from current and resistance; rearrange
to \(I = V/R\) when you know voltage and resistance.
</p>
<div class="math-widget-mount" data-widget="fraction-simplify-demo" data-pagefind-ignore></div>
<h2 id="question-bank" class="book-prose__heading">Question bank</h2>
<p>
Work each question, then open the solution to check your reasoning. Difficulty increases
through the sets.
</p>
<h3 id="questions-easy" class="book-prose__heading">Easy</h3>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(\dfrac{6x}{3x}\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(2\), with \(x \neq 0\).</p>
<p><strong>Steps:</strong> Cancel the common factor \(3x\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(\dfrac{x^2}{x}\) for \(x \neq 0\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(x\).</p>
<p><strong>Explanation:</strong> Cancel one factor \(x\) from numerator and denominator.</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Make \(d\) the subject of \(v = d/t\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(d = vt\) (\(t \neq 0\) when rearranging from the original).</p>
<p><strong>Steps:</strong> Multiply both sides by \(t\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Make \(R\) the subject of \(V = IR\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(R = V/I\) (\(I \neq 0\)).</p>
<p><strong>Steps:</strong> Divide both sides by \(I\).</p>
</div>
</details>
<h3 id="questions-intermediate" class="book-prose__heading">Intermediate</h3>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(\dfrac{x^2 - 9}{x + 3}\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(x - 3\), with \(x \neq -3\).</p>
<p><strong>Steps:</strong> \(x^2 - 9 = (x-3)(x+3)\); cancel \((x+3)\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">\(\dfrac{2}{x} + \dfrac{1}{x} = \) ______</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(\dfrac{3}{x}\), \(x \neq 0\).</p>
<p><strong>Explanation:</strong> Same denominator already.</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(\dfrac{x^2 - 1}{x^2 + x}\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(\dfrac{x-1}{x}\), \(x \neq 0,\; x \neq -1\).</p>
<p><strong>Steps:</strong> Factorise; cancel \((x+1)\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Make \(m\) the subject of \(\rho = m/V\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(m = \rho V\) (\(V \neq 0\) in the original).</p>
<p><strong>Steps:</strong> Multiply both sides by \(V\).</p>
</div>
</details>
<h3 id="questions-difficult" class="book-prose__heading">Difficult</h3>
<details class="book-question">
<summary class="book-question__prompt">\(\dfrac{1}{x} + \dfrac{2}{x+1} = \) ______</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(\dfrac{3x+1}{x(x+1)}\), \(x \neq 0,\; x \neq -1\).</p>
<p><strong>Steps:</strong> LCD \(x(x+1)\); numerator \( (x+1) + 2x = 3x+1\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">\(\dfrac{x}{2} \times \dfrac{4}{x^2} = \) ______</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(\dfrac{2}{x}\), \(x \neq 0\).</p>
<p><strong>Steps:</strong> Multiply; cancel a factor \(x\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(\dfrac{1}{x-2} - \dfrac{3}{x^2 - 4}\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(\dfrac{x-1}{(x-2)(x+2)}\), \(x \neq 2,\; x \neq -2\).</p>
<p><strong>Steps:</strong> Write \(x^2-4 = (x-2)(x+2)\); common denominator \((x-2)(x+2)\).</p>
</div>
</details>
<h3 id="questions-hardcore" class="book-prose__heading">Hardcore</h3>
<details class="book-question">
<summary class="book-question__prompt">\(\dfrac{x^2 - 1}{x+1} \div \dfrac{x-1}{2} = \) ______</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(2\), with \(x \neq -1,\; x \neq 1\).</p>
<p><strong>Steps:</strong> Factorise \(x^2-1\); multiply by reciprocal; cancel \((x-1)\) and \((x+1)\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Make \(t\) the subject of \(v = \dfrac{d}{t}\) and then find \(t\) when \(d = 150\) km and \(v = 75\) km/h.</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(t = d/v = 2\) h.</p>
<p><strong>Steps:</strong> \(vt = d \Rightarrow t = d/v\); substitute values.</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Simplify fully: \(\dfrac{2x^2 - 8}{x^2 - 4}\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(2\), \(x \neq 2,\; x \neq -2\).</p>
<p><strong>Steps:</strong> Factorise numerator \(2(x^2-4)\) and denominator \((x-2)(x+2)\); cancel \((x-2)(x+2)\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">A formula is \(P = \dfrac{F}{A}\). The force is \(120\) N and the area is \(0.05\) m². Find \(P\), then make \(F\) the subject and verify your force value.</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(P = 120/0.05 = 2400\) Pa; \(F = PA = 2400 \times 0.05 = 120\) N.</p>
<p><strong>Explanation:</strong> Rearranging checks that the formula is consistent.</p>
</div>
</details>
<h2 id="references" class="book-prose__heading">References</h2>
<ul>
<li>Viète, <em>In artem analyticem isagoge</em> (1591) — early systematic use of letters in algebra.</li>
<li>HKDSE Compulsory Part — Number and Algebra (algebraic fractions, formulas and identities).</li>
</ul>
</div>

View file

@ -0,0 +1,188 @@
import katex from "katex";
import { createMemo, createSignal, For } from "solid-js";
function renderLatex(latex: string, display = false) {
return katex.renderToString(latex, {
throwOnError: false,
strict: "ignore",
displayMode: display,
});
}
type FormulaId = "speed" | "density" | "ohm";
type SubjectId = string;
type FormulaDef = {
id: FormulaId;
label: string;
defaultSubject: SubjectId;
subjects: { id: SubjectId; label: string; result: string; steps: string[] }[];
};
const FORMULAS: FormulaDef[] = [
{
id: "speed",
label: "Speed — v = d/t",
defaultSubject: "t",
subjects: [
{
id: "t",
label: "Make t the subject",
result: String.raw`t = \frac{d}{v}`,
steps: [
String.raw`\text{Start: } v = \frac{d}{t}`,
String.raw`\text{Multiply both sides by } t \Rightarrow vt = d`,
String.raw`\text{Divide by } v \Rightarrow t = \frac{d}{v} \quad (v \neq 0)`,
],
},
{
id: "d",
label: "Make d the subject",
result: String.raw`d = vt`,
steps: [
String.raw`\text{Start: } v = \frac{d}{t}`,
String.raw`\text{Multiply both sides by } t \Rightarrow d = vt`,
],
},
{
id: "v",
label: "Make v the subject",
result: String.raw`v = \frac{d}{t}`,
steps: [String.raw`\text{Already solved for } v \text{ ( } t \neq 0 \text{)}`],
},
],
},
{
id: "density",
label: "Density — ρ = m/V",
defaultSubject: "m",
subjects: [
{
id: "m",
label: "Make m the subject",
result: String.raw`m = \rho V`,
steps: [
String.raw`\text{Start: } \rho = \frac{m}{V}`,
String.raw`\text{Multiply both sides by } V \Rightarrow m = \rho V`,
],
},
{
id: "V",
label: "Make V the subject",
result: String.raw`V = \frac{m}{\rho}`,
steps: [
String.raw`\text{Start: } \rho = \frac{m}{V}`,
String.raw`\text{Multiply by } V,\ \text{divide by } \rho \Rightarrow V = \frac{m}{\rho} \quad (\rho \neq 0)`,
],
},
{
id: "rho",
label: "Make ρ the subject",
result: String.raw`\rho = \frac{m}{V}`,
steps: [String.raw`\text{Already solved for } \rho \text{ ( } V \neq 0 \text{)}`],
},
],
},
{
id: "ohm",
label: "Voltage — V = IR",
defaultSubject: "R",
subjects: [
{
id: "R",
label: "Make R the subject",
result: String.raw`R = \frac{V}{I}`,
steps: [
String.raw`\text{Start: } V = IR`,
String.raw`\text{Divide both sides by } I \Rightarrow R = \frac{V}{I} \quad (I \neq 0)`,
],
},
{
id: "I",
label: "Make I the subject",
result: String.raw`I = \frac{V}{R}`,
steps: [
String.raw`\text{Start: } V = IR`,
String.raw`\text{Divide both sides by } R \Rightarrow I = \frac{V}{R} \quad (R \neq 0)`,
],
},
{
id: "V",
label: "Make V the subject",
result: String.raw`V = IR`,
steps: [String.raw`\text{Already solved for } V`],
},
],
},
];
function FormulaRearrangeDemo() {
const [formulaId, setFormulaId] = createSignal<FormulaId>("speed");
const [subjectId, setSubjectId] = createSignal<SubjectId>("t");
const formula = createMemo(() => FORMULAS.find((f) => f.id === formulaId()) ?? FORMULAS[0]);
const subject = createMemo(
() => formula().subjects.find((s) => s.id === subjectId()) ?? formula().subjects[0]
);
const resultHtml = createMemo(() => renderLatex(subject().result, true));
const onFormulaChange = (id: FormulaId) => {
setFormulaId(id);
const f = FORMULAS.find((x) => x.id === id);
if (f) setSubjectId(f.defaultSubject);
};
return (
<section
class="scenario-demo scenario-demo--formula-rearrange"
aria-label="Rearranging a science formula"
>
<div class="scenario-demo__stage scenario-demo__stage--wide">
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="formula-pick">
<span>Formula</span>
</label>
<select
id="formula-pick"
class="formula-rearrange-demo__select"
value={formulaId()}
onChange={(e) => onFormulaChange(e.currentTarget.value as FormulaId)}
>
<For each={FORMULAS}>{(f) => <option value={f.id}>{f.label}</option>}</For>
</select>
</div>
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="subject-pick">
<span>Target variable</span>
</label>
<select
id="subject-pick"
class="formula-rearrange-demo__select"
value={subjectId()}
onChange={(e) => setSubjectId(e.currentTarget.value)}
>
<For each={formula().subjects}>{(s) => <option value={s.id}>{s.label}</option>}</For>
</select>
</div>
<ol class="formula-rearrange-demo__steps">
<For each={subject().steps}>
{(step) => (
<li>
<div class="scenario-demo__formula scenario-demo__formula--inline" innerHTML={renderLatex(step)} />
</li>
)}
</For>
</ol>
</div>
<div class="scenario-demo__panel">
<p class="scenario-demo__live" aria-live="polite">
Result:
</p>
<div class="scenario-demo__formula" innerHTML={resultHtml()} aria-live="polite" />
</div>
</section>
);
}
export default FormulaRearrangeDemo;

View file

@ -0,0 +1,97 @@
import katex from "katex";
import { createMemo, createSignal, For } from "solid-js";
function renderLatex(latex: string) {
return katex.renderToString(latex, { throwOnError: false, strict: "ignore", displayMode: true });
}
const PRESETS = [
{
id: "difference-squares",
label: "Difference of squares",
original: String.raw`\frac{x^2 - 1}{x^2 + x}`,
factored: String.raw`\frac{(x-1)(x+1)}{x(x+1)}`,
simplified: String.raw`\frac{x-1}{x}`,
restriction: String.raw`x \neq 0,\; x \neq -1`,
},
{
id: "common-factor",
label: "Common factor in numerator",
original: String.raw`\frac{2x^2 - 8}{x^2 - 4}`,
factored: String.raw`\frac{2(x-2)(x+2)}{(x-2)(x+2)}`,
simplified: String.raw`2`,
restriction: String.raw`x \neq 2,\; x \neq -2`,
},
{
id: "quadratic-denom",
label: "Factorised quadratic denominator",
original: String.raw`\frac{x}{x^2 - 5x + 6}`,
factored: String.raw`\frac{x}{(x-2)(x-3)}`,
simplified: String.raw`\frac{x}{(x-2)(x-3)}`,
restriction: String.raw`x \neq 2,\; x \neq 3`,
},
] as const;
function FractionSimplifyDemo() {
const [presetId, setPresetId] = createSignal(PRESETS[0].id);
const preset = createMemo(() => PRESETS.find((p) => p.id === presetId()) ?? PRESETS[0]);
const originalHtml = createMemo(() => renderLatex(preset().original));
const factoredHtml = createMemo(() => renderLatex(preset().factored));
const simplifiedHtml = createMemo(() => renderLatex(preset().simplified));
const restrictionHtml = createMemo(() =>
katex.renderToString(preset().restriction, { throwOnError: false, strict: "ignore" })
);
return (
<section
class="scenario-demo scenario-demo--fraction-simplify"
aria-label="Simplifying an algebraic fraction step by step"
>
<div class="scenario-demo__stage scenario-demo__stage--wide">
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="fraction-preset">
<span>Example</span>
</label>
<select
id="fraction-preset"
class="formula-rearrange-demo__select"
value={presetId()}
onChange={(e) => setPresetId(e.currentTarget.value)}
>
<For each={PRESETS}>
{(p) => <option value={p.id}>{p.label}</option>}
</For>
</select>
</div>
<ol class="fraction-simplify-demo__steps">
<li>
<span class="fraction-simplify-demo__step-label">Original</span>
<div class="scenario-demo__formula" innerHTML={originalHtml()} />
</li>
<li>
<span class="fraction-simplify-demo__step-label">Factorise</span>
<div class="scenario-demo__formula" innerHTML={factoredHtml()} />
</li>
<li>
<span class="fraction-simplify-demo__step-label">Cancel common factors</span>
<div class="scenario-demo__formula" innerHTML={simplifiedHtml()} />
</li>
</ol>
</div>
<div class="scenario-demo__panel">
<p class="scenario-demo__live" aria-live="polite">
Cancel only factors that appear in <strong>both</strong> numerator and denominator.
</p>
<div class="scenario-demo__stat scenario-demo__stat--highlight">
<span class="scenario-demo__stat-label">Restrictions</span>
<span class="scenario-demo__stat-value fraction-simplify-demo__restriction">
<span innerHTML={restrictionHtml()} />
</span>
</div>
</div>
</section>
);
}
export default FractionSimplifyDemo;

View file

@ -0,0 +1,646 @@
+++
title = "Counting and numbers"
description = "Count from zero, spot patterns, add, multiply, and divide; then meet place value and big numbers from hundreds to billions."
template = "chapter.html"
weight = 0
[extra]
subject = "math"
chapter_id = "counting-and-numbers"
strand = "Number & Algebra"
+++
<div class="book-prose">
<p>
Look around you. How many birds? How many cups? You can answer by
<strong>counting</strong> — pointing at one thing at a time until everything has been pointed at.
This chapter uses <strong>pictures of dots</strong> to stand for real things, like marbles or
fingers.
</p>
<h2 id="what-is-counting" class="book-prose__heading">What is counting?</h2>
<p>
To <strong>count</strong> is to touch (or point at) each object once. Say a word for each touch:
“one, two, three…” The last word tells you <strong>how many</strong> there are.
</p>
<p>
Try it on your fingers: one finger up for each thing you counted. If every object has a finger,
the number of fingers matches the number of objects.
</p>
<h2 id="zero" class="book-prose__heading">Zero</h2>
<p>
When there is <strong>nothing</strong> to point at, we write <strong>0</strong> and say
<strong>zero</strong>. An empty plate, no toys in the box — zero dots:
</p>
<p class="counting-dots counting-dots--empty" aria-label="zero dots">
<span class="counting-dots__none">(none)</span>
</p>
<p>Zero comes before one when we count: first nothing, then one, then two, and so on.</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Remember</p>
<p>Zero means “none here,” not “forgot to count.”</p>
</div>
<h2 id="numbers-one-to-ten" class="book-prose__heading">Numbers 1 to 10</h2>
<p>
Each number has a <strong>digit</strong> (the symbol), a <strong>word</strong>, and a
<strong>picture of dots</strong> — one dot for each thing you counted.
</p>
<div class="book-table-wrap">
<table class="book-table counting-number-table">
<thead>
<tr>
<th scope="col">Digit</th>
<th scope="col">Word</th>
<th scope="col">Dots</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>one</td>
<td><span class="counting-dots" role="img" aria-label="1 dot"><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>2</td>
<td>two</td>
<td><span class="counting-dots" role="img" aria-label="2 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>3</td>
<td>three</td>
<td><span class="counting-dots" role="img" aria-label="3 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>4</td>
<td>four</td>
<td><span class="counting-dots" role="img" aria-label="4 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>5</td>
<td>five</td>
<td><span class="counting-dots counting-dots--five" role="img" aria-label="5 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>6</td>
<td>six</td>
<td><span class="counting-dots" role="img" aria-label="6 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>7</td>
<td>seven</td>
<td><span class="counting-dots" role="img" aria-label="7 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>8</td>
<td>eight</td>
<td><span class="counting-dots" role="img" aria-label="8 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>9</td>
<td>nine</td>
<td><span class="counting-dots" role="img" aria-label="9 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>10</td>
<td>ten</td>
<td><span class="counting-dots counting-dots--ten" role="img" aria-label="10 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
</tbody>
</table>
</div>
<p>Which group has <strong>more</strong> dots — the bigger picture wins:</p>
<figure class="counting-compare" role="group" aria-label="Seven dots is more than four dots">
<div class="counting-compare__group">
<span class="counting-compare__digit">7</span>
<span class="counting-dots counting-dots--compare" role="img" aria-hidden="true">
<span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span>
</span>
<span class="counting-compare__word">more</span>
</div>
<div class="counting-compare__group">
<span class="counting-compare__digit">4</span>
<span class="counting-dots counting-dots--compare" role="img" aria-hidden="true">
<span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span>
</span>
<span class="counting-compare__word">fewer</span>
</div>
</figure>
<h2 id="patterns" class="book-prose__heading">Patterns</h2>
<p>
A <strong>pattern</strong> is when something repeats or grows the same way each time. You can
often guess what comes next if you look at the pictures.
</p>
<h3 id="pattern-one-more" class="book-prose__heading">One more dot each time</h3>
<p>Each step adds exactly one dot:</p>
<figure class="counting-pattern-board">
<ol class="counting-pattern-ladder">
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">1</span>
<span class="counting-dots" role="img" aria-label="1 dot"><span class="counting-dots__dot"></span></span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">2</span>
<span class="counting-dots" role="img" aria-label="2 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">3</span>
<span class="counting-dots" role="img" aria-label="3 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">4</span>
<span class="counting-dots" role="img" aria-label="4 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">5</span>
<span class="counting-dots counting-dots--five" role="img" aria-label="5 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</li>
</ol>
<figcaption class="counting-pattern-board__caption">
The pictures keep growing: 6 dots, then 7, all the way to 10 — one new dot every time.
</figcaption>
</figure>
<h3 id="pattern-even" class="book-prose__heading">Two dots at a time (even numbers)</h3>
<p>
<strong>Even</strong> counts split into pairs with nothing left over. We jump two dots at a time:
</p>
<figure class="counting-pattern-board">
<ol class="counting-pattern-ladder counting-pattern-ladder--pairs">
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">0</span>
<span class="counting-dots counting-dots--empty" role="img" aria-label="0 dots"><span class="counting-dots__none">none</span></span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">2</span>
<span class="counting-dots counting-dots--pair" role="img" aria-label="2 dots in a pair">
<span class="counting-dots__dot"></span><span class="counting-dots__dot"></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">4</span>
<span class="counting-dots counting-dots--pair" role="img" aria-label="4 dots, two pairs">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">6</span>
<span class="counting-dots counting-dots--pair" role="img" aria-label="6 dots, three pairs">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">8</span>
<span class="counting-dots counting-dots--pair" role="img" aria-label="8 dots, four pairs">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">10</span>
<span class="counting-dots counting-dots--pair counting-dots--ten-pairs" role="img" aria-label="10 dots, five pairs">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</span>
</li>
</ol>
<figcaption class="counting-pattern-board__caption">
Each picture has one more <em>pair</em> of dots than the picture before. Every dot has a buddy.
</figcaption>
</figure>
<h3 id="pattern-odd" class="book-prose__heading">One extra dot (odd numbers)</h3>
<p>
<strong>Odd</strong> counts also grow by two dots each step, but there is always
<strong>one dot left alone</strong> — it does not fit in a pair. Look for the single dot in orange:
</p>
<figure class="counting-pattern-board">
<ol class="counting-pattern-ladder counting-pattern-ladder--odd">
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">1</span>
<span class="counting-dots counting-dots--odd" role="img" aria-label="1 dot, alone">
<span class="counting-dots__singleton"><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">3</span>
<span class="counting-dots counting-dots--odd" role="img" aria-label="3 dots, one pair and one alone">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__singleton"><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">5</span>
<span class="counting-dots counting-dots--odd" role="img" aria-label="5 dots, two pairs and one alone">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__singleton"><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">7</span>
<span class="counting-dots counting-dots--odd" role="img" aria-label="7 dots, three pairs and one alone">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__singleton"><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">9</span>
<span class="counting-dots counting-dots--odd" role="img" aria-label="9 dots, four pairs and one alone">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__singleton"><span class="counting-dots__dot"></span></span>
</span>
</li>
</ol>
<figcaption class="counting-pattern-board__caption">
The lonely dot stays while the pairs grow: next would be <strong>11</strong> — five pairs and
one dot by itself.
</figcaption>
</figure>
<h3 id="pattern-shapes" class="book-prose__heading">Circle, square, circle, square…</h3>
<p>Patterns can use <strong>shapes</strong>, not only dots. Watch the pictures repeat:</p>
<figure class="counting-shape-pattern" role="group" aria-label="Repeating pattern: circle, square, circle, square, circle, square, then a question mark for what comes next">
<ol class="counting-shape-pattern__strip">
<li><span class="counting-shape counting-shape--circle" aria-hidden="true"></span><span class="counting-shape-pattern__label">circle</span></li>
<li><span class="counting-shape counting-shape--square" aria-hidden="true"></span><span class="counting-shape-pattern__label">square</span></li>
<li><span class="counting-shape counting-shape--circle" aria-hidden="true"></span><span class="counting-shape-pattern__label">circle</span></li>
<li><span class="counting-shape counting-shape--square" aria-hidden="true"></span><span class="counting-shape-pattern__label">square</span></li>
<li><span class="counting-shape counting-shape--circle" aria-hidden="true"></span><span class="counting-shape-pattern__label">circle</span></li>
<li><span class="counting-shape counting-shape--square" aria-hidden="true"></span><span class="counting-shape-pattern__label">square</span></li>
<li class="counting-shape-pattern__next">
<span class="counting-shape counting-shape--question" aria-hidden="true">?</span>
<span class="counting-shape-pattern__label">next?</span>
</li>
</ol>
<figcaption class="counting-pattern-board__caption">
After a square comes a <strong>circle</strong>. The shapes take turns, over and over.
</figcaption>
</figure>
<h2 id="addition" class="book-prose__heading">Addition</h2>
<p>
<strong>Addition</strong> means putting two groups together. Three dots and four more dots make
seven dots in one big group. We write <strong>3 + 4 = 7</strong>.
</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Adding</p>
<p>Start with the first group, then place the second group beside it and count all the dots.</p>
</div>
<h2 id="multiplication" class="book-prose__heading">Multiplication</h2>
<p>
<strong>Multiplication</strong> is many <em>equal</em> groups. Three bags with two sweets each
is the same as three pairs of dots. We write <strong>3 × 2 = 6</strong> — “three groups of two.”
</p>
<p>
You can lay the dots in a <strong>rectangle</strong>: 3 rows with 2 dots in each row fills a
block of 6 dots.
</p>
<h2 id="division" class="book-prose__heading">Division</h2>
<p>
<strong>Division</strong> is about <strong>sharing equally</strong> or making equal groups. If
12 biscuits are shared among 4 friends, each friend gets the same number. We write
<strong>12 ÷ 4 = 3</strong> — “twelve split into four equal piles gives three in each pile.”
</p>
<p>
Division is the partner of multiplication. If <strong>3 × 4 = 12</strong>, then
<strong>12 ÷ 3 = 4</strong> and <strong>12 ÷ 4 = 3</strong>. One picture of dots can answer both
kinds of question.
</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Fair shares</p>
<p>
When every pile has the same number of dots, the share is <strong>fair</strong>. If dots are
left over, the total does not split evenly — those extras are the <strong>remainder</strong>.
</p>
</div>
<div class="math-widget-mount" data-widget="division-sharing" data-pagefind-ignore></div>
<h2 id="past-ten" class="book-prose__heading">Past ten: tens and hundreds</h2>
<p>
You can count higher than ten on your fingers — people use <strong>place value</strong>. Ten
single dots can be thought of as <strong>one group of ten</strong>. Ten groups of ten make
<strong>one hundred</strong>.
</p>
<figure class="counting-place-ladder" aria-label="Place value: ten ones make one ten, ten tens make one hundred">
<ol class="counting-place-ladder__steps">
<li class="counting-place-step">
<span class="counting-place-step__label">1 one</span>
<span class="counting-dots" role="img" aria-hidden="true"><span class="counting-dots__dot"></span></span>
</li>
<li class="counting-place-step counting-place-step--arrow" aria-hidden="true">× 10</li>
<li class="counting-place-step">
<span class="counting-place-step__label">1 ten</span>
<span class="counting-place-blocks counting-place-blocks--ten" role="img" aria-hidden="true">
<span class="counting-place-blocks__rod"></span>
</span>
</li>
<li class="counting-place-step counting-place-step--arrow" aria-hidden="true">× 10</li>
<li class="counting-place-step">
<span class="counting-place-step__label">1 hundred</span>
<span class="counting-place-blocks counting-place-blocks--hundred" role="img" aria-hidden="true">
<span class="counting-place-blocks__grid"></span>
</span>
</li>
</ol>
<figcaption class="counting-pattern-board__caption">
Each step bundles ten of the smaller unit. That is why our digits work in columns (ones, tens,
hundreds…).
</figcaption>
</figure>
<p>
The number <strong>47</strong> means 4 tens and 7 ones — forty-seven dots, without drawing every
dot one by one.
</p>
<h2 id="big-numbers" class="book-prose__heading">Big numbers in real life</h2>
<p>
The world is huge. Counting every grain of sand on a beach one by one would take forever, so we
use <strong>big number words</strong> to talk about amounts we cannot easily picture dot by dot.
They matter because governments, scientists, and shops all work with large totals.
</p>
<div class="book-table-wrap">
<table class="book-table counting-big-table">
<thead>
<tr>
<th scope="col">Word</th>
<th scope="col">How we write it</th>
<th scope="col">Why it matters</th>
</tr>
</thead>
<tbody>
<tr>
<td>hundred</td>
<td>100</td>
<td>About how many people fit in a big sports field; pages in a long novel.</td>
</tr>
<tr>
<td>thousand</td>
<td>1,000</td>
<td>Steps you might walk in a long hike; students in a large school district.</td>
</tr>
<tr>
<td>million</td>
<td>1,000,000</td>
<td>People in a large city; dollars in a national budget line item.</td>
</tr>
<tr>
<td>billion</td>
<td>1,000,000,000</td>
<td>World population is several <em>billion</em>; stars in our galaxy are hundreds of billions.</td>
</tr>
</tbody>
</table>
</div>
<p>
Each big word is <strong>one thousand times</strong> the word before (ten hundreds make a
thousand; one thousand thousands make a million). We bundle in tens and thousands so we can
compare and add without losing track.
</p>
<ul>
<li><strong>Money</strong> — prices and taxes use thousands and millions.</li>
<li><strong>Distance</strong> — kilometres between cities add up to thousands.</li>
<li><strong>Time</strong> — minutes in a year are in the hundreds of thousands.</li>
<li><strong>Nature</strong> — insects in a forest, cells in your body — counts go huge fast.</li>
</ul>
<div class="math-widget-mount" data-widget="big-numbers-scale" data-pagefind-ignore></div>
<h2 id="try-it-yourself" class="book-prose__heading">Try it yourself</h2>
<p>
Use the tools below: count dots, add and multiply, <strong>share equally</strong>, and zoom from
one dot up to a billion to see how big numbers compare.
</p>
</div>
<div class="math-widget-mount" data-widget="counting-demo" data-pagefind-ignore></div>
<div class="math-widget-mount" data-widget="addition-groups" data-pagefind-ignore></div>
<div class="math-widget-mount" data-widget="multiplication-array" data-pagefind-ignore></div>
<div class="book-prose">
<h2 id="history" class="book-prose__heading">History</h2>
<p>
Long before writing, people kept track of herds, harvests, and trade by making marks — tallies —
one mark for each item. Archaeologists have found tally bones tens of thousands of years old.
</p>
<p>
Different cultures invented symbols for amounts. The idea of <strong>zero</strong> as a number took
time: Indian mathematicians such as <strong>Brahmagupta</strong> (7th century CE) wrote rules for
arithmetic that included zero. The Maya used a shell sign for zero in their calendar. Zero let
people write “none” clearly and build place-value systems later on.
</p>
<p>
Multiplication grew from repeated addition in trade and land measurement — counting equal rows of
goods or fields without adding one row at a time forever.
</p>
<p>
Division appears in sharing problems as old as fair trade: split grain, land, or money into equal
parts. Large-number names (million, billion) expanded as empires, astronomy, and finance needed to
record bigger totals than everyday counting.
</p>
<h2 id="derivation" class="book-prose__heading">Derivation</h2>
<h3 id="why-addition-works" class="book-prose__heading">Why addition combines groups</h3>
<p>
Suppose the first group has \(a\) objects and the second has \(b\) objects, with no overlap. If
you put them in one pile and count from the start, you say \(a\) number words for the first
group, then continue with \(b\) more words. The last word is the total \(a + b\). That is why
\(3 + 4 = 7\): three objects, then four more, gives seven in all.
</p>
<h3 id="multiplication-as-repeated-addition" class="book-prose__heading">Multiplication as repeated addition</h3>
<p>
If there are \(r\) equal rows and each row has \(c\) dots, you can add
\(c + c + \cdots + c\) (\(r\) times) to get the total. Writing \(r \times c\) saves repeating
the same addition. For example, \(4 \times 3 = 3 + 3 + 3 + 3 = 12\).
</p>
<h3 id="division-as-fair-sharing" class="book-prose__heading">Division as fair sharing</h3>
<p>
If \(T\) dots are split into \(g\) equal piles with nothing left over, each pile has
\(T \div g\) dots. That is the same as asking: what number times \(g\) gives \(T\)? So
\(T \div g = q\) when \(g \times q = T\). Example: \(12 \div 4 = 3\) because \(4 \times 3 = 12\).
</p>
<h3 id="place-value-and-big-numbers" class="book-prose__heading">Place value and big numbers</h3>
<p>
In base ten, each column is worth ten times the column to its right. So \(47 = 4 \times 10 + 7\).
Extending the pattern: \(1{,}000 = 10^3\), \(1{,}000{,}000 = 10^6\), and each “thousand step” multiplies
by \(1{,}000\) again. That is why we group digits in threes when writing millions and billions.
</p>
<h2 id="checkpoints" class="book-prose__heading">Checkpoints</h2>
<p>Pause and answer in your head or with a partner before moving on.</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>Show the number \(7\) on your fingers. What digit symbol matches seven?</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>Which is greater: \(5\) or \(9\)? How do you know?</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>Is \(2 + 2 + 2\) the same total as \(3 \times 2\)? Explain with a picture of dots.</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>What comes next in the pattern \(2, 4, 6, 8, \ldots\)?</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>Share 15 dots into 3 equal piles. How many in each pile? What if you try 4 piles?</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>Which is bigger: 1 million or 1 thousand? How do you know?</p>
</div>
<h2 id="applications" class="book-prose__heading">Real-life applications</h2>
<ul>
<li><strong>Sharing snacks</strong> — \(6\) biscuits shared among \(3\) friends is \(6 \div 3 = 2\) each; check with \(3 \times 2 = 6\).</li>
<li><strong>Rows of chairs</strong> — a room with \(4\) rows of \(5\) chairs has \(4 \times 5 = 20\) seats.</li>
<li><strong>Egg cartons</strong> — two rows of \(5\) cups hold \(2 \times 5 = 10\) eggs.</li>
<li><strong>Counting steps</strong> — climbing \(8\) steps then \(2\) more is \(8 + 2 = 10\) steps.</li>
<li><strong>Population</strong> — countries and cities are counted in millions or billions.</li>
<li><strong>Packaging</strong> — eggs in cartons (\(2 \times 5\)) and sweets split among friends (\(12 \div 4\)).</li>
</ul>
<h2 id="question-bank" class="book-prose__heading">Question bank</h2>
<h3 id="questions-easy" class="book-prose__heading">Easy</h3>
<details class="book-question">
<summary class="book-question__prompt">How many fingers on one hand?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(5\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">What digit means “none”?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(0\) (zero).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Compute \(2 + 5\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(7\).</p>
<p><strong>Steps:</strong> Two objects plus five more gives seven.</p>
</div>
</details>
<h3 id="questions-intermediate" class="book-prose__heading">Intermediate</h3>
<details class="book-question">
<summary class="book-question__prompt">Compute \(6 + 4\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(10\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Compute \(3 \times 4\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(12\).</p>
<p><strong>Steps:</strong> \(4 + 4 + 4 = 12\), or four rows of three dots.</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Which is larger: \(8\) or \(6\)?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(8\) is larger.</p>
</div>
</details>
<h3 id="questions-difficult" class="book-prose__heading">Difficult</h3>
<details class="book-question">
<summary class="book-question__prompt">Compute \(5 + 3 + 2\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(10\).</p>
<p><strong>Steps:</strong> \(5 + 3 = 8\), then \(8 + 2 = 10\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">A tray has \(3\) rows of \(3\) muffins. How many muffins?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(9\).</p>
<p><strong>Steps:</strong> \(3 \times 3 = 9\).</p>
</div>
</details>
<h3 id="questions-hardcore" class="book-prose__heading">Hardcore</h3>
<details class="book-question">
<summary class="book-question__prompt">Without counting one by one: if \(7 + 3 = 10\), what is \(3 + 7\)? Why?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(10\).</p>
<p><strong>Explanation:</strong> Addition of whole numbers can be done in either order (commutative property).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Show \(5 \times 2\) as both repeated addition and as a dot rectangle.</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(10\).</p>
<p><strong>Steps:</strong> \(2 + 2 + 2 + 2 + 2 = 10\); five rows of two dots (or two columns of five).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Share \(12\) dots equally among \(4\) piles. How many per pile?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(3\) per pile.</p>
<p><strong>Steps:</strong> \(12 \div 4 = 3\) because \(4 \times 3 = 12\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">How many zeros are in one million written in digits?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> Six zeros: 1,000,000.</p>
</div>
</details>
<h2 id="references" class="book-prose__heading">References</h2>
<ul>
<li>Ifrah, Georges — <em>The Universal History of Numbers</em> (origins of counting and zero).</li>
<li>Crossley &amp; Henry — early Indian arithmetic including zero.</li>
</ul>
</div>

View file

@ -0,0 +1,707 @@
// Figurative dots and patterns in chapter prose
.counting-dots {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: 5px;
vertical-align: middle;
}
.counting-dots__dot {
display: block;
width: 12px;
height: 12px;
border-radius: 50%;
background: #0f766e;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
flex-shrink: 0;
}
.counting-dots--empty .counting-dots__none {
font-size: 0.85rem;
font-style: italic;
color: var(--muted);
}
.counting-dots--compare {
max-width: 100px;
}
.counting-dots--pair {
display: inline-flex;
flex-wrap: wrap;
gap: 8px;
max-width: 200px;
}
.counting-dots__pair {
display: inline-flex;
gap: 4px;
padding: 4px 6px;
border-radius: 6px;
background: rgba(20, 184, 166, 0.12);
border: 1px dashed rgba(15, 118, 110, 0.35);
}
.counting-dots--odd {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
max-width: 220px;
}
.counting-dots__singleton {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 4px 8px;
border-radius: 6px;
background: rgba(234, 88, 12, 0.14);
border: 2px solid rgba(180, 83, 9, 0.45);
}
.counting-dots__singleton .counting-dots__dot {
background: #c2410c;
}
.counting-pattern-ladder--odd .counting-pattern-step {
background: rgba(234, 88, 12, 0.06);
}
.counting-number-table td:last-child {
min-width: 110px;
}
.counting-compare {
display: flex;
flex-wrap: wrap;
gap: 24px;
justify-content: center;
margin: 20px 0;
padding: 16px;
border: 1px solid var(--line);
border-radius: 12px;
background: var(--card-bg);
}
.counting-compare__group {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.counting-compare__digit {
font-family: var(--mono);
font-size: 1.25rem;
font-weight: 700;
}
.counting-compare__word {
font-size: 0.8rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--soft-ink);
}
.counting-pattern-board {
margin: 20px 0;
padding: 16px 18px;
border: 1px solid var(--line);
border-radius: 12px;
background: var(--card-bg);
}
.counting-pattern-ladder {
display: flex;
flex-wrap: wrap;
gap: 14px 18px;
margin: 0;
padding: 0;
list-style: none;
}
.counting-pattern-step {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
min-width: 56px;
padding: 10px 8px;
border-radius: 8px;
background: rgba(20, 184, 166, 0.06);
}
.counting-pattern-step__digit {
font-family: var(--mono);
font-size: 1.1rem;
font-weight: 700;
color: var(--ink);
}
.counting-pattern-board__caption {
margin: 14px 0 0;
font-size: 0.9rem;
color: var(--soft-ink);
text-align: center;
}
.counting-shape-pattern {
margin: 20px 0;
padding: 16px 18px;
border: 1px solid var(--line);
border-radius: 12px;
background: var(--card-bg);
}
.counting-shape-pattern__strip {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 12px 16px;
margin: 0;
padding: 0;
list-style: none;
}
.counting-shape-pattern__strip > li {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
}
.counting-shape {
display: block;
width: 36px;
height: 36px;
}
.counting-shape--circle {
border-radius: 50%;
background: rgba(59, 130, 246, 0.45);
border: 2px solid rgba(37, 99, 235, 0.5);
}
.counting-shape--square {
border-radius: 4px;
background: rgba(234, 179, 8, 0.45);
border: 2px solid rgba(180, 83, 9, 0.45);
}
.counting-shape--question {
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
border: 2px dashed var(--line);
font-family: var(--mono);
font-size: 1.25rem;
font-weight: 700;
color: var(--muted);
background: transparent;
}
.counting-shape-pattern__label {
font-size: 0.72rem;
color: var(--soft-ink);
text-transform: lowercase;
}
.counting-shape-pattern__next .counting-shape-pattern__label {
font-weight: 600;
color: var(--accent);
}
.counting-demo__objects {
display: flex;
flex-wrap: wrap;
gap: 10px;
min-height: 88px;
padding: 16px;
border: 1px dashed var(--line);
border-radius: 10px;
background: var(--card-bg);
}
.counting-demo__object {
width: 40px;
height: 40px;
border: none;
border-radius: 50%;
background: rgba(20, 184, 166, 0.35);
cursor: pointer;
transition: transform 0.12s ease, background 0.12s ease;
}
.counting-demo__object:hover {
transform: scale(1.06);
background: rgba(20, 184, 166, 0.55);
}
.counting-demo__object--active {
background: rgba(15, 118, 110, 0.75);
}
.counting-demo__count {
font-family: var(--mono);
font-size: 2rem;
font-weight: 700;
color: var(--ink);
}
.addition-groups__piles {
display: flex;
flex-wrap: wrap;
align-items: flex-end;
justify-content: center;
gap: 20px;
}
.addition-groups__pile {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.addition-groups__dots {
display: flex;
flex-wrap: wrap;
gap: 6px;
justify-content: center;
width: 140px;
min-height: 100px;
padding: 10px;
border-radius: 8px;
background: rgba(59, 130, 246, 0.08);
}
.addition-groups__pile--b .addition-groups__dots {
background: rgba(154, 107, 46, 0.12);
}
.addition-groups__dot {
width: 14px;
height: 14px;
border-radius: 50%;
background: var(--ink);
}
.addition-groups__plus,
.addition-groups__equals {
font-family: var(--mono);
font-size: 1.5rem;
font-weight: 700;
color: var(--soft-ink);
}
.addition-groups__total-dots {
display: flex;
flex-wrap: wrap;
gap: 5px;
justify-content: center;
max-width: 320px;
min-height: 48px;
margin-top: 12px;
}
.multiplication-array__grid {
display: grid;
gap: 6px;
width: fit-content;
margin: 0 auto;
padding: 12px;
border-radius: 10px;
background: var(--card-bg);
border: 1px solid var(--line);
}
.multiplication-array__cell {
width: 22px;
height: 22px;
border-radius: 50%;
background: rgba(20, 184, 166, 0.45);
}
// Place value ladder (prose)
.counting-place-ladder {
margin: 20px 0;
padding: 16px 18px;
border: 1px solid var(--line);
border-radius: 12px;
background: var(--card-bg);
}
.counting-place-ladder__steps {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 12px 16px;
margin: 0;
padding: 0;
list-style: none;
}
.counting-place-step {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.counting-place-step--arrow {
font-family: var(--mono);
font-size: 0.9rem;
font-weight: 700;
color: var(--soft-ink);
}
.counting-place-step__label {
font-size: 0.8rem;
font-weight: 600;
color: var(--soft-ink);
}
.counting-place-blocks__rod {
display: block;
width: 14px;
height: 72px;
border-radius: 4px;
background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
}
.counting-place-blocks__grid {
display: block;
width: 72px;
height: 72px;
border-radius: 6px;
background:
repeating-linear-gradient(
90deg,
rgba(15, 118, 110, 0.35) 0,
rgba(15, 118, 110, 0.35) 6px,
transparent 6px,
transparent 12px
),
repeating-linear-gradient(
rgba(15, 118, 110, 0.35) 0,
rgba(15, 118, 110, 0.35) 6px,
transparent 6px,
transparent 12px
);
border: 2px solid rgba(15, 118, 110, 0.5);
}
.counting-big-table td:first-child {
font-weight: 600;
}
// Division sharing widget
.division-sharing__equation {
margin: 12px 0;
font-family: var(--mono);
font-size: 1.05rem;
text-align: center;
}
.division-sharing__piles {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 14px;
}
.division-sharing__pile {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
}
.division-sharing__pile-label {
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--soft-ink);
}
.division-sharing__dots {
display: flex;
flex-wrap: wrap;
gap: 5px;
justify-content: center;
width: 88px;
min-height: 72px;
padding: 8px;
border-radius: 8px;
background: rgba(59, 130, 246, 0.08);
}
.division-sharing__dot {
width: 12px;
height: 12px;
border-radius: 50%;
background: var(--ink);
}
.division-sharing__dot--extra {
background: #c2410c;
}
.division-sharing__dots--remainder {
background: rgba(234, 88, 12, 0.1);
border: 1px dashed rgba(180, 83, 9, 0.45);
}
.division-sharing__uneven {
display: flex;
flex-wrap: wrap;
align-items: flex-end;
justify-content: center;
gap: 16px;
}
.division-sharing__remainder {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
}
// Big numbers scale widget
.big-numbers-scale__picker {
display: flex;
flex-wrap: wrap;
gap: 8px;
justify-content: center;
}
.big-numbers-scale__btn {
padding: 6px 12px;
border: 1px solid var(--line);
border-radius: 8px;
font-family: var(--mono);
font-size: 0.8rem;
background: var(--card-bg);
color: var(--ink);
cursor: pointer;
}
.big-numbers-scale__btn--active {
border-color: #0f766e;
background: rgba(20, 184, 166, 0.15);
font-weight: 700;
}
.big-numbers-scale__display {
margin: 16px 0 8px;
text-align: center;
}
.big-numbers-scale__number {
font-family: var(--mono);
font-size: 2rem;
font-weight: 700;
}
.big-numbers-scale__compare {
margin: 0 0 12px;
font-size: 0.9rem;
text-align: center;
color: var(--soft-ink);
}
.big-numbers-scale__visual {
display: flex;
justify-content: center;
min-height: 120px;
margin: 12px 0;
padding: 16px;
border: 1px dashed var(--line);
border-radius: 10px;
background: var(--card-bg);
}
.big-numbers-scale__grid {
display: grid;
gap: 4px;
}
.big-numbers-scale__grid--small .big-numbers-scale__cell {
width: 6px;
height: 6px;
}
.big-numbers-scale__cell {
width: 10px;
height: 10px;
border-radius: 50%;
background: #0f766e;
}
.big-numbers-scale__blocks {
display: flex;
flex-wrap: wrap;
gap: 6px;
justify-content: center;
max-width: 280px;
}
.big-numbers-scale__block {
padding: 6px 8px;
border-radius: 4px;
font-family: var(--mono);
font-size: 0.65rem;
font-weight: 700;
background: rgba(20, 184, 166, 0.2);
border: 1px solid rgba(15, 118, 110, 0.35);
}
.big-numbers-scale__block--hundred {
min-width: 36px;
text-align: center;
}
.big-numbers-scale__visual-caption {
flex: 1 1 100%;
margin: 10px 0 0;
font-size: 0.82rem;
line-height: 1.45;
text-align: center;
color: var(--soft-ink);
}
.big-numbers-scale__visual-caption--inline {
margin: 8px 0 0;
}
.big-numbers-scale__math-hint {
font-family: var(--mono);
font-size: 0.85em;
}
// 1 million: 100 × 10,000
.big-numbers-scale__million {
width: 100%;
}
.big-numbers-scale__mega-grid {
display: grid;
grid-template-columns: repeat(10, 1fr);
gap: 3px;
max-width: 280px;
margin: 0 auto;
}
.big-numbers-scale__mega-cell {
display: flex;
align-items: center;
justify-content: center;
min-height: 22px;
border-radius: 3px;
font-family: var(--mono);
font-size: 0.5rem;
font-weight: 700;
color: #0f766e;
background: rgba(20, 184, 166, 0.22);
border: 1px solid rgba(15, 118, 110, 0.35);
}
// 1 billion: mini million × 1000 → grid of 1M
.big-numbers-scale__billion {
width: 100%;
}
.big-numbers-scale__billion-compare {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 10px 14px;
}
.big-numbers-scale__billion-unit {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
padding: 8px;
border-radius: 8px;
background: rgba(20, 184, 166, 0.06);
border: 1px solid var(--line);
}
.big-numbers-scale__billion-unit--wide {
flex: 1 1 200px;
max-width: 320px;
background: rgba(234, 88, 12, 0.06);
border-color: rgba(180, 83, 9, 0.35);
}
.big-numbers-scale__billion-unit-label {
font-size: 0.72rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--soft-ink);
}
.big-numbers-scale__mini-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 2px;
}
.big-numbers-scale__mini-cell {
display: flex;
align-items: center;
justify-content: center;
width: 28px;
height: 18px;
border-radius: 2px;
font-family: var(--mono);
font-size: 0.45rem;
font-weight: 700;
color: #0f766e;
background: rgba(20, 184, 166, 0.25);
}
.big-numbers-scale__billion-times {
font-family: var(--mono);
font-size: 1rem;
font-weight: 700;
color: var(--accent);
}
.big-numbers-scale__billion-equals {
font-family: var(--mono);
font-size: 1.25rem;
font-weight: 700;
color: var(--muted);
}
.big-numbers-scale__giga-grid {
display: grid;
grid-template-columns: repeat(10, 1fr);
gap: 2px;
width: 100%;
}
.big-numbers-scale__giga-cell {
display: flex;
align-items: center;
justify-content: center;
min-height: 18px;
border-radius: 2px;
font-family: var(--mono);
font-size: 0.48rem;
font-weight: 700;
color: #9a3412;
background: rgba(234, 88, 12, 0.28);
border: 1px solid rgba(180, 83, 9, 0.4);
}

View file

@ -0,0 +1,431 @@
<div class="book-prose">
<p>
Look around you. How many birds? How many cups? You can answer by
<strong>counting</strong> — pointing at one thing at a time until everything has been pointed at.
This chapter uses <strong>pictures of dots</strong> to stand for real things, like marbles or
fingers.
</p>
<h2 id="what-is-counting" class="book-prose__heading">What is counting?</h2>
<p>
To <strong>count</strong> is to touch (or point at) each object once. Say a word for each touch:
“one, two, three…” The last word tells you <strong>how many</strong> there are.
</p>
<p>
Try it on your fingers: one finger up for each thing you counted. If every object has a finger,
the number of fingers matches the number of objects.
</p>
<h2 id="zero" class="book-prose__heading">Zero</h2>
<p>
When there is <strong>nothing</strong> to point at, we write <strong>0</strong> and say
<strong>zero</strong>. An empty plate, no toys in the box — zero dots:
</p>
<p class="counting-dots counting-dots--empty" aria-label="zero dots">
<span class="counting-dots__none">(none)</span>
</p>
<p>Zero comes before one when we count: first nothing, then one, then two, and so on.</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Remember</p>
<p>Zero means “none here,” not “forgot to count.”</p>
</div>
<h2 id="numbers-one-to-ten" class="book-prose__heading">Numbers 1 to 10</h2>
<p>
Each number has a <strong>digit</strong> (the symbol), a <strong>word</strong>, and a
<strong>picture of dots</strong> — one dot for each thing you counted.
</p>
<div class="book-table-wrap">
<table class="book-table counting-number-table">
<thead>
<tr>
<th scope="col">Digit</th>
<th scope="col">Word</th>
<th scope="col">Dots</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>one</td>
<td><span class="counting-dots" role="img" aria-label="1 dot"><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>2</td>
<td>two</td>
<td><span class="counting-dots" role="img" aria-label="2 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>3</td>
<td>three</td>
<td><span class="counting-dots" role="img" aria-label="3 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>4</td>
<td>four</td>
<td><span class="counting-dots" role="img" aria-label="4 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>5</td>
<td>five</td>
<td><span class="counting-dots counting-dots--five" role="img" aria-label="5 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>6</td>
<td>six</td>
<td><span class="counting-dots" role="img" aria-label="6 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>7</td>
<td>seven</td>
<td><span class="counting-dots" role="img" aria-label="7 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>8</td>
<td>eight</td>
<td><span class="counting-dots" role="img" aria-label="8 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>9</td>
<td>nine</td>
<td><span class="counting-dots" role="img" aria-label="9 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
<tr>
<td>10</td>
<td>ten</td>
<td><span class="counting-dots counting-dots--ten" role="img" aria-label="10 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span></td>
</tr>
</tbody>
</table>
</div>
<p>Which group has <strong>more</strong> dots — the bigger picture wins:</p>
<figure class="counting-compare" role="group" aria-label="Seven dots is more than four dots">
<div class="counting-compare__group">
<span class="counting-compare__digit">7</span>
<span class="counting-dots counting-dots--compare" role="img" aria-hidden="true">
<span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span>
</span>
<span class="counting-compare__word">more</span>
</div>
<div class="counting-compare__group">
<span class="counting-compare__digit">4</span>
<span class="counting-dots counting-dots--compare" role="img" aria-hidden="true">
<span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span>
</span>
<span class="counting-compare__word">fewer</span>
</div>
</figure>
<h2 id="patterns" class="book-prose__heading">Patterns</h2>
<p>
A <strong>pattern</strong> is when something repeats or grows the same way each time. You can
often guess what comes next if you look at the pictures.
</p>
<h3 id="pattern-one-more" class="book-prose__heading">One more dot each time</h3>
<p>Each step adds exactly one dot:</p>
<figure class="counting-pattern-board">
<ol class="counting-pattern-ladder">
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">1</span>
<span class="counting-dots" role="img" aria-label="1 dot"><span class="counting-dots__dot"></span></span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">2</span>
<span class="counting-dots" role="img" aria-label="2 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">3</span>
<span class="counting-dots" role="img" aria-label="3 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">4</span>
<span class="counting-dots" role="img" aria-label="4 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">5</span>
<span class="counting-dots counting-dots--five" role="img" aria-label="5 dots"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</li>
</ol>
<figcaption class="counting-pattern-board__caption">
The pictures keep growing: 6 dots, then 7, all the way to 10 — one new dot every time.
</figcaption>
</figure>
<h3 id="pattern-even" class="book-prose__heading">Two dots at a time (even numbers)</h3>
<p>
<strong>Even</strong> counts split into pairs with nothing left over. We jump two dots at a time:
</p>
<figure class="counting-pattern-board">
<ol class="counting-pattern-ladder counting-pattern-ladder--pairs">
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">0</span>
<span class="counting-dots counting-dots--empty" role="img" aria-label="0 dots"><span class="counting-dots__none">none</span></span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">2</span>
<span class="counting-dots counting-dots--pair" role="img" aria-label="2 dots in a pair">
<span class="counting-dots__dot"></span><span class="counting-dots__dot"></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">4</span>
<span class="counting-dots counting-dots--pair" role="img" aria-label="4 dots, two pairs">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">6</span>
<span class="counting-dots counting-dots--pair" role="img" aria-label="6 dots, three pairs">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">8</span>
<span class="counting-dots counting-dots--pair" role="img" aria-label="8 dots, four pairs">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">10</span>
<span class="counting-dots counting-dots--pair counting-dots--ten-pairs" role="img" aria-label="10 dots, five pairs">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
</span>
</li>
</ol>
<figcaption class="counting-pattern-board__caption">
Each picture has one more <em>pair</em> of dots than the picture before. Every dot has a buddy.
</figcaption>
</figure>
<h3 id="pattern-odd" class="book-prose__heading">One extra dot (odd numbers)</h3>
<p>
<strong>Odd</strong> counts also grow by two dots each step, but there is always
<strong>one dot left alone</strong> — it does not fit in a pair. Look for the single dot in orange:
</p>
<figure class="counting-pattern-board">
<ol class="counting-pattern-ladder counting-pattern-ladder--odd">
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">1</span>
<span class="counting-dots counting-dots--odd" role="img" aria-label="1 dot, alone">
<span class="counting-dots__singleton"><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">3</span>
<span class="counting-dots counting-dots--odd" role="img" aria-label="3 dots, one pair and one alone">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__singleton"><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">5</span>
<span class="counting-dots counting-dots--odd" role="img" aria-label="5 dots, two pairs and one alone">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__singleton"><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">7</span>
<span class="counting-dots counting-dots--odd" role="img" aria-label="7 dots, three pairs and one alone">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__singleton"><span class="counting-dots__dot"></span></span>
</span>
</li>
<li class="counting-pattern-step">
<span class="counting-pattern-step__digit">9</span>
<span class="counting-dots counting-dots--odd" role="img" aria-label="9 dots, four pairs and one alone">
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__pair"><span class="counting-dots__dot"></span><span class="counting-dots__dot"></span></span>
<span class="counting-dots__singleton"><span class="counting-dots__dot"></span></span>
</span>
</li>
</ol>
<figcaption class="counting-pattern-board__caption">
The lonely dot stays while the pairs grow: next would be <strong>11</strong> — five pairs and
one dot by itself.
</figcaption>
</figure>
<h3 id="pattern-shapes" class="book-prose__heading">Circle, square, circle, square…</h3>
<p>Patterns can use <strong>shapes</strong>, not only dots. Watch the pictures repeat:</p>
<figure class="counting-shape-pattern" role="group" aria-label="Repeating pattern: circle, square, circle, square, circle, square, then a question mark for what comes next">
<ol class="counting-shape-pattern__strip">
<li><span class="counting-shape counting-shape--circle" aria-hidden="true"></span><span class="counting-shape-pattern__label">circle</span></li>
<li><span class="counting-shape counting-shape--square" aria-hidden="true"></span><span class="counting-shape-pattern__label">square</span></li>
<li><span class="counting-shape counting-shape--circle" aria-hidden="true"></span><span class="counting-shape-pattern__label">circle</span></li>
<li><span class="counting-shape counting-shape--square" aria-hidden="true"></span><span class="counting-shape-pattern__label">square</span></li>
<li><span class="counting-shape counting-shape--circle" aria-hidden="true"></span><span class="counting-shape-pattern__label">circle</span></li>
<li><span class="counting-shape counting-shape--square" aria-hidden="true"></span><span class="counting-shape-pattern__label">square</span></li>
<li class="counting-shape-pattern__next">
<span class="counting-shape counting-shape--question" aria-hidden="true">?</span>
<span class="counting-shape-pattern__label">next?</span>
</li>
</ol>
<figcaption class="counting-pattern-board__caption">
After a square comes a <strong>circle</strong>. The shapes take turns, over and over.
</figcaption>
</figure>
<h2 id="addition" class="book-prose__heading">Addition</h2>
<p>
<strong>Addition</strong> means putting two groups together. Three dots and four more dots make
seven dots in one big group. We write <strong>3 + 4 = 7</strong>.
</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Adding</p>
<p>Start with the first group, then place the second group beside it and count all the dots.</p>
</div>
<h2 id="multiplication" class="book-prose__heading">Multiplication</h2>
<p>
<strong>Multiplication</strong> is many <em>equal</em> groups. Three bags with two sweets each
is the same as three pairs of dots. We write <strong>3 × 2 = 6</strong> — “three groups of two.”
</p>
<p>
You can lay the dots in a <strong>rectangle</strong>: 3 rows with 2 dots in each row fills a
block of 6 dots.
</p>
<h2 id="division" class="book-prose__heading">Division</h2>
<p>
<strong>Division</strong> is about <strong>sharing equally</strong> or making equal groups. If
12 biscuits are shared among 4 friends, each friend gets the same number. We write
<strong>12 ÷ 4 = 3</strong> — “twelve split into four equal piles gives three in each pile.”
</p>
<p>
Division is the partner of multiplication. If <strong>3 × 4 = 12</strong>, then
<strong>12 ÷ 3 = 4</strong> and <strong>12 ÷ 4 = 3</strong>. One picture of dots can answer both
kinds of question.
</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Fair shares</p>
<p>
When every pile has the same number of dots, the share is <strong>fair</strong>. If dots are
left over, the total does not split evenly — those extras are the <strong>remainder</strong>.
</p>
</div>
<div class="math-widget-mount" data-widget="division-sharing" data-pagefind-ignore></div>
<h2 id="past-ten" class="book-prose__heading">Past ten: tens and hundreds</h2>
<p>
You can count higher than ten on your fingers — people use <strong>place value</strong>. Ten
single dots can be thought of as <strong>one group of ten</strong>. Ten groups of ten make
<strong>one hundred</strong>.
</p>
<figure class="counting-place-ladder" aria-label="Place value: ten ones make one ten, ten tens make one hundred">
<ol class="counting-place-ladder__steps">
<li class="counting-place-step">
<span class="counting-place-step__label">1 one</span>
<span class="counting-dots" role="img" aria-hidden="true"><span class="counting-dots__dot"></span></span>
</li>
<li class="counting-place-step counting-place-step--arrow" aria-hidden="true">× 10</li>
<li class="counting-place-step">
<span class="counting-place-step__label">1 ten</span>
<span class="counting-place-blocks counting-place-blocks--ten" role="img" aria-hidden="true">
<span class="counting-place-blocks__rod"></span>
</span>
</li>
<li class="counting-place-step counting-place-step--arrow" aria-hidden="true">× 10</li>
<li class="counting-place-step">
<span class="counting-place-step__label">1 hundred</span>
<span class="counting-place-blocks counting-place-blocks--hundred" role="img" aria-hidden="true">
<span class="counting-place-blocks__grid"></span>
</span>
</li>
</ol>
<figcaption class="counting-pattern-board__caption">
Each step bundles ten of the smaller unit. That is why our digits work in columns (ones, tens,
hundreds…).
</figcaption>
</figure>
<p>
The number <strong>47</strong> means 4 tens and 7 ones — forty-seven dots, without drawing every
dot one by one.
</p>
<h2 id="big-numbers" class="book-prose__heading">Big numbers in real life</h2>
<p>
The world is huge. Counting every grain of sand on a beach one by one would take forever, so we
use <strong>big number words</strong> to talk about amounts we cannot easily picture dot by dot.
They matter because governments, scientists, and shops all work with large totals.
</p>
<div class="book-table-wrap">
<table class="book-table counting-big-table">
<thead>
<tr>
<th scope="col">Word</th>
<th scope="col">How we write it</th>
<th scope="col">Why it matters</th>
</tr>
</thead>
<tbody>
<tr>
<td>hundred</td>
<td>100</td>
<td>About how many people fit in a big sports field; pages in a long novel.</td>
</tr>
<tr>
<td>thousand</td>
<td>1,000</td>
<td>Steps you might walk in a long hike; students in a large school district.</td>
</tr>
<tr>
<td>million</td>
<td>1,000,000</td>
<td>People in a large city; dollars in a national budget line item.</td>
</tr>
<tr>
<td>billion</td>
<td>1,000,000,000</td>
<td>World population is several <em>billion</em>; stars in our galaxy are hundreds of billions.</td>
</tr>
</tbody>
</table>
</div>
<p>
Each big word is <strong>one thousand times</strong> the word before (ten hundreds make a
thousand; one thousand thousands make a million). We bundle in tens and thousands so we can
compare and add without losing track.
</p>
<ul>
<li><strong>Money</strong> — prices and taxes use thousands and millions.</li>
<li><strong>Distance</strong> — kilometres between cities add up to thousands.</li>
<li><strong>Time</strong> — minutes in a year are in the hundreds of thousands.</li>
<li><strong>Nature</strong> — insects in a forest, cells in your body — counts go huge fast.</li>
</ul>
<div class="math-widget-mount" data-widget="big-numbers-scale" data-pagefind-ignore></div>
<h2 id="try-it-yourself" class="book-prose__heading">Try it yourself</h2>
<p>
Use the tools below: count dots, add and multiply, <strong>share equally</strong>, and zoom from
one dot up to a billion to see how big numbers compare.
</p>
</div>
<div class="math-widget-mount" data-widget="counting-demo" data-pagefind-ignore></div>
<div class="math-widget-mount" data-widget="addition-groups" data-pagefind-ignore></div>
<div class="math-widget-mount" data-widget="multiplication-array" data-pagefind-ignore></div>

View file

@ -0,0 +1,203 @@
<div class="book-prose">
<h2 id="history" class="book-prose__heading">History</h2>
<p>
Long before writing, people kept track of herds, harvests, and trade by making marks — tallies —
one mark for each item. Archaeologists have found tally bones tens of thousands of years old.
</p>
<p>
Different cultures invented symbols for amounts. The idea of <strong>zero</strong> as a number took
time: Indian mathematicians such as <strong>Brahmagupta</strong> (7th century CE) wrote rules for
arithmetic that included zero. The Maya used a shell sign for zero in their calendar. Zero let
people write “none” clearly and build place-value systems later on.
</p>
<p>
Multiplication grew from repeated addition in trade and land measurement — counting equal rows of
goods or fields without adding one row at a time forever.
</p>
<p>
Division appears in sharing problems as old as fair trade: split grain, land, or money into equal
parts. Large-number names (million, billion) expanded as empires, astronomy, and finance needed to
record bigger totals than everyday counting.
</p>
<h2 id="derivation" class="book-prose__heading">Derivation</h2>
<h3 id="why-addition-works" class="book-prose__heading">Why addition combines groups</h3>
<p>
Suppose the first group has \(a\) objects and the second has \(b\) objects, with no overlap. If
you put them in one pile and count from the start, you say \(a\) number words for the first
group, then continue with \(b\) more words. The last word is the total \(a + b\). That is why
\(3 + 4 = 7\): three objects, then four more, gives seven in all.
</p>
<h3 id="multiplication-as-repeated-addition" class="book-prose__heading">Multiplication as repeated addition</h3>
<p>
If there are \(r\) equal rows and each row has \(c\) dots, you can add
\(c + c + \cdots + c\) (\(r\) times) to get the total. Writing \(r \times c\) saves repeating
the same addition. For example, \(4 \times 3 = 3 + 3 + 3 + 3 = 12\).
</p>
<h3 id="division-as-fair-sharing" class="book-prose__heading">Division as fair sharing</h3>
<p>
If \(T\) dots are split into \(g\) equal piles with nothing left over, each pile has
\(T \div g\) dots. That is the same as asking: what number times \(g\) gives \(T\)? So
\(T \div g = q\) when \(g \times q = T\). Example: \(12 \div 4 = 3\) because \(4 \times 3 = 12\).
</p>
<h3 id="place-value-and-big-numbers" class="book-prose__heading">Place value and big numbers</h3>
<p>
In base ten, each column is worth ten times the column to its right. So \(47 = 4 \times 10 + 7\).
Extending the pattern: \(1{,}000 = 10^3\), \(1{,}000{,}000 = 10^6\), and each “thousand step” multiplies
by \(1{,}000\) again. That is why we group digits in threes when writing millions and billions.
</p>
<h2 id="checkpoints" class="book-prose__heading">Checkpoints</h2>
<p>Pause and answer in your head or with a partner before moving on.</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>Show the number \(7\) on your fingers. What digit symbol matches seven?</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>Which is greater: \(5\) or \(9\)? How do you know?</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>Is \(2 + 2 + 2\) the same total as \(3 \times 2\)? Explain with a picture of dots.</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>What comes next in the pattern \(2, 4, 6, 8, \ldots\)?</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>Share 15 dots into 3 equal piles. How many in each pile? What if you try 4 piles?</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>Which is bigger: 1 million or 1 thousand? How do you know?</p>
</div>
<h2 id="applications" class="book-prose__heading">Real-life applications</h2>
<ul>
<li><strong>Sharing snacks</strong> — \(6\) biscuits shared among \(3\) friends is \(6 \div 3 = 2\) each; check with \(3 \times 2 = 6\).</li>
<li><strong>Rows of chairs</strong> — a room with \(4\) rows of \(5\) chairs has \(4 \times 5 = 20\) seats.</li>
<li><strong>Egg cartons</strong> — two rows of \(5\) cups hold \(2 \times 5 = 10\) eggs.</li>
<li><strong>Counting steps</strong> — climbing \(8\) steps then \(2\) more is \(8 + 2 = 10\) steps.</li>
<li><strong>Population</strong> — countries and cities are counted in millions or billions.</li>
<li><strong>Packaging</strong> — eggs in cartons (\(2 \times 5\)) and sweets split among friends (\(12 \div 4\)).</li>
</ul>
<h2 id="question-bank" class="book-prose__heading">Question bank</h2>
<h3 id="questions-easy" class="book-prose__heading">Easy</h3>
<details class="book-question">
<summary class="book-question__prompt">How many fingers on one hand?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(5\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">What digit means “none”?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(0\) (zero).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Compute \(2 + 5\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(7\).</p>
<p><strong>Steps:</strong> Two objects plus five more gives seven.</p>
</div>
</details>
<h3 id="questions-intermediate" class="book-prose__heading">Intermediate</h3>
<details class="book-question">
<summary class="book-question__prompt">Compute \(6 + 4\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(10\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Compute \(3 \times 4\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(12\).</p>
<p><strong>Steps:</strong> \(4 + 4 + 4 = 12\), or four rows of three dots.</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Which is larger: \(8\) or \(6\)?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(8\) is larger.</p>
</div>
</details>
<h3 id="questions-difficult" class="book-prose__heading">Difficult</h3>
<details class="book-question">
<summary class="book-question__prompt">Compute \(5 + 3 + 2\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(10\).</p>
<p><strong>Steps:</strong> \(5 + 3 = 8\), then \(8 + 2 = 10\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">A tray has \(3\) rows of \(3\) muffins. How many muffins?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(9\).</p>
<p><strong>Steps:</strong> \(3 \times 3 = 9\).</p>
</div>
</details>
<h3 id="questions-hardcore" class="book-prose__heading">Hardcore</h3>
<details class="book-question">
<summary class="book-question__prompt">Without counting one by one: if \(7 + 3 = 10\), what is \(3 + 7\)? Why?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(10\).</p>
<p><strong>Explanation:</strong> Addition of whole numbers can be done in either order (commutative property).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Show \(5 \times 2\) as both repeated addition and as a dot rectangle.</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(10\).</p>
<p><strong>Steps:</strong> \(2 + 2 + 2 + 2 + 2 = 10\); five rows of two dots (or two columns of five).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Share \(12\) dots equally among \(4\) piles. How many per pile?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(3\) per pile.</p>
<p><strong>Steps:</strong> \(12 \div 4 = 3\) because \(4 \times 3 = 12\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">How many zeros are in one million written in digits?</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> Six zeros: 1,000,000.</p>
</div>
</details>
<h2 id="references" class="book-prose__heading">References</h2>
<ul>
<li>Ifrah, Georges — <em>The Universal History of Numbers</em> (origins of counting and zero).</li>
<li>Crossley &amp; Henry — early Indian arithmetic including zero.</li>
</ul>
</div>

View file

@ -0,0 +1,91 @@
import katex from "katex";
import { createMemo, createSignal, For } from "solid-js";
function renderLatex(latex: string) {
return katex.renderToString(latex, { throwOnError: false, strict: "ignore" });
}
function DotPile(props: { count: number; label: string; class?: string }) {
return (
<div class={`addition-groups__pile ${props.class ?? ""}`}>
<span class="scenario-demo__value">{props.label}</span>
<div class="addition-groups__dots" role="img" aria-label={`${props.count} dots`}>
<For each={Array.from({ length: props.count })}>{() => <span class="addition-groups__dot" />}</For>
</div>
</div>
);
}
function AdditionGroups() {
const [a, setA] = createSignal(3);
const [b, setB] = createSignal(4);
const sum = createMemo(() => a() + b());
const equationHtml = createMemo(() =>
renderLatex(`${a()} + ${b()} = ${sum()}`)
);
return (
<section class="math-widget" aria-labelledby="addition-groups-title">
<h2 id="addition-groups-title" class="math-widget__title">
Add two groups
</h2>
<div class="math-widget__body">
<div class="math-widget__controls">
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="add-a">
<span>First group</span>
<span class="scenario-demo__value">{a()}</span>
</label>
<input
id="add-a"
class="scenario-demo__slider"
type="range"
min={0}
max={10}
step={1}
value={a()}
onInput={(e) => setA(Number(e.currentTarget.value))}
/>
</div>
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="add-b">
<span>Second group</span>
<span class="scenario-demo__value">{b()}</span>
</label>
<input
id="add-b"
class="scenario-demo__slider"
type="range"
min={0}
max={10}
step={1}
value={b()}
onInput={(e) => setB(Number(e.currentTarget.value))}
/>
</div>
</div>
<div
class="math-widget__formula"
innerHTML={equationHtml()}
aria-live="polite"
/>
<div class="addition-groups__piles">
<DotPile count={a()} label={`${a()}`} />
<span class="addition-groups__plus" aria-hidden="true">
+
</span>
<DotPile count={b()} label={`${b()}`} class="addition-groups__pile--b" />
<span class="addition-groups__equals" aria-hidden="true">
=
</span>
<DotPile count={sum()} label={`${sum()}`} />
</div>
</div>
</section>
);
}
export default AdditionGroups;

View file

@ -0,0 +1,205 @@
import { createMemo, createSignal, For, Show } from "solid-js";
type VisualKind = "one" | "ten" | "hundred" | "thousand" | "million" | "billion";
type ScaleStep = {
id: string;
label: string;
value: number;
display: string;
example: string;
visual: VisualKind;
};
const STEPS: ScaleStep[] = [
{
id: "one",
label: "1",
value: 1,
display: "1",
example: "One apple on a plate.",
visual: "one",
},
{
id: "ten",
label: "10",
value: 10,
display: "10",
example: "Fingers on two hands — easy to count one by one.",
visual: "ten",
},
{
id: "hundred",
label: "100",
value: 100,
display: "100",
example: "A full stadium section; too many to count quickly without grouping.",
visual: "hundred",
},
{
id: "thousand",
label: "1 thousand",
value: 1_000,
display: "1,000",
example: "A long walk in steps; a big school’s students.",
visual: "thousand",
},
{
id: "million",
label: "1 million",
value: 1_000_000,
display: "1,000,000",
example: "A large city’s population — one dot per person would fill this whole grid.",
visual: "million",
},
{
id: "billion",
label: "1 billion",
value: 1_000_000_000,
display: "1,000,000,000",
example: "About how many people live on Earth — one thousand times a whole city-million.",
visual: "billion",
},
];
function DotGrid(props: { count: number; columns: number; small?: boolean }) {
const cells = () => Array.from({ length: props.count });
return (
<div
class={`big-numbers-scale__grid ${props.small ? "big-numbers-scale__grid--small" : ""}`}
style={{ "grid-template-columns": `repeat(${props.columns}, 1fr)` }}
role="img"
aria-hidden="true"
>
<For each={cells()}>{() => <span class="big-numbers-scale__cell" />}</For>
</div>
);
}
/** 10×10 = 100 cells; each stands for 10,000 → 1 million total */
function MillionVisual() {
const cells = Array.from({ length: 100 });
return (
<div class="big-numbers-scale__million" role="img" aria-label="100 groups of ten thousand make one million">
<div class="big-numbers-scale__mega-grid">
<For each={cells}>{() => <span class="big-numbers-scale__mega-cell">10k</span>}</For>
</div>
<p class="big-numbers-scale__visual-caption">
100 squares × 10,000 each = <strong>1 million</strong>
</p>
</div>
);
}
/** Mini million (4×4 of 10k) beside ×1000 beside 10×10 grid of 1M blocks */
function BillionVisual() {
const millionTiles = Array.from({ length: 16 });
const billionTiles = Array.from({ length: 100 });
return (
<div class="big-numbers-scale__billion" role="img" aria-label="One thousand millions make one billion">
<div class="big-numbers-scale__billion-compare">
<div class="big-numbers-scale__billion-unit">
<span class="big-numbers-scale__billion-unit-label">1 million</span>
<div class="big-numbers-scale__mini-grid">
<For each={millionTiles}>{() => <span class="big-numbers-scale__mini-cell">10k</span>}</For>
</div>
</div>
<span class="big-numbers-scale__billion-times" aria-hidden="true">× 1,000</span>
<div class="big-numbers-scale__billion-equals" aria-hidden="true">=</div>
<div class="big-numbers-scale__billion-unit big-numbers-scale__billion-unit--wide">
<span class="big-numbers-scale__billion-unit-label">1 billion</span>
<div class="big-numbers-scale__giga-grid">
<For each={billionTiles}>{() => <span class="big-numbers-scale__giga-cell">1M</span>}</For>
</div>
</div>
</div>
<p class="big-numbers-scale__visual-caption">
Each orange square is a <strong>whole million</strong>. This board shows 100 of them — imagine
<strong> 10</strong> identical boards stacked (<span class="big-numbers-scale__math-hint">10 × 100 = 1,000</span>
millions) to reach one billion.
</p>
</div>
);
}
function BigNumbersScale() {
const [index, setIndex] = createSignal(2);
const step = createMemo(() => STEPS[index()]!);
const prev = createMemo(() => STEPS[Math.max(0, index() - 1)]);
const scaleRatio = createMemo(() => {
const p = prev().value;
const c = step().value;
if (p === c) return null;
return c / p;
});
return (
<section class="math-widget" aria-labelledby="big-numbers-scale-title">
<h2 id="big-numbers-scale-title" class="math-widget__title">
How big is the number?
</h2>
<div class="math-widget__body">
<div class="big-numbers-scale__picker">
<For each={STEPS}>
{(s, i) => (
<button
type="button"
class="big-numbers-scale__btn"
classList={{ "big-numbers-scale__btn--active": index() === i() }}
onClick={() => setIndex(i())}
>
{s.label}
</button>
)}
</For>
</div>
<p class="big-numbers-scale__display" aria-live="polite">
<span class="big-numbers-scale__number">{step().display}</span>
</p>
<Show when={scaleRatio() !== null && index() > 0}>
<p class="big-numbers-scale__compare">
About <strong>{scaleRatio()?.toLocaleString()}</strong> times bigger than {prev().display}
</p>
</Show>
<div class="big-numbers-scale__visual">
<Show when={step().visual === "one"}>
<span class="counting-dots" aria-hidden="true">
<span class="counting-dots__dot" />
</span>
</Show>
<Show when={step().visual === "ten"}>
<DotGrid count={10} columns={5} />
</Show>
<Show when={step().visual === "hundred"}>
<DotGrid count={100} columns={10} small />
</Show>
<Show when={step().visual === "thousand"}>
<div class="big-numbers-scale__blocks" aria-hidden="true">
<For each={Array.from({ length: 10 })}>
{() => (
<span class="big-numbers-scale__block big-numbers-scale__block--hundred">100</span>
)}
</For>
<p class="big-numbers-scale__visual-caption big-numbers-scale__visual-caption--inline">
10 hundreds = 1 thousand
</p>
</div>
</Show>
<Show when={step().visual === "million"}>
<MillionVisual />
</Show>
<Show when={step().visual === "billion"}>
<BillionVisual />
</Show>
</div>
<p class="math-widget__caption">{step().example}</p>
</div>
</section>
);
}
export default BigNumbersScale;

View file

@ -0,0 +1,61 @@
import { createSignal, For } from "solid-js";
const MAX = 10;
function CountingDemo() {
const [count, setCount] = createSignal(0);
const addOne = () => {
if (count() < MAX) setCount(count() + 1);
};
const reset = () => setCount(0);
return (
<section class="math-widget" aria-labelledby="counting-demo-title">
<h2 id="counting-demo-title" class="math-widget__title">
Count the objects
</h2>
<div class="math-widget__body">
<p class="math-widget__caption">
Tap to place one object at a time (up to {MAX}). Use reset to start again.
</p>
<p class="counting-demo__count" aria-live="polite">
Count: {count()}
</p>
<div
class="counting-demo__objects"
role="group"
aria-label={`${count()} objects placed`}
onClick={addOne}
>
<For each={Array.from({ length: count() })}>
{(_, i) => (
<button
type="button"
class="counting-demo__object counting-demo__object--active"
aria-label={`Object ${i() + 1}`}
onClick={(e) => e.stopPropagation()}
/>
)}
</For>
</div>
<div class="scenario-demo__actions">
<button type="button" class="scenario-demo__btn" onClick={reset}>
Reset
</button>
<button
type="button"
class="scenario-demo__btn scenario-demo__btn--primary"
onClick={addOne}
disabled={count() >= MAX}
>
Add one
</button>
</div>
</div>
</section>
);
}
export default CountingDemo;

View file

@ -0,0 +1,119 @@
import { createMemo, createSignal, For, Show } from "solid-js";
function SharePile(props: { count: number; label: string }) {
return (
<div class="division-sharing__pile">
<span class="division-sharing__pile-label">{props.label}</span>
<div class="division-sharing__dots" role="img" aria-label={`${props.count} dots`}>
<For each={Array.from({ length: props.count })}>
{() => <span class="division-sharing__dot" />}
</For>
</div>
</div>
);
}
function DivisionSharing() {
const [total, setTotal] = createSignal(12);
const [groups, setGroups] = createSignal(3);
const each = createMemo(() => Math.floor(total() / groups()));
const remainder = createMemo(() => total() % groups());
const fair = createMemo(() => remainder() === 0);
const groupLabels = createMemo(() =>
Array.from({ length: groups() }, (_, i) => `Pile ${i + 1}`)
);
return (
<section class="math-widget" aria-labelledby="division-sharing-title">
<h2 id="division-sharing-title" class="math-widget__title">
Share the dots equally
</h2>
<div class="math-widget__body">
<div class="math-widget__controls">
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="share-total">
<span>Dots to share</span>
<span class="scenario-demo__value">{total()}</span>
</label>
<input
id="share-total"
class="scenario-demo__slider"
type="range"
min={4}
max={20}
step={1}
value={total()}
onInput={(e) => setTotal(Number(e.currentTarget.value))}
/>
</div>
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="share-groups">
<span>Equal piles</span>
<span class="scenario-demo__value">{groups()}</span>
</label>
<input
id="share-groups"
class="scenario-demo__slider"
type="range"
min={2}
max={6}
step={1}
value={groups()}
onInput={(e) => setGroups(Number(e.currentTarget.value))}
/>
</div>
</div>
<p class="division-sharing__equation" aria-live="polite">
<Show
when={fair()}
fallback={
<>
<strong>{total()}</strong> ÷ <strong>{groups()}</strong> does not split evenly —{" "}
<strong>{each()}</strong> in each pile and <strong>{remainder()}</strong> left over
</>
}
>
<strong>{total()}</strong> ÷ <strong>{groups()}</strong> = <strong>{each()}</strong> dots
per pile
</Show>
</p>
<Show when={fair()}>
<div class="division-sharing__piles">
<For each={groupLabels()}>
{(label) => <SharePile count={each()} label={label} />}
</For>
</div>
</Show>
<Show when={!fair()}>
<div class="division-sharing__uneven">
<div class="division-sharing__piles">
<For each={groupLabels()}>
{(label) => <SharePile count={each()} label={label} />}
</For>
</div>
<div class="division-sharing__remainder">
<span class="division-sharing__pile-label">Left over</span>
<div class="division-sharing__dots division-sharing__dots--remainder" role="img">
<For each={Array.from({ length: remainder() })}>
{() => <span class="division-sharing__dot division-sharing__dot--extra" />}
</For>
</div>
</div>
</div>
</Show>
<p class="math-widget__caption">
Check: {groups()} × {each()} = {groups() * each()}
<Show when={fair()}> — that matches {total()} dots.</Show>
</p>
</div>
</section>
);
}
export default DivisionSharing;

View file

@ -0,0 +1,87 @@
import katex from "katex";
import { createMemo, createSignal, For } from "solid-js";
function renderLatex(latex: string) {
return katex.renderToString(latex, { throwOnError: false, strict: "ignore" });
}
function MultiplicationArray() {
const [rows, setRows] = createSignal(3);
const [cols, setCols] = createSignal(2);
const total = createMemo(() => rows() * cols());
const equationHtml = createMemo(() =>
renderLatex(`${rows()} \\times ${cols()} = ${total()}`)
);
const cells = createMemo(() => Array.from({ length: total() }));
return (
<section class="math-widget" aria-labelledby="multiplication-array-title">
<h2 id="multiplication-array-title" class="math-widget__title">
Multiplication array
</h2>
<div class="math-widget__body">
<div class="math-widget__controls">
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="mult-rows">
<span>Rows</span>
<span class="scenario-demo__value">{rows()}</span>
</label>
<input
id="mult-rows"
class="scenario-demo__slider"
type="range"
min={1}
max={5}
step={1}
value={rows()}
onInput={(e) => setRows(Number(e.currentTarget.value))}
/>
</div>
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="mult-cols">
<span>Columns</span>
<span class="scenario-demo__value">{cols()}</span>
</label>
<input
id="mult-cols"
class="scenario-demo__slider"
type="range"
min={1}
max={5}
step={1}
value={cols()}
onInput={(e) => setCols(Number(e.currentTarget.value))}
/>
</div>
</div>
<div
class="math-widget__formula"
innerHTML={equationHtml()}
aria-live="polite"
/>
<figure class="math-widget__figure">
<div
class="multiplication-array__grid"
role="img"
aria-label={`${rows()} rows of ${cols()} dots, ${total()} in total`}
style={{
"grid-template-columns": `repeat(${cols()}, 22px)`,
"grid-template-rows": `repeat(${rows()}, 22px)`,
}}
>
<For each={cells()}>{() => <span class="multiplication-array__cell" />}</For>
</div>
<figcaption class="math-widget__caption">
Each row has {cols()} dots. {rows()} rows give {total()} dots altogether.
</figcaption>
</figure>
</div>
</section>
);
}
export default MultiplicationArray;

View file

@ -2,7 +2,7 @@
title = "Directed numbers, rates & ratios"
description = "Operate with negative numbers and solve ratio, rate, and proportion problems in context."
template = "chapter.html"
weight = 0
weight = 1
[extra]
subject = "math"
chapter_id = "directed-numbers-rates"
@ -11,9 +11,11 @@ strand = "Number & Algebra"
<div class="book-prose">
<p>
Numbers on a line can lie to the <strong>right</strong> of zero (positive) or to the
<strong>left</strong> (negative). Temperatures below freezing, bank overdrafts, and positions
below sea level are everyday examples of <strong>directed numbers</strong>.
You already know how to count and work with whole numbers from <strong>0</strong> to
<strong>10</strong>. On a number line, those values lie on or to the <strong>right</strong> of zero.
Numbers can also lie to the <strong>left</strong> of zero — we call them <strong>negative</strong>.
Temperatures below freezing, bank overdrafts, and positions below sea level are everyday examples
of <strong>directed numbers</strong>.
</p>
<h2 id="number-line" class="book-prose__heading">The number line</h2>

View file

@ -1,8 +1,10 @@
<div class="book-prose">
<p>
Numbers on a line can lie to the <strong>right</strong> of zero (positive) or to the
<strong>left</strong> (negative). Temperatures below freezing, bank overdrafts, and positions
below sea level are everyday examples of <strong>directed numbers</strong>.
You already know how to count and work with whole numbers from <strong>0</strong> to
<strong>10</strong>. On a number line, those values lie on or to the <strong>right</strong> of zero.
Numbers can also lie to the <strong>left</strong> of zero — we call them <strong>negative</strong>.
Temperatures below freezing, bank overdrafts, and positions below sea level are everyday examples
of <strong>directed numbers</strong>.
</p>
<h2 id="number-line" class="book-prose__heading">The number line</h2>

View file

@ -0,0 +1,374 @@
+++
title = "Polynomials: expansion & factorisation"
description = "Expand products, collect like terms, and factorise expressions using common factors and identities."
template = "chapter.html"
weight = 1
[extra]
subject = "math"
chapter_id = "polynomials-expansion-factorisation"
strand = "Number & Algebra"
+++
<div class="book-prose">
<p>
An <strong>algebraic expression</strong> combines numbers, variables, and operations. A
<strong>polynomial</strong> in one variable \(x\) is a sum of terms of the form
\(a x^n\) where \(a\) is a constant and \(n\) is a non-negative integer. Examples:
\(3x^2 - 5x + 1\), \(x^3 + 2x\), and \(7\).
</p>
<h2 id="vocabulary" class="book-prose__heading">Terms, coefficients, and degree</h2>
<p>
In \(5x^2 - 3x + 4\), the <strong>terms</strong> are \(5x^2\), \(-3x\), and \(4\). The
<strong>coefficient</strong> of \(x^2\) is \(5\); the coefficient of \(x\) is \(-3\). The
<strong>degree</strong> of the polynomial is the highest power of \(x\) — here, \(2\).
<strong>Like terms</strong> have the same variable part (same power of \(x\)); only their
coefficients may differ.
</p>
<h2 id="adding-subtracting" class="book-prose__heading">Adding and subtracting polynomials</h2>
<p>
Line up like terms and add or subtract their coefficients:
\[ (3x^2 + 2x - 1) + (x^2 - 5x + 4) = 4x^2 - 3x + 3. \]
When subtracting, distribute the minus sign to every term in the bracket:
\[ (2x^2 + x) - (x^2 - 3x + 2) = 2x^2 + x - x^2 + 3x - 2 = x^2 + 4x - 2. \]
</p>
<h2 id="expanding" class="book-prose__heading">Expanding products</h2>
<p>
Use the <strong>distributive law</strong>: each term in the first bracket multiplies each term in
the second. For two binomials,
\[ (a+b)(c+d) = ac + ad + bc + bd. \]
Example:
\[ (x+3)(x-2) = x^2 - 2x + 3x - 6 = x^2 + x - 6. \]
</p>
<p>
A binomial times a trinomial works the same way — multiply each of the two terms by each of the
three:
\[ (x+1)(x^2 - x + 2) = x^3 - x^2 + 2x + x^2 - x + 2 = x^3 + x + 2. \]
</p>
<h2 id="collecting" class="book-prose__heading">Collecting like terms</h2>
<p>
After expanding, combine like terms so the answer is simplified. From above,
\(x^2 - 2x + 3x - 6\) becomes \(x^2 + x - 6\). Constants, \(x\)-terms, and \(x^2\)-terms are
collected separately.
</p>
<h2 id="factorising-overview" class="book-prose__heading">Factorising</h2>
<p>
<strong>Factorisation</strong> is the reverse of expansion: write an expression as a product of
simpler factors. Choose a method by inspecting the shape of the expression:
</p>
<div class="book-table-wrap">
<table class="book-table">
<thead>
<tr>
<th scope="col">Situation</th>
<th scope="col">Method</th>
</tr>
</thead>
<tbody>
<tr>
<td>Every term shares a common factor</td>
<td>Highest common factor (HCF)</td>
</tr>
<tr>
<td>Four terms, pairs share factors</td>
<td>Grouping</td>
</tr>
<tr>
<td>Matches \(a^2-b^2\) or \((a\pm b)^2\)</td>
<td>Standard identities</td>
</tr>
<tr>
<td>Quadratic in \(x\): \(ax^2+bx+c\)</td>
<td>Two-number search or ac-method</td>
</tr>
</tbody>
</table>
</div>
<h2 id="hcf" class="book-prose__heading">Highest common factor</h2>
<p>
Factor out the largest factor common to every term:
\[ 6x^2 + 9x = 3x(2x + 3), \qquad 4x^3 - 8x^2 = 4x^2(x - 2). \]
Always check whether the bracket can be factorised further.
</p>
<h2 id="grouping" class="book-prose__heading">Factorising by grouping</h2>
<p>
With four terms, split into two pairs and factor each pair:
\[ ax + ay + bx + by = a(x+y) + b(x+y) = (a+b)(x+y). \]
Example:
\[ 2x^2 + 6x - x - 3 = 2x(x+3) - 1(x+3) = (2x-1)(x+3). \]
</p>
<h2 id="identities" class="book-prose__heading">Standard identities</h2>
<div class="book-callout book-callout--formula" role="note">
<p class="book-callout__label">Identities</p>
<p class="book-formula">
\[ a^2 - b^2 = (a+b)(a-b) \]
\[ (a+b)^2 = a^2 + 2ab + b^2 \]
\[ (a-b)^2 = a^2 - 2ab + b^2 \]
</p>
</div>
<p>
Recognising these forms speeds up factorisation. For example,
\(x^2 - 9 = x^2 - 3^2 = (x+3)(x-3)\) and
\(x^2 + 6x + 9 = (x+3)^2\).
</p>
<h2 id="quadratic-trinomials" class="book-prose__heading">Quadratic trinomials</h2>
<p>
To factorise a <strong>monic</strong> quadratic \(x^2 + bx + c\), find two numbers that
<em>multiply</em> to \(c\) and <em>add</em> to \(b\):
\[ x^2 + 5x + 6 = (x+2)(x+3) \quad\text{since } 2\times 3 = 6,\; 2+3 = 5. \]
</p>
<p>
For a <strong>non-monic</strong> quadratic \(ax^2 + bx + c\) with \(a \neq 1\), use the
<strong>ac-method</strong>: find two numbers that multiply to \(ac\) and add to \(b\), split the
middle term, then factor by grouping:
\[ 2x^2 + 7x + 3 = 2x^2 + 6x + x + 3 = 2x(x+3) + 1(x+3) = (2x+1)(x+3). \]
</p>
<p>
This chapter stops at factorising expressions. Solving equations of the form \(ax^2+bx+c=0\) is
covered in the chapter on quadratic equations.
</p>
<h2 id="try-it-yourself" class="book-prose__heading">Try it yourself</h2>
<p>
Use the area model to see how \((a+b)(c+d)\) splits into four partial products. Then practise
choosing a factorisation method and checking your factors in the explorer below.
</p>
</div>
<div class="math-widget-mount" data-widget="area-model" data-pagefind-ignore></div>
<div class="math-widget-mount" data-widget="factorisation-checker" data-pagefind-ignore></div>
<div class="book-prose">
<h2 id="history" class="book-prose__heading">History</h2>
<p>
Long before modern symbols, people solved problems that required multiplying lengths and
collecting areas — the same ideas behind expanding and factorising. Babylonian scribes (around
1800&nbsp;BCE) recorded rectangle problems on clay tablets: given area and side relationships,
find unknown lengths. Their recipes are early cousins of “expand, then simplify.”
</p>
<figure class="book-figure">
<img
class="book-figure__img"
src="/chapters/math/polynomials-expansion-factorisation/polynomials-history.png"
alt="Illustrated timeline: Babylonian area on clay tablets, al-Khwarizmi's algebra, Viète's difference of squares, Enlightenment science, and modern expand–factorise steps"
width="960"
height="640"
loading="lazy"
decoding="async"
/>
<figcaption class="book-figure__caption">
From geometric area puzzles to symbolic algebra: how expansion and factorisation became
standard tools in school mathematics.
</figcaption>
</figure>
<p>
In the 9th century, <strong>al-Khwarizmi</strong> organised methods for equations and products
in Arabic texts that later spread to Europe. Renaissance mathematicians such as
<strong>Viète</strong> introduced letters for unknowns and constants, making it easier to see
patterns like \(a^2 - b^2\). By the 17th–18th centuries, polynomial algebra was central to
calculus and science; factorisation became a routine step before solving equations or
simplifying formulas.
</p>
<h2 id="derivation" class="book-prose__heading">Derivation</h2>
<h3 id="area-distributive" class="book-prose__heading">Area proof of \((a+b)(c+d)\)</h3>
<p>
Draw a rectangle with width \(a+b\) and height \(c+d\). The total area is \((a+b)(c+d)\). Split
the rectangle into four smaller rectangles with areas \(ac\), \(ad\), \(bc\), and \(bd\). The
sum of partial areas equals the whole:
\[ (a+b)(c+d) = ac + ad + bc + bd. \]
This is the distributive law in two dimensions — the same picture as in the area-model widget
above.
</p>
<h3 id="derive-identities" class="book-prose__heading">Deriving standard identities</h3>
<p>
Set \(c = a\) and \(d = b\) in the area formula for a square of side \(a+b\):
\[ (a+b)^2 = a^2 + ab + ab + b^2 = a^2 + 2ab + b^2. \]
For a square of side \(a-b\) (with \(a &gt; b\)), remove a strip of width \(b\) from a square of
side \(a\); the remaining L-shape rearranges to show
\[ (a-b)^2 = a^2 - 2ab + b^2. \]
Difference of squares: a large square of side \(a\) minus a small square of side \(b\) leaves two
congruent rectangles, which rearrange to a rectangle of dimensions \((a+b)\) by \((a-b)\):
\[ a^2 - b^2 = (a+b)(a-b). \]
</p>
<h3 id="grouping-walkthrough" class="book-prose__heading">Grouping walkthrough</h3>
<p>
Factorise \(3x^2 + 12x - 2x - 8\).
</p>
<ol>
<li>Group: \((3x^2 + 12x) + (-2x - 8)\).</li>
<li>Factor each pair: \(3x(x+4) - 2(x+4)\).</li>
<li>Common bracket \((x+4)\): \((3x-2)(x+4)\).</li>
</ol>
<h2 id="checkpoints" class="book-prose__heading">Checkpoints</h2>
<p>
Pause and reason before continuing. Discuss with a partner or write your work in a notebook.
</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
In \(4x^3 - 2x^2 + 5\), what is the degree? Which terms are like terms with \(4x^3\)?
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Expand \((2x-1)(x+4)\) without skipping steps. How many terms do you get before collecting?
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
How would you factorise \(x^2 - 16\)? Which identity applies?
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Expand \(x(x+1) - (x+1)\). What common factor appears? What is the factorised form?
</p>
</div>
<h2 id="applications" class="book-prose__heading">Applications</h2>
<h3 id="geometry-area" class="book-prose__heading">Geometry: area and perimeter</h3>
<p>
A rectangle has sides \((x+3)\) cm and \((2x-1)\) cm. Its area is
\[ (x+3)(2x-1) = 2x^2 + 5x - 3 \quad\text{cm}^2. \]
The perimeter is \(2\bigl((x+3)+(2x-1)\bigr) = 2(3x+2) = 6x+4\) cm. Expansion links algebraic
descriptions of sides to measurable quantities.
</p>
<h3 id="revenue-profit" class="book-prose__heading">Revenue and pricing</h3>
<p>
If a shop sells \(n\) items at price \((50 - 0.5n)\) dollars each, revenue is
\(n(50 - 0.5n) = 50n - 0.5n^2\). Expanding a product of two linear factors often appears before
finding maximum revenue (a quadratic in \(n\)).
</p>
<h3 id="number-pattern" class="book-prose__heading">Number patterns</h3>
<p>
Notice that \(11^2 = 121\), \(111^2 = 12321\). In general, expanding \((10^k + 10^{k-1} +
\cdots + 1)^2\) explains palindromic squares — a playful link between identities and arithmetic
patterns.
</p>
<h2 id="question-bank" class="book-prose__heading">Question bank</h2>
<p>
Work each question, then open the solution to check your reasoning. Difficulty increases
through the sets.
</p>
<h3 id="questions-easy" class="book-prose__heading">Easy</h3>
<details class="book-question">
<summary class="book-question__prompt">Expand \(3(x+2)\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(3x + 6\).</p>
<p><strong>Steps:</strong> \(3 \cdot x + 3 \cdot 2 = 3x + 6\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(2x + 5x - 1\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(7x - 1\).</p>
<p><strong>Explanation:</strong> Combine like terms \(2x + 5x = 7x\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Factorise \(6x + 9\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(3(2x + 3)\).</p>
<p><strong>Steps:</strong> HCF is \(3\); \(6x \div 3 = 2x\), \(9 \div 3 = 3\).</p>
</div>
</details>
<h3 id="questions-intermediate" class="book-prose__heading">Intermediate</h3>
<details class="book-question">
<summary class="book-question__prompt">Expand \((x+4)(x-2)\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(x^2 + 2x - 8\).</p>
<p><strong>Steps:</strong> \(x^2 - 2x + 4x - 8 = x^2 + 2x - 8\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Factorise \(x^2 - 9\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((x+3)(x-3)\).</p>
<p><strong>Explanation:</strong> Difference of squares: \(x^2 - 3^2\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Factorise \(x^2 + 6x + 9\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((x+3)^2\).</p>
<p><strong>Explanation:</strong> Perfect square: \(3 \times 3 = 9\), \(3 + 3 = 6\).</p>
</div>
</details>
<h3 id="questions-difficult" class="book-prose__heading">Difficult</h3>
<details class="book-question">
<summary class="book-question__prompt">Factorise \(2x^2 + 6x - x - 3\) by grouping.</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((2x-1)(x+3)\).</p>
<p><strong>Steps:</strong> \(2x(x+3) - 1(x+3) = (2x-1)(x+3)\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Factorise \(2x^2 + 7x + 3\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((2x+1)(x+3)\).</p>
<p><strong>Steps:</strong> \(ac = 6\); split \(7x = 6x + x\); \(2x(x+3) + 1(x+3) = (2x+1)(x+3)\).</p>
</div>
</details>
<h3 id="questions-hardcore" class="book-prose__heading">Hardcore</h3>
<details class="book-question">
<summary class="book-question__prompt">Expand and then factorise \(x(x+2) - (x+2)\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((x+2)(x-1)\) after factorising (expansion gives \(x^2 + x - 2\)).</p>
<p><strong>Steps:</strong> Factor common \((x+2)\): \((x+2)(x-1)\). Check: \((x+2)(x-1) = x^2 + x - 2\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">A rectangle has sides \((x+3)\) cm and \((2x-1)\) cm. Find its area in expanded form.</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((2x^2 + 5x - 3)\) cm².</p>
<p><strong>Calculation:</strong> \((x+3)(2x-1) = 2x^2 - x + 6x - 3 = 2x^2 + 5x - 3\).</p>
</div>
</details>
<h2 id="references" class="book-prose__heading">References</h2>
<ul>
<li>al-Khwarizmi, <em>Al-Kitāb al-mukhtaṣar fī ḥisāb al-jabr wal-muqābala</em> (c. 820 CE) — systematic treatment of algebra.</li>
<li>HKDSE Compulsory Part curriculum — Number and Algebra strand (polynomials, expansion, factorisation).</li>
</ul>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 KiB

View file

@ -0,0 +1,72 @@
.polynomials-area-model__grid {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
gap: 4px;
max-width: 320px;
margin: 0 auto;
aspect-ratio: 1;
}
.polynomials-area-model__cell {
display: flex;
align-items: center;
justify-content: center;
min-height: 72px;
border-radius: 6px;
font-family: var(--mono);
font-size: 0.85rem;
font-weight: 600;
}
.polynomials-area-model__cell--ac {
background: rgba(37, 99, 235, 0.15);
}
.polynomials-area-model__cell--ad {
background: rgba(74, 107, 74, 0.2);
}
.polynomials-area-model__cell--bc {
background: rgba(154, 107, 46, 0.2);
}
.polynomials-area-model__cell--bd {
background: rgba(220, 38, 38, 0.12);
}
.polynomials-factor-checker__feedback {
margin-top: 12px;
padding: 12px 14px;
border-radius: 8px;
border: 1px solid var(--line);
font-size: 0.9rem;
}
.polynomials-factor-checker__feedback--correct {
border-color: #16a34a;
background: rgba(22, 163, 74, 0.08);
}
.polynomials-factor-checker__feedback--incorrect {
border-color: #dc2626;
background: rgba(220, 38, 38, 0.06);
}
.polynomials-factor-checker__steps {
margin: 8px 0 0;
padding-left: 1.2rem;
color: var(--soft-ink);
}
.polynomials-factor-checker__input {
width: 100%;
max-width: 420px;
padding: 8px 12px;
font-family: var(--mono);
font-size: 0.9rem;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--card-bg);
color: var(--ink);
}

View file

@ -0,0 +1,137 @@
<div class="book-prose">
<p>
An <strong>algebraic expression</strong> combines numbers, variables, and operations. A
<strong>polynomial</strong> in one variable \(x\) is a sum of terms of the form
\(a x^n\) where \(a\) is a constant and \(n\) is a non-negative integer. Examples:
\(3x^2 - 5x + 1\), \(x^3 + 2x\), and \(7\).
</p>
<h2 id="vocabulary" class="book-prose__heading">Terms, coefficients, and degree</h2>
<p>
In \(5x^2 - 3x + 4\), the <strong>terms</strong> are \(5x^2\), \(-3x\), and \(4\). The
<strong>coefficient</strong> of \(x^2\) is \(5\); the coefficient of \(x\) is \(-3\). The
<strong>degree</strong> of the polynomial is the highest power of \(x\) — here, \(2\).
<strong>Like terms</strong> have the same variable part (same power of \(x\)); only their
coefficients may differ.
</p>
<h2 id="adding-subtracting" class="book-prose__heading">Adding and subtracting polynomials</h2>
<p>
Line up like terms and add or subtract their coefficients:
\[ (3x^2 + 2x - 1) + (x^2 - 5x + 4) = 4x^2 - 3x + 3. \]
When subtracting, distribute the minus sign to every term in the bracket:
\[ (2x^2 + x) - (x^2 - 3x + 2) = 2x^2 + x - x^2 + 3x - 2 = x^2 + 4x - 2. \]
</p>
<h2 id="expanding" class="book-prose__heading">Expanding products</h2>
<p>
Use the <strong>distributive law</strong>: each term in the first bracket multiplies each term in
the second. For two binomials,
\[ (a+b)(c+d) = ac + ad + bc + bd. \]
Example:
\[ (x+3)(x-2) = x^2 - 2x + 3x - 6 = x^2 + x - 6. \]
</p>
<p>
A binomial times a trinomial works the same way — multiply each of the two terms by each of the
three:
\[ (x+1)(x^2 - x + 2) = x^3 - x^2 + 2x + x^2 - x + 2 = x^3 + x + 2. \]
</p>
<h2 id="collecting" class="book-prose__heading">Collecting like terms</h2>
<p>
After expanding, combine like terms so the answer is simplified. From above,
\(x^2 - 2x + 3x - 6\) becomes \(x^2 + x - 6\). Constants, \(x\)-terms, and \(x^2\)-terms are
collected separately.
</p>
<h2 id="factorising-overview" class="book-prose__heading">Factorising</h2>
<p>
<strong>Factorisation</strong> is the reverse of expansion: write an expression as a product of
simpler factors. Choose a method by inspecting the shape of the expression:
</p>
<div class="book-table-wrap">
<table class="book-table">
<thead>
<tr>
<th scope="col">Situation</th>
<th scope="col">Method</th>
</tr>
</thead>
<tbody>
<tr>
<td>Every term shares a common factor</td>
<td>Highest common factor (HCF)</td>
</tr>
<tr>
<td>Four terms, pairs share factors</td>
<td>Grouping</td>
</tr>
<tr>
<td>Matches \(a^2-b^2\) or \((a\pm b)^2\)</td>
<td>Standard identities</td>
</tr>
<tr>
<td>Quadratic in \(x\): \(ax^2+bx+c\)</td>
<td>Two-number search or ac-method</td>
</tr>
</tbody>
</table>
</div>
<h2 id="hcf" class="book-prose__heading">Highest common factor</h2>
<p>
Factor out the largest factor common to every term:
\[ 6x^2 + 9x = 3x(2x + 3), \qquad 4x^3 - 8x^2 = 4x^2(x - 2). \]
Always check whether the bracket can be factorised further.
</p>
<h2 id="grouping" class="book-prose__heading">Factorising by grouping</h2>
<p>
With four terms, split into two pairs and factor each pair:
\[ ax + ay + bx + by = a(x+y) + b(x+y) = (a+b)(x+y). \]
Example:
\[ 2x^2 + 6x - x - 3 = 2x(x+3) - 1(x+3) = (2x-1)(x+3). \]
</p>
<h2 id="identities" class="book-prose__heading">Standard identities</h2>
<div class="book-callout book-callout--formula" role="note">
<p class="book-callout__label">Identities</p>
<p class="book-formula">
\[ a^2 - b^2 = (a+b)(a-b) \]
\[ (a+b)^2 = a^2 + 2ab + b^2 \]
\[ (a-b)^2 = a^2 - 2ab + b^2 \]
</p>
</div>
<p>
Recognising these forms speeds up factorisation. For example,
\(x^2 - 9 = x^2 - 3^2 = (x+3)(x-3)\) and
\(x^2 + 6x + 9 = (x+3)^2\).
</p>
<h2 id="quadratic-trinomials" class="book-prose__heading">Quadratic trinomials</h2>
<p>
To factorise a <strong>monic</strong> quadratic \(x^2 + bx + c\), find two numbers that
<em>multiply</em> to \(c\) and <em>add</em> to \(b\):
\[ x^2 + 5x + 6 = (x+2)(x+3) \quad\text{since } 2\times 3 = 6,\; 2+3 = 5. \]
</p>
<p>
For a <strong>non-monic</strong> quadratic \(ax^2 + bx + c\) with \(a \neq 1\), use the
<strong>ac-method</strong>: find two numbers that multiply to \(ac\) and add to \(b\), split the
middle term, then factor by grouping:
\[ 2x^2 + 7x + 3 = 2x^2 + 6x + x + 3 = 2x(x+3) + 1(x+3) = (2x+1)(x+3). \]
</p>
<p>
This chapter stops at factorising expressions. Solving equations of the form \(ax^2+bx+c=0\) is
covered in the chapter on quadratic equations.
</p>
<h2 id="try-it-yourself" class="book-prose__heading">Try it yourself</h2>
<p>
Use the area model to see how \((a+b)(c+d)\) splits into four partial products. Then practise
choosing a factorisation method and checking your factors in the explorer below.
</p>
</div>
<div class="math-widget-mount" data-widget="area-model" data-pagefind-ignore></div>
<div class="math-widget-mount" data-widget="factorisation-checker" data-pagefind-ignore></div>

View file

@ -0,0 +1,225 @@
<div class="book-prose">
<h2 id="history" class="book-prose__heading">History</h2>
<p>
Long before modern symbols, people solved problems that required multiplying lengths and
collecting areas — the same ideas behind expanding and factorising. Babylonian scribes (around
1800&nbsp;BCE) recorded rectangle problems on clay tablets: given area and side relationships,
find unknown lengths. Their recipes are early cousins of “expand, then simplify.”
</p>
<figure class="book-figure">
<img
class="book-figure__img"
src="/chapters/math/polynomials-expansion-factorisation/polynomials-history.png"
alt="Illustrated timeline: Babylonian area on clay tablets, al-Khwarizmi's algebra, Viète's difference of squares, Enlightenment science, and modern expand–factorise steps"
width="960"
height="640"
loading="lazy"
decoding="async"
/>
<figcaption class="book-figure__caption">
From geometric area puzzles to symbolic algebra: how expansion and factorisation became
standard tools in school mathematics.
</figcaption>
</figure>
<p>
In the 9th century, <strong>al-Khwarizmi</strong> organised methods for equations and products
in Arabic texts that later spread to Europe. Renaissance mathematicians such as
<strong>Viète</strong> introduced letters for unknowns and constants, making it easier to see
patterns like \(a^2 - b^2\). By the 17th–18th centuries, polynomial algebra was central to
calculus and science; factorisation became a routine step before solving equations or
simplifying formulas.
</p>
<h2 id="derivation" class="book-prose__heading">Derivation</h2>
<h3 id="area-distributive" class="book-prose__heading">Area proof of \((a+b)(c+d)\)</h3>
<p>
Draw a rectangle with width \(a+b\) and height \(c+d\). The total area is \((a+b)(c+d)\). Split
the rectangle into four smaller rectangles with areas \(ac\), \(ad\), \(bc\), and \(bd\). The
sum of partial areas equals the whole:
\[ (a+b)(c+d) = ac + ad + bc + bd. \]
This is the distributive law in two dimensions — the same picture as in the area-model widget
above.
</p>
<h3 id="derive-identities" class="book-prose__heading">Deriving standard identities</h3>
<p>
Set \(c = a\) and \(d = b\) in the area formula for a square of side \(a+b\):
\[ (a+b)^2 = a^2 + ab + ab + b^2 = a^2 + 2ab + b^2. \]
For a square of side \(a-b\) (with \(a &gt; b\)), remove a strip of width \(b\) from a square of
side \(a\); the remaining L-shape rearranges to show
\[ (a-b)^2 = a^2 - 2ab + b^2. \]
Difference of squares: a large square of side \(a\) minus a small square of side \(b\) leaves two
congruent rectangles, which rearrange to a rectangle of dimensions \((a+b)\) by \((a-b)\):
\[ a^2 - b^2 = (a+b)(a-b). \]
</p>
<h3 id="grouping-walkthrough" class="book-prose__heading">Grouping walkthrough</h3>
<p>
Factorise \(3x^2 + 12x - 2x - 8\).
</p>
<ol>
<li>Group: \((3x^2 + 12x) + (-2x - 8)\).</li>
<li>Factor each pair: \(3x(x+4) - 2(x+4)\).</li>
<li>Common bracket \((x+4)\): \((3x-2)(x+4)\).</li>
</ol>
<h2 id="checkpoints" class="book-prose__heading">Checkpoints</h2>
<p>
Pause and reason before continuing. Discuss with a partner or write your work in a notebook.
</p>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
In \(4x^3 - 2x^2 + 5\), what is the degree? Which terms are like terms with \(4x^3\)?
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Expand \((2x-1)(x+4)\) without skipping steps. How many terms do you get before collecting?
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
How would you factorise \(x^2 - 16\)? Which identity applies?
</p>
</div>
<div class="book-callout" role="note">
<p class="book-callout__label">Checkpoint</p>
<p>
Expand \(x(x+1) - (x+1)\). What common factor appears? What is the factorised form?
</p>
</div>
<h2 id="applications" class="book-prose__heading">Applications</h2>
<h3 id="geometry-area" class="book-prose__heading">Geometry: area and perimeter</h3>
<p>
A rectangle has sides \((x+3)\) cm and \((2x-1)\) cm. Its area is
\[ (x+3)(2x-1) = 2x^2 + 5x - 3 \quad\text{cm}^2. \]
The perimeter is \(2\bigl((x+3)+(2x-1)\bigr) = 2(3x+2) = 6x+4\) cm. Expansion links algebraic
descriptions of sides to measurable quantities.
</p>
<h3 id="revenue-profit" class="book-prose__heading">Revenue and pricing</h3>
<p>
If a shop sells \(n\) items at price \((50 - 0.5n)\) dollars each, revenue is
\(n(50 - 0.5n) = 50n - 0.5n^2\). Expanding a product of two linear factors often appears before
finding maximum revenue (a quadratic in \(n\)).
</p>
<h3 id="number-pattern" class="book-prose__heading">Number patterns</h3>
<p>
Notice that \(11^2 = 121\), \(111^2 = 12321\). In general, expanding \((10^k + 10^{k-1} +
\cdots + 1)^2\) explains palindromic squares — a playful link between identities and arithmetic
patterns.
</p>
<h2 id="question-bank" class="book-prose__heading">Question bank</h2>
<p>
Work each question, then open the solution to check your reasoning. Difficulty increases
through the sets.
</p>
<h3 id="questions-easy" class="book-prose__heading">Easy</h3>
<details class="book-question">
<summary class="book-question__prompt">Expand \(3(x+2)\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(3x + 6\).</p>
<p><strong>Steps:</strong> \(3 \cdot x + 3 \cdot 2 = 3x + 6\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Simplify \(2x + 5x - 1\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(7x - 1\).</p>
<p><strong>Explanation:</strong> Combine like terms \(2x + 5x = 7x\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Factorise \(6x + 9\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(3(2x + 3)\).</p>
<p><strong>Steps:</strong> HCF is \(3\); \(6x \div 3 = 2x\), \(9 \div 3 = 3\).</p>
</div>
</details>
<h3 id="questions-intermediate" class="book-prose__heading">Intermediate</h3>
<details class="book-question">
<summary class="book-question__prompt">Expand \((x+4)(x-2)\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \(x^2 + 2x - 8\).</p>
<p><strong>Steps:</strong> \(x^2 - 2x + 4x - 8 = x^2 + 2x - 8\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Factorise \(x^2 - 9\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((x+3)(x-3)\).</p>
<p><strong>Explanation:</strong> Difference of squares: \(x^2 - 3^2\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Factorise \(x^2 + 6x + 9\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((x+3)^2\).</p>
<p><strong>Explanation:</strong> Perfect square: \(3 \times 3 = 9\), \(3 + 3 = 6\).</p>
</div>
</details>
<h3 id="questions-difficult" class="book-prose__heading">Difficult</h3>
<details class="book-question">
<summary class="book-question__prompt">Factorise \(2x^2 + 6x - x - 3\) by grouping.</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((2x-1)(x+3)\).</p>
<p><strong>Steps:</strong> \(2x(x+3) - 1(x+3) = (2x-1)(x+3)\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">Factorise \(2x^2 + 7x + 3\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((2x+1)(x+3)\).</p>
<p><strong>Steps:</strong> \(ac = 6\); split \(7x = 6x + x\); \(2x(x+3) + 1(x+3) = (2x+1)(x+3)\).</p>
</div>
</details>
<h3 id="questions-hardcore" class="book-prose__heading">Hardcore</h3>
<details class="book-question">
<summary class="book-question__prompt">Expand and then factorise \(x(x+2) - (x+2)\).</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((x+2)(x-1)\) after factorising (expansion gives \(x^2 + x - 2\)).</p>
<p><strong>Steps:</strong> Factor common \((x+2)\): \((x+2)(x-1)\). Check: \((x+2)(x-1) = x^2 + x - 2\).</p>
</div>
</details>
<details class="book-question">
<summary class="book-question__prompt">A rectangle has sides \((x+3)\) cm and \((2x-1)\) cm. Find its area in expanded form.</summary>
<div class="book-question__solution">
<p><strong>Answer:</strong> \((2x^2 + 5x - 3)\) cm².</p>
<p><strong>Calculation:</strong> \((x+3)(2x-1) = 2x^2 - x + 6x - 3 = 2x^2 + 5x - 3\).</p>
</div>
</details>
<h2 id="references" class="book-prose__heading">References</h2>
<ul>
<li>al-Khwarizmi, <em>Al-Kitāb al-mukhtaṣar fī ḥisāb al-jabr wal-muqābala</em> (c. 820 CE) — systematic treatment of algebra.</li>
<li>HKDSE Compulsory Part curriculum — Number and Algebra strand (polynomials, expansion, factorisation).</li>
</ul>
</div>

View file

@ -0,0 +1,152 @@
import katex from "katex";
import { createEffect, createMemo, createSignal } from "solid-js";
import { renderMathInContainer } from "../../../../frontend/src/lib/render-math";
function formatNum(n: number) {
return String(n);
}
function renderLatex(latex: string) {
return katex.renderToString(latex, { throwOnError: false, strict: "ignore" });
}
function AreaModel() {
const [a, setA] = createSignal(2);
const [b, setB] = createSignal(3);
const [c, setC] = createSignal(1);
const [d, setD] = createSignal(4);
const ac = createMemo(() => a() * c());
const ad = createMemo(() => a() * d());
const bc = createMemo(() => b() * c());
const bd = createMemo(() => b() * d());
const total = createMemo(() => ac() + ad() + bc() + bd());
const expansionHtml = createMemo(() =>
renderLatex(
`(${formatNum(a())}+${formatNum(b())})(${formatNum(c())}+${formatNum(d())}) = ${ac()} + ${ad()} + ${bc()} + ${bd()} = ${total()}`
)
);
let captionRef: HTMLElement | undefined;
createEffect(() => {
a();
b();
c();
d();
expansionHtml();
if (captionRef) renderMathInContainer(captionRef);
});
return (
<section class="math-widget" aria-labelledby="area-model-title">
<h2 id="area-model-title" class="math-widget__title">Area model for expansion</h2>
<div class="math-widget__body">
<div class="math-widget__controls">
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="area-a">
<span>Width part a</span>
<span class="scenario-demo__value">{a()}</span>
</label>
<input
id="area-a"
class="scenario-demo__slider"
type="range"
min={1}
max={6}
step={1}
value={a()}
onInput={(e) => setA(Number(e.currentTarget.value))}
/>
</div>
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="area-b">
<span>Width part b</span>
<span class="scenario-demo__value">{b()}</span>
</label>
<input
id="area-b"
class="scenario-demo__slider"
type="range"
min={1}
max={6}
step={1}
value={b()}
onInput={(e) => setB(Number(e.currentTarget.value))}
/>
</div>
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="area-c">
<span>Height part c</span>
<span class="scenario-demo__value">{c()}</span>
</label>
<input
id="area-c"
class="scenario-demo__slider"
type="range"
min={1}
max={6}
step={1}
value={c()}
onInput={(e) => setC(Number(e.currentTarget.value))}
/>
</div>
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="area-d">
<span>Height part d</span>
<span class="scenario-demo__value">{d()}</span>
</label>
<input
id="area-d"
class="scenario-demo__slider"
type="range"
min={1}
max={6}
step={1}
value={d()}
onInput={(e) => setD(Number(e.currentTarget.value))}
/>
</div>
</div>
<div class="math-widget__formula" innerHTML={expansionHtml()} aria-live="polite" />
<figure class="math-widget__figure">
<div
class="polynomials-area-model__grid"
role="img"
aria-label={`Rectangle split into areas ${ac()}, ${ad()}, ${bc()}, and ${bd()}`}
style={{
"grid-template-columns": `${a()}fr ${b()}fr`,
"grid-template-rows": `${c()}fr ${d()}fr`,
}}
>
<div class="polynomials-area-model__cell polynomials-area-model__cell--ac">{ac()}</div>
<div class="polynomials-area-model__cell polynomials-area-model__cell--ad">
{ad()}
</div>
<div class="polynomials-area-model__cell polynomials-area-model__cell--bc">
{bc()}
</div>
<div class="polynomials-area-model__cell polynomials-area-model__cell--bd">
{bd()}
</div>
</div>
<figcaption
class="math-widget__caption"
ref={(el) => {
captionRef = el;
if (el) renderMathInContainer(el);
}}
>
A rectangle of side \((a+b)\) by \((c+d)\) splits into regions \(ac\), \(ad\), \(bc\),
\(bd\).
</figcaption>
</figure>
</div>
</section>
);
}
export default AreaModel;

View file

@ -0,0 +1,267 @@
import { createMemo, createSignal, For, Show } from "solid-js";
type Technique =
| "hcf"
| "grouping"
| "difference-squares"
| "perfect-square"
| "quadratic";
type Problem = {
id: string;
expression: string;
answers: string[];
steps: string[];
};
const PROBLEMS: Record<Technique, Problem[]> = {
hcf: [
{
id: "hcf-1",
expression: "6x + 9",
answers: ["3(2x+3)", "3(2x + 3)"],
steps: [
"HCF of 6 and 9 is 3.",
"Factor out 3: 3(2x + 3).",
],
},
{
id: "hcf-2",
expression: "4x² − 8x",
answers: ["4x(x-2)", "4x(x − 2)", "4x(x-2)"],
steps: [
"HCF is 4x.",
"4x² ÷ 4x = x; −8x ÷ 4x = −2.",
"Result: 4x(x − 2).",
],
},
],
grouping: [
{
id: "grp-1",
expression: "ax + ay + bx + by",
answers: ["(a+b)(x+y)", "(a+b)(x + y)", "(b+a)(x+y)"],
steps: [
"Group: a(x+y) + b(x+y).",
"Common bracket (x+y): (a+b)(x+y).",
],
},
{
id: "grp-2",
expression: "2x² + 6x − x − 3",
answers: ["(2x-1)(x+3)", "(2x-1)(x + 3)", "(x+3)(2x-1)"],
steps: [
"Group: 2x(x+3) − 1(x+3).",
"Factor (x+3): (2x−1)(x+3).",
],
},
],
"difference-squares": [
{
id: "dos-1",
expression: "x² − 9",
answers: ["(x+3)(x-3)", "(x-3)(x+3)", "(x + 3)(x - 3)"],
steps: [
"Recognise a² − b² with a = x, b = 3.",
"(x+3)(x−3).",
],
},
{
id: "dos-2",
expression: "4x² − 25",
answers: ["(2x+5)(2x-5)", "(2x-5)(2x+5)", "(2x + 5)(2x - 5)"],
steps: [
"4x² = (2x)² and 25 = 5².",
"(2x+5)(2x−5).",
],
},
],
"perfect-square": [
{
id: "ps-1",
expression: "x² + 6x + 9",
answers: ["(x+3)²", "(x+3)^2", "(x + 3)^2"],
steps: [
"Check: 3 × 3 = 9 and 3 + 3 = 6.",
"Perfect square: (x+3)².",
],
},
{
id: "ps-2",
expression: "x² − 10x + 25",
answers: ["(x-5)²", "(x-5)^2", "(x − 5)^2"],
steps: [
"5 × 5 = 25 and −5 + (−5) = −10.",
"(x−5)².",
],
},
],
quadratic: [
{
id: "quad-1",
expression: "x² + 5x + 6",
answers: ["(x+2)(x+3)", "(x+3)(x+2)", "(x + 2)(x + 3)"],
steps: [
"Find two numbers: product 6, sum 5 → 2 and 3.",
"(x+2)(x+3).",
],
},
{
id: "quad-2",
expression: "2x² + 7x + 3",
answers: ["(2x+1)(x+3)", "(x+3)(2x+1)", "(2x + 1)(x + 3)"],
steps: [
"ac = 6; split 7x as 6x + x.",
"2x(x+3) + 1(x+3) = (2x+1)(x+3).",
],
},
],
};
const TECHNIQUE_LABELS: Record<Technique, string> = {
hcf: "Highest common factor",
grouping: "Grouping",
"difference-squares": "Difference of squares",
"perfect-square": "Perfect square",
quadratic: "Quadratic trinomial",
};
/** Normalize student input for comparison: lowercase, no spaces, ×→*, superscript ²→^2 */
function normalizeAnswer(raw: string): string {
return raw
.toLowerCase()
.replace(/\s+/g, "")
.replace(/×/g, "*")
.replace(/²/g, "^2")
.replace(/−/g, "-")
.replace(/–/g, "-");
}
function FactorisationChecker() {
const [technique, setTechnique] = createSignal<Technique>("hcf");
const [problemIndex, setProblemIndex] = createSignal(0);
const [input, setInput] = createSignal("");
const [checked, setChecked] = createSignal(false);
const [revealed, setRevealed] = createSignal(false);
const problems = createMemo(() => PROBLEMS[technique()]);
const problem = createMemo(() => problems()[problemIndex() % problems().length]);
const isCorrect = createMemo(() => {
if (!checked()) return false;
const norm = normalizeAnswer(input());
return problem().answers.some((a) => normalizeAnswer(a) === norm);
});
const changeTechnique = (t: Technique) => {
setTechnique(t);
setProblemIndex(0);
setInput("");
setChecked(false);
setRevealed(false);
};
const nextProblem = () => {
setProblemIndex((i) => (i + 1) % problems().length);
setInput("");
setChecked(false);
setRevealed(false);
};
const checkAnswer = () => {
setChecked(true);
};
return (
<section class="math-widget" aria-labelledby="factor-checker-title">
<h2 id="factor-checker-title" class="math-widget__title">Factorisation checker</h2>
<div class="math-widget__body">
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="factor-technique">
<span>Method</span>
</label>
<select
id="factor-technique"
class="polynomials-factor-checker__input"
value={technique()}
onChange={(e) => changeTechnique(e.currentTarget.value as Technique)}
>
<For each={Object.keys(TECHNIQUE_LABELS) as Technique[]}>
{(key) => <option value={key}>{TECHNIQUE_LABELS[key]}</option>}
</For>
</select>
</div>
<p class="scenario-demo__live" aria-live="polite">
Factorise: <strong>{problem().expression}</strong>
</p>
<div class="scenario-demo__control">
<label class="scenario-demo__label" for="factor-answer">
<span>Your factors</span>
</label>
<input
id="factor-answer"
class="polynomials-factor-checker__input"
type="text"
placeholder="e.g. (x+2)(x+3)"
value={input()}
onInput={(e) => {
setInput(e.currentTarget.value);
setChecked(false);
setRevealed(false);
}}
/>
</div>
<div class="scenario-demo__actions">
<button type="button" class="scenario-demo__btn scenario-demo__btn--primary" onClick={checkAnswer}>
Check
</button>
<button type="button" class="scenario-demo__btn" onClick={() => setRevealed(true)}>
Show steps
</button>
<button type="button" class="scenario-demo__btn" onClick={nextProblem}>
Next
</button>
</div>
<Show when={checked()}>
<div
class={`polynomials-factor-checker__feedback ${
isCorrect()
? "polynomials-factor-checker__feedback--correct"
: "polynomials-factor-checker__feedback--incorrect"
}`}
role="status"
>
{isCorrect() ? (
<p>Correct — well done.</p>
) : (
<p>
Not quite. Compare with the worked steps, or try equivalent factor order such as
(x+3)(x+2) instead of (x+2)(x+3).
</p>
)}
</div>
</Show>
<Show when={revealed()}>
<div class="polynomials-factor-checker__feedback">
<p>
<strong>Method:</strong> {TECHNIQUE_LABELS[technique()]}
</p>
<ol class="polynomials-factor-checker__steps">
<For each={problem().steps}>{(step) => <li>{step}</li>}</For>
</ol>
<p>
<strong>Answer:</strong> {problem().answers[0]}
</p>
</div>
</Show>
</div>
</section>
);
}
export default FactorisationChecker;

View file

@ -2,7 +2,7 @@
title = "Quadratic equations"
description = "The discriminant, nature of roots, and the graph of y = ax² + bx + c."
template = "chapter.html"
weight = 1
weight = 2
[extra]
subject = "math"
chapter_id = "quadratic-equations"

View file

@ -1,7 +1,7 @@
{
"title": "Curriculum Catalog",
"subtitle": "Browse chapters by subject and curriculum",
"curriculums": ["DSE", "IB", "A-Level", "AP", "IGCSE"],
"curriculums": ["Foundation", "DSE", "IB", "A-Level", "AP", "IGCSE"],
"subjects": [
{ "id": "math", "name": "Mathematics" },
{ "id": "science", "name": "Science" },

View file

@ -4,6 +4,7 @@
"intro": "Topic units across three strands. The map shows required prerequisites; the list follows a readable teaching order.",
"graph": {
"edges": [
{ "from": "counting-and-numbers", "to": "directed-numbers-rates" },
{ "from": "directed-numbers-rates", "to": "polynomials-expansion-factorisation" },
{ "from": "polynomials-expansion-factorisation", "to": "algebraic-fractions-formulas" },
{ "from": "polynomials-expansion-factorisation", "to": "linear-equations-two-unknowns" },
@ -49,6 +50,13 @@
"id": "number-algebra",
"title": "Number & Algebra",
"chapters": [
{
"slug": "counting-and-numbers",
"title": "Counting and numbers",
"description": "Count from zero, spot patterns, add, multiply, and divide; then meet place value and big numbers from hundreds to billions.",
"status": "live",
"curriculums": ["Foundation"]
},
{
"slug": "directed-numbers-rates",
"title": "Directed numbers, rates & ratios",
@ -60,14 +68,14 @@
"slug": "polynomials-expansion-factorisation",
"title": "Polynomials: expansion & factorisation",
"description": "Expand products, collect like terms, and factorise expressions using common factors and identities.",
"status": "planned",
"status": "live",
"curriculums": ["DSE"]
},
{
"slug": "algebraic-fractions-formulas",
"title": "Algebraic fractions & formulas",
"description": "Simplify algebraic fractions and change the subject of formulas in applied contexts.",
"status": "planned",
"status": "live",
"curriculums": ["DSE"]
},
{

View file

@ -6,6 +6,8 @@ type NavHeading = {
level: 2 | 3;
};
/** Delay before closing the rail menu so brief pointer gaps do not dismiss it. */
const RAIL_CLOSE_DELAY_MS = 200;
/** Align with sticky site header (see .book-prose__heading scroll-margin-top). */
const SCROLL_OFFSET = 96;
const CLICK_LOCK_FALLBACK_MS = 900;
@ -44,14 +46,57 @@ function pickActiveId(items: NavHeading[]): string | null {
return active;
}
function scrollMenuToActive(container: HTMLElement | undefined, activeId: string | null) {
if (!container || !activeId) return;
const activeEl = container.querySelector(`[data-heading-id="${CSS.escape(activeId)}"]`);
if (activeEl instanceof HTMLElement) {
activeEl.scrollIntoView({ block: "center" });
}
}
export function ChapterHeadingNav() {
const [headings, setHeadings] = createSignal<NavHeading[]>([]);
const [activeId, setActiveId] = createSignal<string | null>(null);
const [railOpen, setRailOpen] = createSignal(false);
const [sheetOpen, setSheetOpen] = createSignal(false);
const [isMobile, setIsMobile] = createSignal(false);
const [popoverListEl, setPopoverListEl] = createSignal<HTMLUListElement | undefined>();
const [sheetEl, setSheetEl] = createSignal<HTMLElement | undefined>();
let scrollToHeading: ((id: string) => void) | undefined;
let railCloseTimer: number | undefined;
const syncActiveFromScroll = () => {
const items = headings();
if (items.length > 0) {
setActiveId(pickActiveId(items));
}
};
const openRail = () => {
if (railCloseTimer !== undefined) {
window.clearTimeout(railCloseTimer);
railCloseTimer = undefined;
}
syncActiveFromScroll();
setRailOpen(true);
};
const scheduleRailClose = () => {
if (railCloseTimer !== undefined) {
window.clearTimeout(railCloseTimer);
}
railCloseTimer = window.setTimeout(() => {
railCloseTimer = undefined;
setRailOpen(false);
}, RAIL_CLOSE_DELAY_MS);
};
onCleanup(() => {
if (railCloseTimer !== undefined) {
window.clearTimeout(railCloseTimer);
}
});
onMount(() => {
const article = document.querySelector<HTMLElement>(".book-chapter");
@ -146,6 +191,35 @@ export function ChapterHeadingNav() {
}
});
createEffect(() => {
if (!railOpen()) return;
const list = popoverListEl();
const id = activeId();
if (!list || !id) return;
requestAnimationFrame(() => scrollMenuToActive(list, id));
});
createEffect(() => {
if (!sheetOpen()) return;
const sheet = sheetEl();
const id = activeId();
if (!sheet || !id) return;
requestAnimationFrame(() => scrollMenuToActive(sheet, id));
});
const openSheet = () => {
syncActiveFromScroll();
setSheetOpen(true);
};
const toggleSheet = () => {
if (sheetOpen()) {
setSheetOpen(false);
return;
}
openSheet();
};
const jump = (id: string) => {
if (scrollToHeading) {
scrollToHeading(id);
@ -161,12 +235,17 @@ export function ChapterHeadingNav() {
setSheetOpen(false);
};
const NavList = (props: { class?: string }) => (
<ul class={`chapter-heading-nav__list ${props.class ?? ""}`.trim()} role="list">
const NavList = (props: { listRef?: (el: HTMLUListElement) => void; class?: string }) => (
<ul
ref={props.listRef}
class={`chapter-heading-nav__list ${props.class ?? ""}`.trim()}
role="list"
>
<For each={headings()}>
{(item) => (
<li
class="chapter-heading-nav__item"
data-heading-id={item.id}
classList={{
"chapter-heading-nav__item--active": activeId() === item.id,
"chapter-heading-nav__item--h3": item.level === 3,
@ -175,6 +254,7 @@ export function ChapterHeadingNav() {
<button
type="button"
class="chapter-heading-nav__link"
aria-current={activeId() === item.id ? "location" : undefined}
onClick={() => jump(item.id)}
>
{item.label}
@ -191,12 +271,12 @@ export function ChapterHeadingNav() {
<Show when={!isMobile()}>
<div
class="chapter-heading-nav__rail-wrap"
onMouseEnter={() => setRailOpen(true)}
onMouseLeave={() => setRailOpen(false)}
onFocusIn={() => setRailOpen(true)}
onMouseEnter={openRail}
onMouseLeave={scheduleRailClose}
onFocusIn={openRail}
onFocusOut={(e) => {
if (!e.currentTarget.contains(e.relatedTarget as Node)) {
setRailOpen(false);
scheduleRailClose();
}
}}
>
@ -218,9 +298,13 @@ export function ChapterHeadingNav() {
</For>
</div>
<Show when={railOpen()}>
<div class="chapter-heading-nav__popover" role="dialog" aria-label="Page sections">
<div
class="chapter-heading-nav__popover"
role="dialog"
aria-label="Page sections"
>
<p class="chapter-heading-nav__popover-title">On this page</p>
<NavList />
<NavList listRef={setPopoverListEl} />
</div>
</Show>
</div>
@ -232,7 +316,7 @@ export function ChapterHeadingNav() {
class="chapter-heading-nav__fab"
aria-expanded={sheetOpen()}
aria-controls="chapter-heading-sheet"
onClick={() => setSheetOpen((open) => !open)}
onClick={toggleSheet}
>
On this page
</button>
@ -245,6 +329,7 @@ export function ChapterHeadingNav() {
/>
<div
id="chapter-heading-sheet"
ref={setSheetEl}
class="chapter-heading-nav__sheet"
role="dialog"
aria-label="On this page"

View file

@ -2,6 +2,7 @@ import type { CatalogChapterTier } from "../../../data/catalog.types";
export function curriculumBadgeClass(curriculum: string): string {
const map: Record<string, string> = {
Foundation: "catalog-badge--foundation",
DSE: "catalog-badge--dse",
IB: "catalog-badge--ib",
"A-Level": "catalog-badge--a-level",

View file

@ -6,6 +6,7 @@ import { $ } from "bun";
const ROOT = join(import.meta.dir, "..");
const CONTENT = join(ROOT, "content");
const GENERATED_META = join(ROOT, "data/_generated/chapters-meta.json");
const GENERATED_NAV = join(ROOT, "data/_generated/chapter-nav.json");
const GENERATED_WIDGETS = join(ROOT, "frontend/src/generated/chapter-widgets.ts");
const STATIC_ROOT = join(ROOT, "static");
const CHAPTER_CSS_DIR = join(STATIC_ROOT, "css/chapters");
@ -19,6 +20,30 @@ type ChaptersMetaFile = {
chapters: Record<string, ChapterMeta>;
};
type CurriculumChapter = {
slug: string;
title: string;
status: "live" | "planned";
};
type CurriculumFile = {
strands: Array<{ chapters: CurriculumChapter[] }>;
};
type NavLink = {
slug: string;
title: string;
};
type ChapterNavEntry = {
prev: NavLink | null;
next: NavLink | null;
};
type ChapterNavFile = {
byKey: Record<string, ChapterNavEntry>;
};
function parseChapterTemplate(markdown: string): boolean {
return /template\s*=\s*["']chapter\.html["']/.test(markdown);
}
@ -167,6 +192,41 @@ async function syncChapter(chapter: {
return { key, meta: { hasSupplement, hasCss }, widgets };
}
async function buildChapterNav(
discovered: Array<{ subject: string; slug: string }>
): Promise<ChapterNavFile> {
const discoveredSet = new Set(discovered.map((c) => `${c.subject}/${c.slug}`));
const byKey: Record<string, ChapterNavEntry> = {};
const subjects = [...new Set(discovered.map((c) => c.subject))];
for (const subject of subjects) {
const curriculumPath = join(ROOT, "data", `${subject}-curriculum.json`);
if (!existsSync(curriculumPath)) continue;
const curriculum = JSON.parse(await readFile(curriculumPath, "utf8")) as CurriculumFile;
const sequence: NavLink[] = [];
for (const strand of curriculum.strands) {
for (const chapter of strand.chapters) {
if (chapter.status !== "live") continue;
const key = `${subject}/${chapter.slug}`;
if (!discoveredSet.has(key)) continue;
sequence.push({ slug: chapter.slug, title: chapter.title });
}
}
for (let i = 0; i < sequence.length; i++) {
const key = `${subject}/${sequence[i].slug}`;
byKey[key] = {
prev: i > 0 ? sequence[i - 1] : null,
next: i < sequence.length - 1 ? sequence[i + 1] : null,
};
}
}
return { byKey };
}
function buildWidgetRegistry(
entries: Array<{ key: string; widgets: string[]; dir: string }>
): string {
@ -210,6 +270,9 @@ async function main() {
await mkdir(dirname(GENERATED_WIDGETS), { recursive: true });
await writeFile(GENERATED_WIDGETS, buildWidgetRegistry(widgetEntries));
const chapterNav = await buildChapterNav(chapters);
await writeFile(GENERATED_NAV, `${JSON.stringify(chapterNav, null, 2)}\n`);
console.log(`Synced ${chapters.length} chapter(s).`);
}

View file

@ -452,6 +452,91 @@ a.book-chapter-link:focus-visible {
background: var(--math-curve, #9a6b2e);
}
.book-chapter-footer {
margin-top: 3.5rem;
padding-top: 2rem;
border-top: 1px solid var(--line);
max-width: var(--prose-width);
}
.book-chapter-footer__catalog {
display: inline-block;
margin-bottom: 1.25rem;
font-family: var(--mono);
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
text-decoration: none;
color: var(--soft-ink);
}
.book-chapter-footer__catalog:hover,
.book-chapter-footer__catalog:focus-visible {
color: var(--accent);
}
.book-chapter-footer__adjacent {
display: grid;
gap: 12px;
}
@media (min-width: 640px) {
.book-chapter-footer__adjacent {
grid-template-columns: 1fr 1fr;
gap: 16px;
}
}
.book-chapter-footer__link {
display: flex;
flex-direction: column;
gap: 6px;
padding: 16px 18px;
border: 1px solid var(--card-border);
border-radius: 12px;
background: var(--card-bg);
text-decoration: none;
color: var(--ink);
transition: border-color 200ms ease, box-shadow 200ms ease;
}
.book-chapter-footer__link:hover,
.book-chapter-footer__link:focus-visible {
border-color: var(--accent);
box-shadow: 0 6px 20px var(--shadow-soft);
}
.book-chapter-footer__link--next {
text-align: right;
}
.book-chapter-footer__label {
font-family: var(--mono);
font-size: 0.65rem;
font-weight: 700;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--muted);
}
.book-chapter-footer__title {
font-family: var(--font-heading);
font-size: 1.05rem;
line-height: 1.35;
color: var(--ink);
}
.book-chapter-footer__spacer {
display: none;
}
@media (min-width: 640px) {
.book-chapter-footer__spacer {
display: block;
}
}
.book-page--chapter .book-callout--dse {
max-width: var(--prose-width);
margin-top: 2rem;

View file

@ -762,6 +762,12 @@ a.catalog-chapter-card {
letter-spacing: 0.06em;
text-transform: uppercase;
&--foundation {
color: #0f766e;
background: rgba(20, 184, 166, 0.12);
border-color: rgba(20, 184, 166, 0.28);
}
&--dse {
color: #1d4ed8;
background: rgba(59, 130, 246, 0.12);

View file

@ -11,6 +11,10 @@
top: 50%;
right: 20px;
z-index: 40;
display: flex;
flex-direction: row-reverse;
align-items: center;
gap: 12px;
transform: translateY(-50%);
}
@ -49,11 +53,15 @@
}
.chapter-heading-nav__popover {
position: absolute;
right: 36px;
top: 50%;
transform: translateY(-50%);
position: relative;
top: auto;
right: auto;
transform: none;
z-index: 40;
display: flex;
flex-direction: column;
width: min(260px, calc(100vw - 80px));
max-height: min(70vh, calc(100vh - 120px));
padding: 14px 12px;
border: 1px solid var(--card-border);
border-radius: 12px;
@ -74,6 +82,7 @@
}
.chapter-heading-nav__popover-title {
flex-shrink: 0;
margin: 0 0 10px;
font-family: var(--mono);
font-size: 0.68rem;
@ -83,6 +92,12 @@
color: var(--muted);
}
.chapter-heading-nav__popover .chapter-heading-nav__list {
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
}
.chapter-heading-nav__list {
margin: 0;
padding: 0;
@ -109,12 +124,21 @@
transition: background 120ms ease, color 120ms ease;
}
.chapter-heading-nav__link:hover,
.chapter-heading-nav__item--active .chapter-heading-nav__link {
.chapter-heading-nav__link:hover {
background: rgba(154, 107, 46, 0.1);
color: var(--ink);
}
.chapter-heading-nav__item--active .chapter-heading-nav__link {
background: rgba(154, 107, 46, 0.18);
color: var(--ink);
font-weight: 600;
}
.chapter-heading-nav__item--active .chapter-heading-nav__link:hover {
background: rgba(154, 107, 46, 0.24);
}
.chapter-heading-nav__fab {
position: fixed;
right: 16px;

View file

@ -57,6 +57,7 @@
<div id="chapter-heading-nav" data-pagefind-ignore></div>
{{ section.content | safe }}
{% include "partials/chapter-footer-nav.html" %}
</article>
</div>
</section>

View file

@ -0,0 +1,38 @@
{% set nav_data = load_data(path="data/_generated/chapter-nav.json", format="json") %}
{% set nav_entry = nav_data.byKey[chapter_key] | default(value=false) %}
<footer class="book-chapter-footer" aria-label="Chapter navigation" data-pagefind-ignore>
<a class="book-chapter-footer__catalog" href="{{ catalog_subject_url | safe }}">
Return to catalog
</a>
{% if nav_entry %}
<div class="book-chapter-footer__adjacent">
{% if nav_entry.prev %}
<a
class="book-chapter-footer__link book-chapter-footer__link--prev"
href="{{ get_url(path='/' ~ subject ~ '/' ~ nav_entry.prev.slug ~ '/') | safe }}"
rel="prev"
>
<span class="book-chapter-footer__label">Previous</span>
<span class="book-chapter-footer__title">{{ nav_entry.prev.title }}</span>
</a>
{% else %}
<span class="book-chapter-footer__spacer" aria-hidden="true"></span>
{% endif %}
{% if nav_entry.next %}
<a
class="book-chapter-footer__link book-chapter-footer__link--next"
href="{{ get_url(path='/' ~ subject ~ '/' ~ nav_entry.next.slug ~ '/') | safe }}"
rel="next"
>
<span class="book-chapter-footer__label">Next</span>
<span class="book-chapter-footer__title">{{ nav_entry.next.title }}</span>
</a>
{% else %}
<span class="book-chapter-footer__spacer" aria-hidden="true"></span>
{% endif %}
</div>
{% endif %}
</footer>