Book 6 of the Ray's Arithmetic shelf is now playable: Ray's New Elementary Algebra (Joseph Ray, Grades 9-10). It runs in the same app as Books 1-5 at https://abcbooks.fyi/math/ , with the same "Reed" voice. Each lesson reads the book's rules aloud, asks a short quiz, then gives the book's own problems. Algebra answers are expressions and minus numbers, so this book brings a new algebra pad that can type them and check them the way a teacher would. This post covers what is new for Book 6 and how to rebuild it. The app, the server and the voice recorder are explained in the Book One post, the text-recognition script in the Book 2 post, the Study and Quiz steps in the Book 5 post, and the scratch paper in the show-your-work post. Every block has a Copy button.
What is in Book 6
Each section of the book's table of contents became a lesson: 45 lessons, 282 parts of the book to study, 346 quiz questions and 1,164 problems with 1,478 answers.
- Lessons 1-10, Fundamental rules: definitions, signs, algebraic expressions, addition, subtraction, positive and negative quantities, multiplication and division of monomials and polynomials.
- Lessons 11-14, Theorems and factoring: the squares of a sum and a difference, factoring, greatest common divisor, least common multiple.
- Lessons 15-21, Algebraic fractions: lowest terms, mixed quantities, common denominators, adding, subtracting, multiplying and dividing fractions, complex fractions and infinite series.
- Lessons 22-30, Simple equations: clearing fractions, solving, about 70 word problems, two and three unknown quantities, general formulas, negative answers.
- Lessons 31-37, Powers, roots and radicals: powers, the binomial theorem, square roots of numbers and expressions, reducing, adding, multiplying and dividing radicals, equations with radicals.
- Lessons 38-42, Quadratic equations: pure and affected quadratics, completing the square, the Hindoo method, properties of the roots, quadratics with two unknown quantities.
- Lessons 43-45, Progressions and proportion: arithmetical and geometrical progressions, ratio and proportion.
The algebra pad
In Book 6 the number pad grows a second row: + − ( ) / xⁿ, and a third row with the letters that question uses (a, b, x, y...) and √ when roots come up. What you type is shown the book's way: x^2-4 shows as x² − 4. The 🎤 button stays for plain numbers only.
An answer is right when it has the same value as the book's answer (the app tries it with random numbers for the letters) and it is written as simply as the book's:
- Sums: each kind of term once. 2b+3a counts for 3a+2b, but 8a−5a does not count for 3a, and aab does not count for a²b.
- Factoring: when the book's answer is in factors, yours must be too, in any order, with nothing left to take out of a bracket. (a+4)(a+3) counts for (a+3)(a+4); 2(2x²+3xy) does not count for 2x(2x+3y).
- Fractions: no bigger than the book's (reduced to lowest terms).
- Roots: in simplest form. 2a√2 counts; √(8a²) does not.
- Two roots of a quadratic ("x = 2 or −8") can be typed in either order.
On the pad, put whatever is under a root in brackets: √(3a). √3a means a times √3.
How the book was typed up
The free PDF (raysarithmetic.wordpress.com, "9-10 Ray's New Elementary Algebra", 240 pages, about 11 MB) has no text layer. Book page = PDF page. The words were read with Windows' text recognition (ocr-pdf.ps1 from the Book 2 post), but it turns formulas into nonsense, so every formula was read off the page pictures.
This copy of the book had its printed answers blanked out (rows of dots where "Ans." used to be). The answer key on archive.org (keytoraysnewalge00rayj) only works the harder problems. So every answer was worked out, and the build script checks each one against its question.
The book source, algebra1.txt, uses Book 5's art:, mc:, tf:, q: and sol: lines, plus these:
q: Multiply `a+b` by `c+d`. {$~ (a+b)(c+d)}
q: Separate `x^2+5x+6` into factors. {$ (x+2)(x+3) @ x^2+5x+6}
q: Find `x` in `3x-5=2x+7`. {12 @x: 3x-5=2x+7}
q: Find the values of `x` in `x^2+6x=16`. x = {$ 2 @x: x^2+6x=16} or {$ -8 @x: x^2+6x=16}
chk: x=5, y=3 | x+y=8 | x*y=15
- Math goes between backticks in plain letters:
3a^2b - 4(x+y)/2,√(a-x). The app shows it the book's way, and the voice reads it in words ("3 A squared B minus 4 times the quantity X plus Y, over 2"). {$ answer}is typed on the algebra pad.{$ answer @ same}checks the answer equalssame.{$~ (a+b)(c+d)}makes the build multiply or divide it out exactly, so a misread exponent can't slip through (a division that doesn't come out even is an error).{12 @x: equation}checks that 12 solves the equation for x.chk:lines check a word problem's answers against its equations.{$ a | b}accepts either form;@gcd:and@lcm:check a common divisor or multiple;@sq:checks a square root by squaring it back.
The build refuses to write the book while any check fails. That caught real slips while typing, such as swapped answers in a sugar-mixing problem and wrong exponents in long products.
Things found on the way:
- Minus letters and roots. The checker picks random numbers, some negative. √(a²) is a, not −a, so whenever a root is involved the checker uses positive numbers only.
- Long answers. The tenth power of a+b is over 100 characters long, so the pad takes up to 200 and long answers shrink to fit.
- Answers with a root but no letters (like 4√3) at first got no √ key. The build now adds it whenever an answer has a root.
- Spoken math. "C squared, times the square root of 2" needed a "times" after an exponent, and also after numbers with more than one figure.
- Testing the pad. A test typed every one of the 1,164 answers key by key in the browser. Wait for the next question before typing: after a question with a worked solution, the app pauses about 1.5 seconds.
- The offline cache serves the old app. After changing
app.js, bumprays-shell-v19insw.js, or the old version keeps showing.
The voice
The same recorder as Books 1-5: 3,647 lines, 3,239 of them new at each speed. It took about 4 minutes per speed on the PC.
Files
Set up the Book One post first, and download the Book 6 PDF from raysarithmetic.wordpress.com (Ray's Free Arithmetic page, "Ray's New Elementary Algebra (9-10)") as C:\RaysArithmetic\source\pdf\rays-elementary-algebra-9-10.pdf. Book 6 adds or replaces the files below. Each block writes one file into /root/rays-rebuild/ when pasted into a Proxmox host shell (Proxmox web UI, pve, Shell). Then copy that folder to the PC and put:
algebra1.txtinC:\RaysArithmetic\source\make-book.ps1,make-audio.ps1,alg.csinC:\RaysArithmetic\tools\alg.js,app.js,index.html,sw.jsinC:\RaysArithmetic\public\(they replace the earlier versions and run all six books)
Proxmox host shell:
mkdir -p /root/rays-rebuild
algebra1.txt: the whole of Book 6: rules, quizzes and problems with their checks.
cat > /root/rays-rebuild/algebra1.txt <<'EOF'
@book: algebra1 | Ray's New Elementary Algebra | Elementary Algebra - Book Six | #8f2f4f
# Ray's New Elementary Algebra (Joseph Ray, 1866), typed from source/pdf/rays-elementary-algebra-9-10.pdf
# (book page N = PDF page N; no text layer: OCR in rays-elementary-algebra-9-10.ocr.txt, its math is unreadable, so
# every formula was read off the page images). This scan had its printed answers blanked out (dotted lines); answers
# are the Key's (source/pdf/rays-algebra-key.pdf, archive.org keytoraysnewalge00rayj) where it has them, else worked
# out here, and the build checks every one ({$ ... @ ...}, {N @= ...}, chk:).
# Format (Book Six) = Book Five's (art:, mc:, tf:, q:, sol:) plus algebra:
# math in a text goes between backticks, plain ASCII: `3a^2b - 4(x+y)/2`, `√a`, `a*b` (shown as ×)
# {$ expr} answer typed on the algebra pad (letters, + − ( ) / power); right = same value AND written as simply as
# the book's (unlike terms only; in factors when the book's is factored; a fraction no bigger)
# {$ expr @ same} build checks expr = same {$ 12 @x: 6x+2x = 3x+60} build checks x=12 solves it
# {15 @= 5^2-2*5} plain number, checked chk: x=5, y=4 | x+y=9 | x-y=1
# Each lesson is one section of the book's Contents. Quiz questions are written for this app from the book's articles
# and its Review questions.
== 1 | Fundamental Rules | Definitions
art: 1 | | In Algebra, quantities are represented by letters of the alphabet.
art: 2 | | Quantity is any thing that is capable of increase or decrease; as, numbers, lines, space, time, etc.
art: 3 | | Quantity is called magnitude, when considered in an undivided form; as, a quantity of water.
art: 4 | | Quantity is called multitude, when made up of individual and distinct parts; as, three cents, a quantity composed of three single cents.
art: 5 | | One of the single parts of which a quantity of multitude is composed, is called the unit of measure; thus, 1 cent is the unit of measure of the quantity 3 cents. The value or measure of any quantity is the number of times it contains its unit of measure.
art: 6 | | In quantities of magnitude, where there is no natural unit, it is necessary to fix upon an artificial unit as a standard of measure; then, to find the value of the quantity, we ascertain how many times it contains its unit of measure. Thus, to measure the length of a line, take a certain assumed distance called a foot, and, applying it a certain number of times, say 5, it is found that the line is 5 feet long; in this case, 1 foot is the unit of measure.
art: 7 | | The Numerical Value of a quantity is the number that shows how many times it contains its unit of measure. Thus, the numerical value of a line 5 feet long, is 5. The same quantity may have different numerical values, according to the unit of measure assumed.
art: 8 | | A Unit is a single thing of an order or kind.
art: 9 | | Number is an expression denoting a unit, or a collection of units. Numbers are either abstract or concrete.
art: 10 | | An Abstract Number denotes how many times a unit is to be taken. A Concrete Number denotes the units that are taken. Thus, 4 is an abstract number, denoting merely the number of units taken; while 4 feet is a concrete number, denoting what unit is taken, as well as the number taken. Or, a concrete number is the product of the unit of measure by the corresponding abstract number. Thus, $6 equal $1 multiplied by 6, or $1 taken 6 times.
art: 11 | | In algebraic computations, letters are considered the representatives of numbers.
art: 12 | | There are two kinds of questions in Algebra, theorems and problems.
art: 13 | | In a Theorem, it is required to demonstrate some relation or property of numbers, or abstract quantities.
art: 14 | | In a Problem, it is required to find the value of some unknown quantity, by means of certain given relations existing between it and others, which are known.
mc: In Algebra, quantities are represented by... | *letters of the alphabet | pictures | words only
mc: Any thing that can be made greater or less is called... | *quantity | a unit | a theorem
mc: A quantity of water, thought of in one undivided form, is called... | *magnitude | multitude | a unit
mc: Three cents, made up of single cents, is a quantity of... | *multitude | magnitude | measure
mc: In the quantity 3 cents, the unit of measure is... | *1 cent | 3 cents | 3
mc: The numerical value of a line 5 feet long is... | *5 | 1 | 5 feet
mc: "4" alone is called... | *an abstract number | a concrete number | a unit of measure
mc: "4 feet" is called... | *a concrete number | an abstract number | a theorem
mc: The two kinds of questions in Algebra are... | *theorems and problems | sums and differences | units and numbers
mc: When we must find the value of an unknown quantity from what is known, the question is a... | *problem | theorem | unit
tf: In a theorem, it is required to demonstrate some relation or property of numbers. {T}
tf: The same quantity always has the same numerical value, whatever unit we measure it by. {F}
tf: In algebraic computations, letters stand for numbers. {T}
== 2 | Fundamental Rules | Signs and terms
art: 15 | | Algebra is a general method of solving problems and demonstrating theorems, by means of figures, letters, and signs. The letters and signs are called symbols.
art: 16 | | Known Quantities are those whose values are given; Unknown Quantities, those whose values are to be determined.
art: 17 | | Known quantities are generally represented by the first letters of the alphabet, as `a`, `b`, `c`, etc.; unknown quantities, by the last letters, as `x`, `y`, `z`.
art: 18 | | The principal signs used in Algebra are =, +, −, ×, ÷, ( ), >, and √. Each sign is the representative of certain words. They are used to express the various operations in the clearest and briefest manner.
art: 19 | The Sign of Equality | The sign =, is read equal to. It denotes that the quantities between which it is placed are equal. Thus, `a=3`, denotes that the quantity represented by `a` is equal to 3.
art: 20 | The Sign of Addition | The sign +, is read plus. It denotes that the quantity to which it is prefixed is to be added. Thus, `a+b`, denotes that `b` is to be added to `a`. If `a=2` and `b=3`, then `a+b` = `2+3`, which = 5.
art: 21 | The Sign of Subtraction | The sign −, is read minus. It denotes that the quantity to which it is prefixed is to be subtracted. Thus, `a-b`, denotes that `b` is to be subtracted from `a`. If `a=5` and `b=3`, then `5-3` = 2.
art: 22 | | The signs + and − are called the signs. The former is called the positive, the latter the negative sign: they are said to be contrary or opposite.
art: 23 | | Every quantity is supposed to be preceded by one of these signs. Quantities having the positive sign are called positive; those having the negative sign, negative. When a quantity has no sign prefixed, it is positive.
art: 24 | | Quantities having the same sign are said to have like signs; those having different signs, unlike signs. Thus, `+a` and `+b`, or `-a` and `-b`, have like signs; while `+c` and `-d` have unlike signs.
art: 25 | The Sign of Multiplication | The sign ×, is read into, or multiplied by. It denotes that the quantities between which it is placed are to be multiplied together. The product of two or more letters is sometimes expressed by a dot or point, but more frequently by writing them in close succession without any sign. Thus, `ab` expresses the same as `a*b`, and `abc` = `a*b*c`.
art: 26 | | Factors are quantities that are to be multiplied together. The continued product of several factors means the product of the first and second multiplied by the third, this product by the fourth, and so on. Thus, the continued product of `a`, `b`, and `c`, is `a*b*c`, or `abc`. If `a=2`, `b=3`, and `c=5`, then `abc` = `2*3*5` = `6*5` = 30.
art: 27 | The Sign of Division | The sign ÷, is read divided by. It denotes that the quantity preceding it is to be divided by that following it. Division is oftener represented by placing the dividend as the numerator, and the divisor as the denominator of a fraction. Thus, `a÷b`, or `a/b`, means that `a` is to be divided by `b`. If `a=12` and `b=3`, then `a÷b` = `12÷3` = 4.
art: 28 | The Sign of Inequality | The sign > denotes that one of the two quantities between which it is placed is greater than the other. The opening of the sign is toward the greater quantity. Thus, `a>b`, denotes that `a` is greater than `b`. If `a=5`, and `b=3`, then `5>3`. Also, `c<d`, denotes that `c` is less than `d`. If `c=4` and `d=7`, then `4<7`.
art: 29 | The Sign of Infinity | The sign ∞ denotes a quantity greater than any that can be assigned, or one indefinitely great.
art: 30 | The Numeral Coefficient | The numeral coefficient of a quantity is a number prefixed to it, showing how many times the quantity is taken. Thus, `a+a+a+a` = `4a`; and `ax+ax+ax` = `3ax`.
art: 31 | The Literal Coefficient | The literal coefficient of a quantity is a quantity by which it is multiplied. Thus, in the quantity `ay`, `a` may be considered the coefficient of `y`, or `y` the coefficient of `a`. The literal coefficient is generally regarded as a known quantity.
art: 32 | | The coefficient of a quantity may consist of a number and a literal part. Thus, in `5ax`, `5a` may be regarded as the coefficient of `x`. If `a=2`, then `5a=10`, and `5ax=10x`. When no numeral coefficient is prefixed to a quantity, its coefficient is understood to be unity. Thus, `a=1a`, and `bx=1bx`.
art: 33 | Powers and Exponents | The Power of a quantity is the product arising from multiplying the quantity by itself one or more times. When the quantity is taken twice as a factor, the product is called its square, or second power; when three times, the cube, or third power; when four times, the fourth power, and so on. An Exponent is a figure placed at the right, and a little above a quantity, to show how many times it is taken as a factor. Thus, `aa=a^2`; `aaa=a^3`; `aaaa=a^4`; `aabbb=a^2b^3`. When no exponent is expressed, it is understood to be unity. Thus, `a` is the same as `a^1`, each expressing the first power of `a`.
art: 34 | | To raise a quantity to any given power is to find that power of the quantity.
art: 35 | Roots | The Root of a quantity is another quantity, some power of which equals the given quantity. The root is called the square root, cube root, fourth root, etc., according to the number of times it is taken as a factor to produce the given quantity. Thus, `a` is the second or square root of `a^2`, since `a*a=a^2`. So, `x` is the third or cube root of `x^3`, since `x*x*x=x^3`.
art: 36 | | To extract any root of a quantity is to find that root.
mc: The letters and signs used in Algebra are called... | *symbols | factors | coefficients
mc: Unknown quantities are generally represented by... | *the last letters, as x, y, z | the first letters, as a, b, c | numbers
mc: Known quantities are generally represented by... | *the first letters, as a, b, c | the last letters, as x, y, z | signs
mc: How is the sign + read? | *plus | minus | into
mc: How is the sign × read? | *into, or multiplied by | plus | divided by
mc: When a quantity has no sign before it, it is... | *positive | negative | zero
mc: `+c` and `-d` have... | *unlike signs | like signs | no signs
mc: `ab` means... | *`a` multiplied by `b` | `a` plus `b` | `a` divided by `b`
mc: If `a=2`, `b=3` and `c=5`, what is `abc`? | *30 | 10 | 235
mc: If `a=12` and `b=3`, what is `a/b`? | *4 | 36 | 9
mc: The opening of the sign > is toward the... | *greater quantity | less quantity | unknown quantity
mc: In `4a`, the 4 is called the... | *numeral coefficient | exponent | root
mc: In `a^3`, the 3 is called the... | *exponent | coefficient | factor
mc: `aaa` is written... | *`a^3` | `3a` | `a+3`
mc: When no coefficient is written, the coefficient is... | *1 | 0 | 2
mc: `a` is the square root of... | *`a^2` | `2a` | `a/2`
mc: `x` is the cube root of... | *`x^3` | `3x` | `x^2`
tf: `ax+ax+ax` = `3ax` {T}
tf: `a^2` means `a` taken twice as a factor, `a*a`. {T}
tf: `a^2` and `2a` mean the same thing. {F}
tf: `aabbb` = `a^2b^3` {T}
q: If `a=2`, what is `5a`? {10 @= 5*2}
q: If `a=5` and `b=3`, what is `a-b`? {2 @= 5-3}
q: How many times is `x` taken as a factor in `x^5`? {5}
q: Write `aaaa` with an exponent. {$ a^4}
q: Write `a+a+a+a+a` with a coefficient. {$ 5a}
q: Write `xxyyy` with exponents. {$ x^2y^3}
== 3 | Fundamental Rules | Algebraic expressions
art: 37 | The Radical Sign | The sign √, placed before a quantity, indicates that its root is to be extracted. Thus, `√a` denotes the square root of `a`. A little figure over the sign shows other roots: 3 over it denotes the cube root of `a`, 4 the fourth root of `a`.
art: 38 | | The number placed over the radical sign is called the index of the root. Thus, 2 is the index of the square root, 3 of the cube root, 4 of the fourth root, and so on. When the radical has no index over it, 2 is understood.
art: 39 | | Every quantity or combination of quantities expressed by means of symbols, is called an algebraic expression. Thus, `3a` is the algebraic expression for 3 times the quantity `a`; `3a-4b`, for 3 times `a`, diminished by 4 times `b`; `2a^2+3ab`, for twice the square of `a`, increased by 3 times the product of `a` and `b`.
art: 40 | Monomial | A Monomial, or Term, is an algebraic expression, not united to any other by the sign + or −. A monomial is sometimes called a simple quantity. Thus, `a`, `3a`, `-a^2b`, `2any^2`, are monomials, or simple quantities.
art: 41 | Polynomial | A Polynomial is an algebraic expression, composed of two or more terms. Thus, `c+2d-b` is a polynomial.
art: 42 | Binomial | A Binomial is a polynomial composed of two terms. Thus, `a+b`, `a-b`, and `c^2-d`, are binomials. A Residual Quantity is a binomial, in which the second term is negative, as `a-b`.
art: 43 | Trinomial | A Trinomial is a polynomial consisting of three terms. Thus, `a+b+c`, and `a-b-c`, are trinomials.
art: 44 | Numerical Value | The Numerical Value of an algebraic expression is the number obtained, by giving particular values to the letters, and then performing the operations indicated. In the algebraic expression `2a+3b`, if `a=4`, and `b=5`, then `2a=8`, and `3b=15`, and the numerical value is `8+15` = 23.
art: 45 | | The value of a polynomial is not affected by changing the order of the terms, provided each term retains its respective sign. Thus, `a^2+2a+b` = `b+a^2+2a`. This is self-evident.
art: 46 | Degree | Each of the literal factors of any simple quantity or term is called a dimension of that term. The degree of a term depends on the number of its literal factors. Thus, `ax` consists of two literal factors, `a` and `x`, and is of the second degree. The quantity `a^2b` contains three literal factors, `a`, `a`, and `b`, and is of the third degree. `2a^3x^2` contains 5 literal factors, `a`, `a`, `a`, `x`, and `x`, and is of the fifth degree; and so on.
art: 47 | Homogeneous | A polynomial is said to be homogeneous, when each of its terms is of the same degree. Thus, the polynomials `2a-3b+c`, of the first degree, `a^2+3bc+xy`, of the second degree, and `x^3-8ay^2`, of the third degree, are homogeneous: `a^3+x^2` is not homogeneous.
art: 48 | Parenthesis | A Parenthesis, ( ), is used to show that all the included terms are to be considered together as a single term. Thus, `4(a-b)` means that `a-b` is to be multiplied by 4; `(a+x)(a-x)` means that `a+x` is to be multiplied by `a-x`; `10-(a+c)` means that `a+c` is to be subtracted from 10; `(a-b)^2` means that `a-b` is to be raised to the second power; and so on.
art: 49 | Vinculum | A Vinculum, a line drawn over the terms, is sometimes used instead of a parenthesis. Thus, `a-b` with a line over it, times `x`, means the same as `(a-b)x`. Sometimes the vinculum is placed vertically: it is then called a bar.
art: 50 | Like Quantities | Similar or Like quantities are those composed of the same letters, affected with the same exponents. Thus, `7ab` and `-3ab`, also `4a^3b^2` and `7a^3b^2`, are similar terms; but `2a^2b` and `2ab^2` are not similar; for, though composed of the same letters, these letters have different exponents.
art: 51 | Reciprocal | The Reciprocal of a quantity is unity divided by that quantity. Thus, the reciprocal of 2 is `1/2`, of `a` is `1/a`. The reciprocal of `2/3` is 1 divided by `2/3`, or `3/2`. Hence, the reciprocal of a fraction is the fraction inverted.
art: 52 | | The same letter accented is often used to denote quantities which occupy similar positions in different equations or investigations. Thus, a, a prime, a second, a third, represent four different quantities.
mc: In `√a`, what index is understood? | *2 | 1 | 3
mc: An expression of one term, like `-a^2b`, is a... | *monomial | binomial | trinomial
mc: `a+b` is a... | *binomial | monomial | trinomial
mc: `a-b-c` is a... | *trinomial | binomial | monomial
mc: A binomial whose second term is negative, like `a-b`, is called a... | *residual quantity | trinomial | reciprocal
mc: What is the degree of the term `xy`? | *second | first | third
mc: What is the degree of `2axy`? | *third | second | fourth
mc: What is the degree of `x^2`? | *second | first | third
mc: Which polynomial is homogeneous? | *`a^2+3bc+xy` | `a^3+x^2` | `a+b^2`
mc: Which two terms are like (similar) terms? | *`7ab` and `-3ab` | `2a^2b` and `2ab^2` | `ab` and `abc`
mc: The reciprocal of `a` is... | *`1/a` | `a^2` | `-a`
mc: The reciprocal of `2/3` is... | *`3/2` | `2/3` | `-2/3`
mc: `10-(a+c)` means... | *`a+c` is subtracted from 10 | `a` is subtracted from 10, then `c` is added | 10 is subtracted from `a+c`
tf: Changing the order of the terms of a polynomial changes its value, even when each term keeps its sign. {F}
tf: `4a^3b^2` and `7a^3b^2` are similar terms. {T}
tf: `(a-b)^2` means that `a-b` is to be raised to the second power. {T}
# Examples p15-16: numerical values, with a=4, b=3, c=5, d=10, x=2, y=6 (printed answers 8-13)
q: When `c=5`, `d=10` and `b=3`, what is `c+d-b`? {12 @= 5+10-3}
q: When `a=4` and `x=2`, what is `4a-x`? {14 @= 4*4-2}
q: When `a=4` and `x=2`, what is `-3ax`? {$ -24 @ -3*4*2}
q: When `a=4` and `x=2`, what is `6a^2x`? {192 @= 6*4^2*2}
q: When `a=4`, `b=3`, `c=5`, `d=10`, `x=2` and `y=6`, what is `ay/b + cd/x`? {33 @= 4*6/3 + 5*10/2}
q: When `a=4`, `b=3`, `c=5` and `x=2`, what is `3a^2+2cx-b^3`? {41 @= 3*4^2+2*5*2-3^3}
q: When `a=4` and `b=3`, what is `a(a+b)`? {28 @= 4*(4+3)}
q: When `a=4` and `b=3`, what is `a+b*a-b`? {13 @= 4+3*4-3}
q: When `a=4` and `b=3`, what is `(a+b)(a-b)`? {7 @= (4+3)*(4-3)}
q: When `a=4`, `b=3`, `x=2` and `y=6`, what is `x^2-3(a+x)(a-x)+2by`? {4 @= 2^2-3*(4+2)*(4-2)+2*3*6}
q: When `a=4` and `x=2`, what is `2ax^2/(a-x)^2 - 6x√a`? {$ -16 @ 2*4*2^2/(4-2)^2 - 6*2*√4}
q: When `a=4` and `c=5`, what is `3(a+c)(a-c)+3a^2-3c^2`? {$ -54 @ 3*(4+5)*(4-5)+3*4^2-3*5^2}
q: When `a=4` and `x=2`, what is `(a^2-x^2)/(a+x) + a-x`? {4 @= (4^2-2^2)/(4+2)+4-2}
# Convert the words into algebraic symbols (p16)
q: Write in symbols: three times a, plus b, minus four times c. {$ 3a+b-4c}
q: Write in symbols: five times a, divided by three times b. {$ 5a/(3b)}
q: Write in symbols: a minus b, into three times c. {$ 3c(a-b)}
q: Write in symbols: a, minus three times b into c. {$ a-3bc}
q: Write in symbols: a plus b, divided by three c. {$ (a+b)/(3c)}
q: Write in symbols: a, plus b divided by three c. {$ a+b/(3c)}
q: Write in symbols: a squared, minus three a into b, plus 5 times c into d squared. {$ a^2-3ab+5cd^2}
q: Write in symbols: x cubed minus b cubed, divided by x squared minus b squared. {$ (x^3-b^3)/(x^2-b^2)}
q: Write in symbols: five a squared, into a plus b, into c minus d, minus three times x fourth power. {$ 5a^2(a+b)(c-d)-3x^4}
q: Write in symbols: a squared plus b squared, divided by a plus b, squared. {$ (a^2+b^2)/(a+b)^2}
q: Write in symbols: the square root of a, minus the square root of x. {$ √a-√x}
q: Write in symbols: the square root of a minus x. {$ √(a-x)}
== 4 | Fundamental Rules | Addition
art: 53 | Addition | Addition, in Algebra, is the process of finding the simplest expression for the sum of two or more algebraic quantities.
art: 53 | Case I | When the quantities are similar, and have the same sign. James has 3 pockets, each containing apples: in the first he has 3 apples, in the second 4, and in the third 5. Their sum is 12 apples. But, instead of writing the word apples, suppose he should use the letter `a`: `3a`, `4a`, `5a`, sum `12a`. It is evident that the sum of 3 times `a`, 4 times `a`, and 5 times `a`, is 12 times `a`, or `12a`, whatever `a` may represent. In the same manner the sum of `-3a`, `-4a`, and `-5a` would be `-12a`.
art: 53 | Rule | To add similar quantities with like signs: add together the coefficients of the several quantities; to their sum prefix the common sign, and annex the common letter or letters. When a quantity has no coefficient, 1 is understood; thus, `a=1a`.
art: 54 | Case II | When quantities are alike, but have unlike signs. James receives from one man 6 cents, from another 9, and from a third 10. He spends 4 cents for candy and 3 for apples. If the cents he received are positive, those he spent are negative, and the question is to find the sum of `+6c`, `+9c`, `+10c`, `-4c` and `-3c`. Collect the positive quantities into one sum, and the negative quantities into another, and take their difference: he received `25c`, and spent `7c`, which left `18c`.
art: 54 | | Suppose James should receive 5 cents, and spend 7 cents. His money was diminished 2 cents; this would be indicated by the sum of `+5c` and `-7c`, being `-2c`. Hence, we say that the sum of a positive and negative quantity is equal to the difference between the two; the object being to find what the united effect of the two will be upon some third quantity.
art: 54 | | A merchant has a certain capital; during the year it is increased by `3a` and `8a` dollars, and diminished by `2a` and `5a` dollars. The sum of `+3a`, `+8a`, `-2a`, and `-5a`, is `+11a-7a=+4a`. Hence, the merchant's capital will be increased by `4a` dollars. Had the loss been greater than the gain, the result would have been negative. If the gain and loss were equal, the sum would be 0. Thus, `+3a-3a=0`. Hence, to add a negative quantity is the same as to subtract a positive quantity. This is called algebraic addition, and the sum the algebraic sum.
art: 54 | Rule | To add like quantities which have unlike signs: 1. Find the sum of the coefficients of the positive quantities; also, the sum of the coefficients of the negative quantities. 2. Subtract the less sum from the greater; to the difference prefix the sign of the greater, and annex the common literal part. Thus, the sum of `+3a`, `-5a`, `+9a`, `-6a`, and `+7a`: positive coefficients `3+9+7=19`, negative `-5-6=-11`, difference 8, and the sum is `+8a`.
art: 54 | Reduction | The operation of collecting an algebraic expression into one sum is called the Reduction of Polynomials.
art: 55 | Case III | When the quantities are unlike, or partly like and partly unlike. Thomas has `a` marbles in one hand, and `b` marbles in the other. If `a` is 3 and `b` is 4, the number in both is `3+4`, or 7. But unless the numerical values of `a` and `b` are given, it is impossible to represent their sum more concisely than by `a+b`. So, the sum of `a+b` and `c+d` is `a+b+c+d`.
art: 55 | General Rule | To add algebraic quantities: 1. Write the quantities to be added, placing those that are similar under each other. 2. Add similar terms, and annex the others, with their proper signs. It is not absolutely necessary to place similar terms under each other; but as we can add only similar terms, it is a matter of convenience to do so. Since quantities in a parenthesis are considered as one quantity, 3 times, 5 times, and 7 times any quantity whatever, equal 15 times that quantity.
mc: Addition in Algebra finds the ___ expression for the sum. | *simplest | longest | largest
mc: The sum of `3a`, `4a` and `5a` is... | *`12a` | `12a^3` | `60a`
mc: The sum of `-3a`, `-4a` and `-5a` is... | *`-12a` | `12a` | `-2a`
mc: To add like quantities with unlike signs, after subtracting the less sum from the greater, prefix... | *the sign of the greater | always plus | always minus
mc: The sum of `+5c` and `-7c` is... | *`-2c` | `12c` | `2c`
mc: The sum of `+3a` and `-3a` is... | *0 | `6a` | `-6a`
mc: The sum of `a+b` and `c+d` is... | *`a+b+c+d` | `abcd` | `ab+cd`
mc: To add a negative quantity is the same as to... | *subtract a positive quantity | add a positive quantity | multiply by -1
mc: Collecting an algebraic expression into one sum is called... | *the reduction of polynomials | factoring | division
tf: The order in which quantities are added does not change the sum. {T}
tf: `2a` and `3b` can be added into one term. {F}
q: Add `3a`, `2a`, `a`, and `5a`. {$ 11a @ 3a+2a+a+5a}
q: Add `-6xy`, `-xy`, `-4xy`, and `-3xy`. {$ -14xy @ -6xy-xy-4xy-3xy}
q: Add `2a^2`, `3a^2`, `5a^2`, and `7a^2`. {$ 17a^2 @ 2a^2+3a^2+5a^2+7a^2}
q: Add `-3a^2b`, `-4a^2b`, `-5a^2b`, and `-2a^2b`. {$ -14a^2b @ -3a^2b-4a^2b-5a^2b-2a^2b}
q: What is the sum of `3b`, `5b`, `7b`, and `9b`? {$ 24b @ 3b+5b+7b+9b}
q: Of `2ab`, `5ab`, `8ab`, and `11ab`? {$ 26ab @ 2ab+5ab+8ab+11ab}
q: Of `abc`, `3abc`, `7abc`, and `12abc`? {$ 23abc @ abc+3abc+7abc+12abc}
q: Of `-by`, `-2by`, `-5by`, and `-8by`? {$ -16by @ -by-2by-5by-8by}
q: Add `3ay+7`, `ay+8`, `2ay+4`, and `5ay+6`. {$ 11ay+25 @ 3ay+7+ay+8+2ay+4+5ay+6}
q: Add `8x-4y`, `5x-3y`, `7x-6y`, and `6x-2y`. {$ 26x-15y @ 8x-4y+5x-3y+7x-6y+6x-2y}
q: Add `3a^2-2ax`, `5a^2-3ax`, `7a^2-5ax`, and `4a^2-4ax`. {$ 19a^2-14ax @ 3a^2-2ax+5a^2-3ax+7a^2-5ax+4a^2-4ax}
q: James receives 6 cents, 9 cents and 10 cents, and spends 4 cents and 3 cents. How many cents has he left? {18 @= 6+9+10-4-3}
q: James receives 5 cents and spends 7 cents. Write the sum of `+5c` and `-7c`. {$ -2c @ 5c-7c}
q: A merchant's capital is increased by `3a` and `8a` dollars, and diminished by `2a` and `5a` dollars. What is the sum? {$ 4a @ 3a+8a-2a-5a}
q: What is the sum of `+3a`, `-5a`, `+9a`, `-6a`, and `+7a`? {$ 8a @ 3a-5a+9a-6a+7a}
q: What is the sum of `8a` and `-5a`? {$ 3a @ 8a-5a}
q: Of `5a` and `-8a`? {$ -3a @ 5a-8a}
q: Of `-7ax`, `3ax`, `6ax`, and `-ax`? {$ ax @ -7ax+3ax+6ax-ax}
q: Of `5abx`, `-7abx`, `3abx`, `-abx`, and `4abx`? {$ 4abx @ 5abx-7abx+3abx-abx+4abx}
q: Of `6a-4b`, `3a+2b`, `-7a-8b`, and `-a+9b`? {$ a-b @ (6a-4b)+(3a+2b)+(-7a-8b)+(-a+9b)}
q: Of `4a^2-2b`, `-6a^2+2b`, `2a^2-3b`, `-5a^2-8b`, and `-3a^2+9b`? {$ -8a^2-2b @ (4a^2-2b)+(-6a^2+2b)+(2a^2-3b)+(-5a^2-8b)+(-3a^2+9b)}
q: Of `xy-ac`, `3xy-9ac`, `-7xy+5ac`, `4xy+6ac`, and `-xy-2ac`? {$ -ac @ (xy-ac)+(3xy-9ac)+(-7xy+5ac)+(4xy+6ac)+(-xy-2ac)}
q: Reduce `3ab+5c-7ab+8c+8ab-14c-2ab+c` to its simplest form. {$ 2ab @ 3ab+5c-7ab+8c+8ab-14c-2ab+c}
q: Reduce `5a^2c-3b^2+4a^2c+5b^2-8a^2c+2b^2` to its simplest form. {$ a^2c+4b^2 @ 5a^2c-3b^2+4a^2c+5b^2-8a^2c+2b^2}
q: Thomas has `a` marbles in one hand, and `b` marbles in the other: what expression will represent the number in both? {$ a+b}
q: Add `6a-4c+3b`, and `-2a-3c-5b`. {$ 4a-2b-7c @ (6a-4c+3b)+(-2a-3c-5b)}
q: Add `2ab+c`, `4ax-2c+14`, `12-2ax`, and `6ab+3c-x`. {$ 8ab+2ax+2c-x+26 @ (2ab+c)+(4ax-2c+14)+(12-2ax)+(6ab+3c-x)}
q: Add `14a+x`, `13b-y`, `-11a+2y`, and `-2a-12b+z`. {$ a+b+x+y+z @ (14a+x)+(13b-y)+(-11a+2y)+(-2a-12b+z)}
q: Add together `2c(a^2-b^2)`, `-3c(a^2-b^2)`, `6c(a^2-b^2)`, and `-4c(a^2-b^2)`. {$ c(a^2-b^2) @ 2c(a^2-b^2)-3c(a^2-b^2)+6c(a^2-b^2)-4c(a^2-b^2)}
q: Add together `3az-4by-8`, `-2az+5by+6`, `5az+6by-7`, and `-8az-7by+5`. {$ -2az-4 @ (3az-4by-8)+(-2az+5by+6)+(5az+6by-7)+(-8az-7by+5)}
q: Add together `8a+b`, `2a-b+c`, `-3a+5b+2d`, `-6b-3c+3d`, and `-5a+7c-2d`. {$ 2a-b+5c+3d @ (8a+b)+(2a-b+c)+(-3a+5b+2d)+(-6b-3c+3d)+(-5a+7c-2d)}
q: Add together `7x-6y+5z+3-g`, `-x-3y-8-g`, `-x+y-3z-1+7g`, `-2x+3y+3z-1-g`, and `x+8y-5z+9+g`. {$ 4x+3y+5g+2 @ (7x-6y+5z+3-g)+(-x-3y-8-g)+(-x+y-3z-1+7g)+(-2x+3y+3z-1-g)+(x+8y-5z+9+g)}
q: Add together `5a^3b^2-8a^2b^3+x^2y+xy^2`, `4a^2b^3-7a^3b^2-3xy^2+6x^2y`, `3a^3b^2+3a^2b^3-3x^2y+5xy^2`, and `2a^2b^3-a^3b^2-3x^2y-3xy^2`. {$ a^2b^3+x^2y @ (5a^3b^2-8a^2b^3+x^2y+xy^2)+(4a^2b^3-7a^3b^2-3xy^2+6x^2y)+(3a^3b^2+3a^2b^3-3x^2y+5xy^2)+(2a^2b^3-a^3b^2-3x^2y-3xy^2)}
== 5 | Fundamental Rules | Subtraction
art: 56 | Subtraction | Subtraction, in Algebra, is the process of finding the difference between two algebraic quantities. The quantity to be subtracted is called the subtrahend; that from which the subtraction is to be made, the minuend; the quantity left, the difference or remainder. The word subtrahend means, to be subtracted; the word minuend, to be diminished.
art: 56 | | Thomas has `5a` cents; if he give `2a` cents to his brother, how many will he have left? Since 5 times any quantity, diminished by 2 times the same quantity, leaves 3 times the quantity, the answer is evidently `3a`; that is, `5a-2a=3a`. Hence, to find the difference between two positive similar quantities, find the difference between their coefficients, and to it annex the common letter or letters.
art: 57 | | Thomas has `a` apples; if he give away `b` apples, what expression will represent the number he has left? If `a` represents 6, and `b` 4, the number left will be `6-4`, or 2; and whatever numbers `a` and `b` represent, their difference may be expressed in the same way; that is, by `a-b`. Hence, to find the difference between two quantities not similar, place the sign minus before the quantity to be subtracted. Observe that the sign of the quantity to be subtracted is changed from plus to minus.
art: 58 | | Let it be required to subtract `5+3` from 9. If we subtract 5 from 9, the remainder will be `9-5`; but we wish to subtract, not only 5, but also 3. This gives for the remainder `9-5-3`, which is equal to 1. Now let it be required to subtract `5-3` from 9. If we subtract 5 from 9, the remainder is `9-5`; but the quantity to be subtracted is 3 less than 5. We have subtracted 3 too much; we must, therefore, add 3 to `9-5`, which gives for the true remainder `9-5+3`, or 7.
art: 58 | | Let it now be required to subtract `b-c` from `a`. If we take `b` from `a`, the remainder is `a-b`; but, in doing this, we have subtracted `c` too much; hence, to obtain the true result, we must add `c`. This gives the true remainder, `a-b+c`. For further illustration: `a-(c-a)=a-c+a=2a-c`; `a-(a-c)=a-a+c=c`; `a+b-(a-b)=a+b-a+b=2b`. Observe that in each of these examples, the signs of the subtrahend are changed from plus to minus, and from minus to plus.
art: 58 | Rule | To find the difference between two algebraic quantities: 1. Write the quantity to be subtracted under that from which it is to be taken, placing similar terms under each other. 2. Conceive the signs of all the terms of the subtrahend to be changed, and then reduce by the rule for Addition. Thus, from `5a+3b-c` take `2a-2b-3c`: the same with the signs of the subtrahend changed is `5a+3b-c` and `-2a+2b+3c`, and the remainder is `3a+5b+2c`.
art: 59 | | It is sometimes convenient to simply indicate the subtraction of a polynomial. This may be done by inclosing it in a parenthesis, and then placing the sign minus before it. Thus, to subtract `a-b` from `2a`, write it `2a-(a-b)`, which is equal to `2a-a+b`, and reduces to `a+b`. By this transformation, the same polynomial may be written in several different forms, thus: `a-b+c-d=a-b-(d-c)=a-d-(b-c)=a-(b-c+d)`.
mc: The quantity to be subtracted is called the... | *subtrahend | minuend | remainder
mc: The quantity from which we subtract is called the... | *minuend | subtrahend | difference
mc: From `5a` take `2a`. | *`3a` | `7a` | 3
mc: The difference between `a` and `b`, which are not similar, is written... | *`a-b` | `ab` | `a/b`
mc: To subtract `b-c` from `a`, after taking away `b` we have subtracted `c`... | *too much, so we add `c` | too little, so we subtract `c` | just right
mc: In subtracting, the signs of all the terms of the subtrahend are... | *changed | kept the same | dropped
mc: `a-b+c-d` written with its last three terms in a parenthesis is... | *`a-(b-c+d)` | `a-(b+c-d)` | `a-(b-c-d)`
tf: `9-(5-3)` equals `9-5+3`. {T}
tf: `a+b-(a-b)` equals `2a`. {F}
q: Thomas has `5a` cents; if he give `2a` cents to his brother, how many will he have left? {$ 3a @ 5a-2a}
q: From `5x` take `3x`. {$ 2x @ 5x-3x}
q: From `7ab` take `3ab`. {$ 4ab @ 7ab-3ab}
q: From `8xy` take `5xy`. {$ 3xy @ 8xy-5xy}
q: From `11a^2x` take `5a^2x`. {$ 6a^2x @ 11a^2x-5a^2x}
q: From `9a`, take `4a`. {$ 5a @ 9a-4a}
q: From `11b`, take `11b`. {$ 0 @ 11b-11b}
q: From `3a^2`, take `2a^2`. {$ a^2 @ 3a^2-2a^2}
q: From `7b^2xy`, take `4b^2xy`. {$ 3b^2xy @ 7b^2xy-4b^2xy}
q: Thomas has `a` apples; if he give away `b` apples, what expression will represent the number he has left? {$ a-b}
q: From `c`, take `d`. {$ c-d}
q: From `2m`, take `3n`. {$ 2m-3n}
q: From `a^2x`, take `ax^2`. {$ a^2x-ax^2}
q: From `x^2`, take `x`. {$ x^2-x}
q: Subtract `b-c` from `a`. {$ a-b+c @ a-(b-c)}
q: From `5a+3b-c` take `2a-2b-3c`. {$ 3a+5b+2c @ (5a+3b-c)-(2a-2b-3c)}
q: From `3ax-2y` take `2ax+3y`. {$ ax-5y @ (3ax-2y)-(2ax+3y)}
q: From `4cx^2-3by^2` take `2cx-3by^2`. {$ 4cx^2-2cx @ (4cx^2-3by^2)-(2cx-3by^2)}
q: From `8xyz+3az-8` take `5xyz-3az+8`. {$ 3xyz+6az-16 @ (8xyz+3az-8)-(5xyz-3az+8)}
q: From `7x+4y` take `6x-y`. {$ x+5y @ (7x+4y)-(6x-y)}
q: From `3a-2b` take `5a-3b`. {$ -2a+b @ (3a-2b)-(5a-3b)}
q: From `6ax-4y^2+3` take `3ax-6y^2+2`. {$ 3ax+2y^2+1 @ (6ax-4y^2+3)-(3ax-6y^2+2)}
q: From 14, take `ab-5`. {$ 19-ab @ 14-(ab-5)}
q: From `a+b`, take `a`. {$ b @ a+b-a}
q: From `a`, take `a+b`. {$ -b @ a-(a+b)}
q: From `x`, take `x-5`. {$ 5 @ x-(x-5)}
q: From `x+y`, take `x-y`. {$ 2y @ x+y-(x-y)}
q: From `x-y`, take `x+y`. {$ -2y @ x-y-(x+y)}
q: From `x-y`, take `y-x`. {$ 2x-2y @ x-y-(y-x)}
q: From `x+y+z`, take `x-y-z`. {$ 2y+2z @ x+y+z-(x-y-z)}
q: From `5x+3y-z`, take `4x+3y+z`. {$ x-2z @ 5x+3y-z-(4x+3y+z)}
q: From `a`, take `-a`. {$ 2a @ a-(-a)}
q: From `8a`, take `-3a`. {$ 11a @ 8a-(-3a)}
q: From `5b`, take `11b`. {$ -6b @ 5b-11b}
q: From `a`, take `-b`. {$ a+b @ a-(-b)}
q: From `-9a`, take `3a`. {$ -12a @ -9a-3a}
q: From `-7a`, take `-7a`. {$ 0 @ -7a-(-7a)}
q: From `-6a`, take `-5a`. {$ -a @ -6a-(-5a)}
q: From `-13`, take 3. {$ -16 @ -13-3}
q: From `-9`, take `-16`. {7 @= -9-(-16)}
q: From 12, take `-8`. {20 @= 12-(-8)}
q: From `-14`, take `-5`. {$ -9 @ -14-(-5)}
q: From `13a-2b+9c-3d`, take `8a-6b+9c-10d+12`. {$ 5a+4b+7d-12 @ (13a-2b+9c-3d)-(8a-6b+9c-10d+12)}
q: From `-7a+3m-8x`, take `-6a-5m-2x+3d`. {$ -a+8m-6x-3d @ (-7a+3m-8x)-(-6a-5m-2x+3d)}
q: From `6a+5-3b`, take `-2a-9b-8`. {$ 8a+6b+13 @ (6a+5-3b)-(-2a-9b-8)}
q: From `3ax-2y^2`, take `-5ax-8y^2`. {$ 8ax+6y^2 @ (3ax-2y^2)-(-5ax-8y^2)}
q: From `4x^2y^3-5cz+8m`, take `-cz+2x^2y^3-4cz`. {$ 2x^2y^3+8m @ (4x^2y^3-5cz+8m)-(-cz+2x^2y^3-4cz)}
q: From `x^3-11xyz+3a`, take `-6xyz+7-2a-5xyz`. {$ x^3+5a-7 @ (x^3-11xyz+3a)-(-6xyz+7-2a-5xyz)}
q: From `5(x+y)`, take `2(x+y)`. {$ 3(x+y) @ 5(x+y)-2(x+y)}
q: From `3a(x-z)`, take `a(x-z)`. {$ 2a(x-z) @ 3a(x-z)-a(x-z)}
q: From `7a^2(c-z)-ab(c-d)`, take `5a^2(c-z)-5ab(c-d)`. {$ 2a^2(c-z)+4ab(c-d) @ 7a^2(c-z)-ab(c-d)-(5a^2(c-z)-5ab(c-d))}
mc: Put all the terms but the first of `a-b+c` in a parenthesis with minus before it. | *`a-(b-c)` | `a-(b+c)` | `a-(-b+c)`
mc: Put all the terms but the first of `b+c-d` in a parenthesis with minus before it. | *`b-(-c+d)` | `b-(c+d)` | `b-(c-d)`
mc: Put all the terms but the first of `ax+bc-cd+h` in a parenthesis with minus before it. | *`ax-(-bc+cd-h)` | `ax-(bc-cd+h)` | `ax-(-bc-cd-h)`
mc: Put all the terms but the first of `m-n-z-s` in a parenthesis with minus before it. | *`m-(n+z+s)` | `m-(n-z-s)` | `m-(-n+z+s)`
== 6 | Fundamental Rules | Positive and negative quantities
art: 60 | | Algebraic addition is the process of collecting two or more quantities into one. If these quantities are either all positive or all negative, the sum will be greater than either of the individual quantities. If some of the quantities are positive and others negative, the aggregate may be less than either of them, or it may be nothing. Thus, the sum of `+4a` and `-3a`, is `a`; while that of `+a` and `-a`, is zero, or 0.
art: 61 | | In arithmetical addition, when we say the sum of 5 and 3 is 8, we mean that their sum is 8 greater than 0. In Algebra, when we say the sum of 5 and `-3` is 2, we mean that the aggregate effect of adding 5 and subtracting 3, is the same as that of adding 2. When we say the sum of `-5` and `+3` is `-2`, we mean that the result of subtracting 5 and adding 3, is the same as that of subtracting 2.
art: 61 | | Some say that numbers with a negative sign, such as `-3`, represent quantities less than nothing. This phrase is objectionable. If we understand by it that any negative quantity, added to a positive, will produce a result less than if nothing had been added to it; or, subtracted, will produce a result greater than if nothing had been taken from it, then the phrase has a correct meaning. If we take any number, as 10, and add to it the numbers 3, 2, 1, 0, `-1`, `-2`, and `-3`, the sums are 13, 12, 11, 10, 9, 8, 7: adding a negative number produces the same result as subtracting an equal positive number. If from 10 we subtract 3, 2, 1, 0, `-1`, `-2`, and `-3`, the remainders are 7, 8, 9, 10, 11, 12, 13: subtracting a negative number produces the same result as adding an equal positive number.
art: 62 | | In consequence of the results they produce, it is customary to say, of negative algebraic quantities, that those which are numerically the greatest are really the least. Thus, `-3` is less than `-2`, though numerically greater.
art: 63 | | How will the money in a drawer be affected, if $20 are taken out, afterward $15 put in, after this $8 taken out, and then $10 put in? Or, in other words, what is the sum of `-20`, `+15`, `-8`, and `+10`? The answer is `-3`; that is, the result of the whole operation diminishes the money in the drawer $3. Had the answer been positive, the result would have been an increase.
art: 63 | | Suppose latitude north of the equator to be reckoned +, and that south −. A ship, in latitude 10 degrees north, sails 5 degrees south, then 7 degrees north, then 9 degrees south, then 3 degrees north. Here, `+10`, `-5`, `+7`, `-9`, and `+3`, are `+6`; that is, the ship is in 6 degrees north latitude.
art: 64 | | Subtraction, in arithmetic, shows the excess of one quantity over another of the same kind; the subtrahend must be less than the minuend. In algebraic subtraction, the two quantities may have either like or unlike signs, and the difference is often greater than either of the quantities. Negative quantities are, in their nature, the opposite of positive quantities. If a merchant's gains are positive, his losses are negative; if latitude north is +, that south is −; if distance to the right of a line is +, that to the left is −; if elevation above a point is +, that below is −; if time after a certain hour is +, time before that hour is −. Thus the difference of two quantities having the same sign is equal to their difference; and the difference of two quantities having different signs is equal to their sum.
mc: The sum of `+4a` and `-3a` is... | *`a` | `7a` | `-a`
mc: The sum of `+a` and `-a` is... | *0 | `2a` | `-2a`
mc: The sum of 5 and `-3` is... | *2 | 8 | `-8`
mc: The sum of `-5` and `+3` is... | *`-2` | 2 | `-8`
mc: Adding a negative number gives the same result as... | *subtracting an equal positive number | adding an equal positive number | adding zero
mc: Subtracting a negative number gives the same result as... | *adding an equal positive number | subtracting an equal positive number | subtracting zero
mc: Which is less? | *`-3` | `-2` | they are equal
mc: If gains are positive, losses are... | *negative | positive | zero
tf: `10+(-2)` gives the same result as `10-2`. {T}
tf: `10-(-2)` gives the same result as `10-2`. {F}
q: What is the sum of `-20`, `+15`, `-8`, and `+10`? {$ -3 @ -20+15-8+10}
q: A ship in latitude 10 degrees north sails 5 degrees south, then 7 north, then 9 south, then 3 north. Counting north as plus, what is her latitude now? {6 @= 10-5+7-9+3}
q: Add `10` and `-3`. {7 @= 10-3}
q: From 10 subtract `-3`. {13 @= 10-(-3)}
q: One place is situated 10, and another 6 degrees north of the equator; what is their difference of latitude, in degrees? {4 @= 10-6}
q: Two places are situated, one 10, and the other 6 degrees south latitude; what is the difference of latitude, in degrees? {4 @= -6-(-10)}
q: One place is situated 10 degrees north, and another 6 degrees south latitude; what is their difference of latitude, in degrees? {16 @= 10-(-6)}
== 7 | Fundamental Rules | Multiplication of monomials
art: 65 | Multiplication | Multiplication, in Algebra, is the process of taking one algebraic expression as many times as there are units in another. The quantity to be multiplied is called the multiplicand; the quantity by which we multiply, the multiplier; and the result, the product. The multiplicand and multiplier are called factors.
art: 66 | | Since `a`, taken once, is represented by `a`, taken twice, by `a+a`, or `2a`, taken three times, by `a+a+a`, or `3a`. Hence, to multiply a literal quantity by a number, write the multiplier as the coefficient of the literal quantity. If 1 lemon cost `a` cents, 5 lemons will cost five times as much; that is, `5a` cents. If we bought `a` pieces of cloth, each containing `b` yards, the number of yards is `ab`, and at `c` dollars per yard, the cost is `c` taken `ab` times; that is, `ab*c`, or `abc`.
art: 67 | | The product of two factors is the same, whichever be made the multiplier. Suppose we have a sash containing `a` vertical, and `b` horizontal rows of panes; there will be `a` panes in each horizontal row, and `b` panes in each vertical row. As there are `a` vertical rows, and `b` panes in each, the number of panes is `b` taken `a` times, `ab`. Again, since there are `b` horizontal rows, and `a` panes in each, the whole number is `a` taken `b` times, `ba`. Hence `ab=ba`. So, the product of three or more quantities is the same, in whatever order taken: `2*3*4=3*2*4=4*2*3`, since the product in each case is 24.
art: 67 | | What is the product of `2b`, multiplied by `3a`? The product will be represented by `2b*3a`, or by `3a*2b`, or by `2*3*ab`, since the product is the same, in whatever order the factors are placed. But `2*3=6`; hence, `2*3*ab=6ab`. Hence, in the multiplication of one monomial by another, the coefficient of the product is obtained by multiplying together the coefficients of the multiplicand and multiplier. This is termed the Rule of the Coefficients.
art: 68 | | If we take any two factors, as `2*3`, and multiply either by any number, as 5, the products will be `10*3`, or `2*15`, either of which is equal to 30, which is the true answer. Hence, when either of the factors of a product is multiplied, the product itself is multiplied.
art: 69 | | What is the product of `a` by `a`? As `b*a=ab`, so `a*a` would be written `aa`; but this, for brevity, is written `a^2`. What is the product of `a^2` by `a`? Since `a^2=aa`, the product may be expressed `aa*a`, or `aaa`, which is written `a^3`. Hence, the exponent of a letter in the product is equal to the sum of its exponents in the two factors. This is termed the Rule of the Exponents.
art: 69 | Rule | To multiply one positive monomial by another: 1. Multiply the coefficients of the two terms together. 2. To this product, annex all the letters in both quantities. 3. When the same letter occurs in both factors, add its exponents for the exponent of the product. Write the letters in the order of the alphabet; thus, `ab*c=abc`. Distinguish carefully between the coefficient and the exponent.
mc: The quantity to be multiplied is called the... | *multiplicand | multiplier | product
mc: The multiplicand and multiplier are called... | *factors | products | coefficients
mc: If 1 lemon cost `a` cents, 5 lemons cost... | *`5a` cents | `a^5` cents | `a+5` cents
mc: `ab` and `ba` are... | *equal | different | equal only when `a=b`
mc: The coefficient of the product of two monomials is found by... | *multiplying their coefficients | adding their coefficients | adding their exponents
mc: The exponent of a letter in the product is... | *the sum of its exponents in the factors | the product of its exponents | always 2
mc: `a^2*a^3` is... | *`a^5` | `a^6` | `2a^5`
mc: `2b*3a` is... | *`6ab` | `5ab` | `6a+b`
tf: When either of the factors of a product is multiplied, the product itself is multiplied. {T}
tf: `2a` and `a^2` are equal when `a` is 3. {F}
q: If 1 lemon cost `a` cents, what will 5 lemons cost? {$ 5a @ 5*a}
q: If 1 orange cost `c` cents, what will 6 oranges cost? {$ 6c @ 6*c}
q: Bought `a` pieces of cloth, each containing `b` yards, at `c` dollars per yard; what did the whole cost? {$ abc @ a*b*c}
q: What will 2 boxes, each containing `a` lemons, cost at `b` cents per lemon? {$ 2ab @ 2*a*b}
q: What is the product of `2b`, multiplied by `3a`? {$ 6ab @ 2b*3a}
q: What is the product of `a` by `a`? {$ a^2 @ a*a}
q: What is the product of `a^2` by `a`? {$ a^3 @ a^2*a}
q: What is the product of `a^2` by `a^2`? {$~ a^2*a^2}
q: Of `a^2b` by `ab`? {$~ a^2b*ab}
q: Of `2ab^2` by `3ab`? {$~ 2ab^2*3ab}
q: Multiply `ab` by `x`. {$~ ab*x}
q: Multiply `2bc` by `mn`. {$~ 2bc*mn}
q: Multiply `4ab` by `5xy`. {$~ 4ab*5xy}
q: Multiply `6by` by `3ax`. {$~ 6by*3ax}
q: Multiply `3a^2b` by `4ab`. {$~ 3a^2b*4ab}
q: Multiply `2xy^2` by `3x^2y`. {$~ 2xy^2*3x^2y}
q: Multiply `4ab^2x` by `5ax^2y`. {$~ 4ab^2x*5ax^2y}
q: Multiply `7xy^2z` by `8x^3yz`. {$~ 7xy^2z*8x^3yz}
q: What is `2a-a^2` equal to, when `a` is 1? {1 @= 2*1-1^2}
q: What is `a^2-2a` equal to, when `a` is 5? {15 @= 5^2-2*5}
q: What is `a^3-3a` equal to, when `a` is 4? {52 @= 4^3-3*4}
== 8 | Fundamental Rules | Multiplication of polynomials
art: 70 | | If 5 oranges were purchased at 4 cents apiece, and 2 lemons at the same price, the 5 oranges cost 20 cents, the 2 lemons 8 cents, and the whole cost was `20+8=28` cents. If you purchase `a` oranges at `c` cents apiece, and `b` lemons at `c` cents apiece, the cost of the oranges is `ac` cents, of the lemons `bc` cents, and the whole cost is `ac+bc` cents. Hence, when the sign of each term is positive, to multiply a polynomial by a monomial, multiply each term of the multiplicand by the multiplier. It is most convenient to place the multiplier on the left.
art: 71 | | Required the product of `x+y` by `a+b`. Here, the multiplicand is to be taken as many times as there are units in `a+b`, and the whole product will equal the sum of the two partial products: `ax+ay` is the multiplicand taken `a` times; `bx+by` is the multiplicand taken `b` times; and `ax+ay+bx+by` is the multiplicand taken `a+b` times. If `x=5`, `y=6`, `a=2`, and `b=3`, it stands `10+12` and `15+18`, or `10+27+18=55`, the multiplicand taken 5 times. Hence, when all the terms in each are positive, to multiply one polynomial by another, multiply each term of the multiplicand by each term of the multiplier, and add the products together. Thus `(a+b)(a+b)=a^2+2ab+b^2`.
art: 72 | Of the Signs | The product of `+b` by `a`: the quantity `b` taken once, is `+b`; taken twice, `+2b`; taken `a` times, `+ab`. Hence, the product of two positive quantities is positive; or, plus multiplied by plus gives plus. The product of `-b` by `a`: `-b` taken once, is `-b`; taken twice, `-2b`; taken `a` times, `-ab`. Hence, a negative quantity multiplied by a positive quantity gives a negative product; or, minus multiplied by plus gives minus.
art: 72 | | To multiply `b` by `-a`: when the multiplier is positive, the multiplicand is to be added to 0 as many times as there are units in the multiplier. Since the negative sign always expresses the opposite of the positive sign, when the multiplier is negative the multiplicand must be subtracted from 0 as many times as there are units in the multiplier. `b` subtracted once, is `-b`; twice, `-2b`; `a` times, `-ab`. Hence, plus multiplied by minus gives minus. To multiply `-b` by `-a`: `-b` is to be subtracted from 0 `a` times; subtracted once, it is `+b`; twice, `+2b`; `a` times, `+ab`. Hence, the product of two negative quantities is positive; or, minus multiplied by minus gives plus.
art: 72 | | Another proof: to find the product of `c-d` by `a-b`, take `c-d` `a` times, giving `ac-ad`, and then subtract from this `c-d` taken `b` times, `bc-bd`. The true product is `ac-ad-bc+bd`. So `-d*-b` must give `+bd`. In figures, the product of `7-4` by `5-3`: 5 times `7-4` is `35-20`; 3 times `7-4` is `21-12`, which subtracted gives `35-41+12`, which reduces to `+6`. This is correct, for `7-4=3`, and `5-3=2`, and 3 times 2 is 6.
art: 72 | General Rule for the Signs | 1. Plus multiplied by plus, or minus by minus, gives plus. 2. Plus multiplied by minus, or minus by plus, gives minus. 3. Or, the product of like signs gives plus, and of unlike signs gives minus.
art: 72 | General Rule | For the multiplication of algebraic quantities: 1. Beginning at the left hand, multiply each term of the multiplicand by each term of the multiplier, observing that like signs give plus and unlike signs give minus. 2. Add the several partial products together.
mc: To multiply a polynomial by a monomial... | *multiply each term of the polynomial by the monomial | multiply only the first term | add the monomial to each term
mc: `(a+b)(a+b)` is... | *`a^2+2ab+b^2` | `a^2+b^2` | `2a+2b`
mc: Plus multiplied by minus gives... | *minus | plus | zero
mc: Minus multiplied by minus gives... | *plus | minus | zero
mc: The product of `-3` by `-2` is... | *6 | `-6` | `-5`
mc: The product of `-b` by `a` is... | *`-ab` | `ab` | `a-b`
mc: The product of like signs gives... | *plus | minus | nothing
tf: The product of `c-d` by `a-b` is `ac-ad-bc+bd`. {T}
tf: `(x+y)(a+b)` = `ax+ay+bx+by` {T}
q: If you purchase `a` oranges at `c` cents apiece, and `b` lemons at `c` cents apiece, what is the cost of the whole? {$ ac+bc @ (a+b)c}
q: Multiply `a+d` by `b`. {$~ (a+d)b}
q: Multiply `4x+5y` by `3a`. {$~ (4x+5y)3a}
q: Multiply `m+2n` by `3n`. {$~ (m+2n)3n}
q: Multiply `x^2+y^2` by `xy`. {$~ (x^2+y^2)xy}
q: Multiply `2x+5y` by `abx`. {$~ (2x+5y)abx}
q: Multiply `3x^2+2xz` by `2xz`. {$~ (3x^2+2xz)2xz}
q: Multiply `ab+ax+xy` by `abxy`. {$~ (ab+ax+xy)abxy}
q: Required the product of `x+y` by `a+b`. {$~ (x+y)(a+b)}
q: Multiply `a+b` by `a+b`. {$~ (a+b)(a+b)}
q: Multiply `a^2b+cd` by `ab+cd^2`. {$~ (a^2b+cd)(ab+cd^2)}
q: Multiply `a+b` by `c+d`. {$~ (a+b)(c+d)}
q: Multiply `2x+3y` by `3a+2b`. {$~ (2x+3y)(3a+2b)}
q: Multiply `2a+3b` by `3c+d`. {$~ (2a+3b)(3c+d)}
q: Multiply `m+n` by `x+z`. {$~ (m+n)(x+z)}
q: Multiply `4a+3b` by `2a+b`. {$~ (4a+3b)(2a+b)}
q: Multiply `4x+5y` by `2a+3x`. {$~ (4x+5y)(2a+3x)}
q: Multiply `3x+2y` by `2x+3y`. {$~ (3x+2y)(2x+3y)}
q: Multiply `a^2+b^2` by `a+b`. {$~ (a^2+b^2)(a+b)}
q: Multiply `3a^2+2b^2` by `2a^2+3b^2`. {$~ (3a^2+2b^2)(2a^2+3b^2)}
q: Multiply `a^2+ab+b^2` by `a+b`. {$~ (a^2+ab+b^2)(a+b)}
q: Multiply `c^2+d^2` by `c+d`. {$~ (c^2+d^2)(c+d)}
q: Multiply `x^2+2xy+y^2` by `x+y`. {$~ (x^2+2xy+y^2)(x+y)}
q: What is the product of `-b` by `a`? {$ -ab @ -b*a}
q: What is the product of `b` by `-a`? {$ -ab @ b*(-a)}
q: What is the product of `-b` by `-a`? {$ ab @ (-b)*(-a)}
q: Find the product of `c-d` by `a-b`. {$~ (c-d)(a-b)}
q: Multiply `8-3` by 5. {25 @= (8-3)*5}
q: Multiply `9-5` by `8-2`. {24 @= (9-5)*(8-2)}
q: Multiply `8-7` by `5-3`. {2 @= (8-7)*(5-3)}
q: Multiply `3a^2xy` by `7axy^3`. {$~ 3a^2xy*7axy^3}
q: Multiply `-5a^2b` by `3ab^3`. {$~ -5a^2b*3ab^3}
q: Multiply `-5x^2y` by `-5xy^2`. {$~ (-5x^2y)*(-5xy^2)}
q: Multiply `3a-2b` by `4c`. {$~ (3a-2b)4c}
q: Multiply `3x+2y` by `-2x`. {$~ (3x+2y)*(-2x)}
q: Multiply `a+b` by `x-y`. {$~ (a+b)(x-y)}
q: Multiply `a-b` by `a-b`. {$~ (a-b)(a-b)}
q: Multiply `a^2+ac+c^2` by `a-c`. {$~ (a^2+ac+c^2)(a-c)}
q: Multiply `m+n` by `m-n`. {$~ (m+n)(m-n)}
q: Multiply `a^2-2ab+b^2` by `a+b`. {$~ (a^2-2ab+b^2)(a+b)}
q: Multiply `3x^3y-2xy^3+y^4` by `2xy+y^2`. {$~ (3x^3y-2xy^3+y^4)(2xy+y^2)}
q: Multiply `a^2+2ab+b^2` by `a^2-2ab+b^2`. {$~ (a^2+2ab+b^2)(a^2-2ab+b^2)}
q: Multiply `y^2-y+1` by `y+1`. {$~ (y^2-y+1)(y+1)}
q: Multiply `x^2+y^2` by `x^2-y^2`. {$~ (x^2+y^2)(x^2-y^2)}
q: Multiply `a^2-3a+8` by `a+3`. {$~ (a^2-3a+8)(a+3)}
q: Multiply `2x^2-3xy+y^2` by `x^2-5xy`. {$~ (2x^2-3xy+y^2)(x^2-5xy)}
q: Multiply `3a+5b` by `3a-5b`. {$~ (3a+5b)(3a-5b)}
q: Multiply `2a^2-4ax+2x^2` by `3a-3x`. {$~ (2a^2-4ax+2x^2)(3a-3x)}
q: Multiply `5x^3+3y^3` by `5x^3-3y^3`. {$~ (5x^3+3y^3)(5x^3-3y^3)}
q: Multiply `2a^3+2a^2x+2ax^2+2x^3` by `3a-3x`. {$~ (2a^3+2a^2x+2ax^2+2x^3)(3a-3x)}
q: Multiply `3a^2+3ax+3x^2` by `2a^2-2ax`. {$~ (3a^2+3ax+3x^2)(2a^2-2ax)}
q: Multiply `3a^2+5ax-2x^2` by `2a-x`. {$~ (3a^2+5ax-2x^2)(2a-x)}
q: Multiply `x^6+x^4+x^2` by `x^2-1`. {$~ (x^6+x^4+x^2)(x^2-1)}
q: Multiply `x^2+xy+y^2` by `x^2-xy+y^2`. {$~ (x^2+xy+y^2)(x^2-xy+y^2)}
q: Multiply `a^3+a^2b+ab^2+b^3` by `a-b`. {$~ (a^3+a^2b+ab^2+b^3)(a-b)}
q: Multiply together `(x-3)(x-3)(x-3)`. {$~ (x-3)(x-3)(x-3)}
q: Multiply together `(x-4)(x-5)(x+4)(x+5)`. {$~ (x-4)(x-5)(x+4)(x+5)}
q: Multiply together `(a+c)(a-c)(a+c)(a-c)`. {$~ (a+c)(a-c)(a+c)(a-c)}
q: Multiply together `(a^2+b^2+c^2-ab-ac-bc)(a+b+c)`. {$~ (a^2+b^2+c^2-ab-ac-bc)(a+b+c)}
q: Multiply together `(n^2+n+1)(n^2+n+1)(n-1)(n-1)`. {$~ (n^2+n+1)(n^2+n+1)(n-1)(n-1)}
== 9 | Fundamental Rules | Division of monomials
art: 73 | Division | Division, in Algebra, is the process of finding how many times one algebraic quantity is contained in another. Or, having the product of two factors, and one of them given, Division teaches the method of finding the other. The number by which we divide is called the divisor; the number to be divided, the dividend; the number of times the divisor is contained in the dividend, the quotient.
art: 74 | | Since the divisor is the known factor and the quotient the one found, their product must always be equal to the dividend. Division may be indicated by writing the divisor under the dividend in the form of a fraction. Thus, `ab` divided by `a`, is written `ab/a`. How many times is `x` contained in `4x`? `4x` divided by `x` equals 4, because the product of 4 by `x` is `4x`.
art: 74 | | Is `2a^2` contained in `6a^5b`? `6a^5b/(2a^2)=3a^3b`. In obtaining this quotient we see, 1st, that 2 must be multiplied by 3 to produce 6. 2d, that `a^2` must be multiplied by `a^3` to produce `a^5`; or, we must subtract 2 from 5 to find the exponent of `a` in the quotient. 3d, that since `b` is in the dividend, but not in the divisor, it must be in the quotient, so that the product of the divisor and quotient may equal the dividend.
art: 75 | Rule for the Signs | Since `+a*+b=+ab`, `-a*+b=-ab`, `+a*-b=-ab`, and `-a*-b=+ab`, therefore `+ab÷+b=+a`, `-ab÷+b=-a`, `-ab÷-b=+a`, and `+ab÷-b=-a`. Or, like signs give plus, and unlike signs give minus.
art: 75 | Rule | To divide one monomial by another: 1. Divide the coefficient of the dividend by that of the divisor; observing, that like signs give plus, and unlike signs minus. 2. For any letter common to the divisor and dividend, if it has the same exponent in both, suppress it; if not, subtract its exponent in the former from its exponent in the latter, for its exponent in the quotient. 3. Annex the letters found in the dividend, but not in the divisor. The pupil must recollect that `a` is the same as `a^1`.
art: 76 | | One monomial can not be divided by another: 1st, when the coefficient of the dividend is not exactly divisible by the coefficient of the divisor; 2d, when the same literal factor has a greater exponent in the divisor than in the dividend; 3d, when the divisor contains one or more literal factors not found in the dividend. In each of these cases, the division is indicated by writing the divisor under the dividend, in the form of a fraction.
art: 77 | | Any product is multiplied by multiplying either of its factors; hence, conversely, any dividend will be divided by dividing either of its factors. Thus, `4*6/2=2*6=12`; or, `4*6/2=4*3=12`.
mc: The number by which we divide is called the... | *divisor | dividend | quotient
mc: The quotient multiplied by the divisor equals the... | *dividend | divisor | remainder
mc: `-ab` divided by `-b` is... | *`+a` | `-a` | `ab`
mc: `+ab` divided by `-b` is... | *`-a` | `+a` | `-ab`
mc: To find the exponent of a letter in the quotient... | *subtract its exponent in the divisor from its exponent in the dividend | add the exponents | multiply the exponents
mc: `a^5` divided by `a^2` is... | *`a^3` | `a^7` | `a^(5/2)`
mc: Which division can not be done exactly? | *`3a` by `2a` | `6a` by `2a` | `4ab` by `2a`
tf: When the divisor contains a letter not found in the dividend, the division is written as a fraction. {T}
tf: Like signs in division give minus. {F}
q: How many times is `x` contained in `4x`? {4 @= 4x/x}
q: How many times is `a` contained in `6a`? {6 @= 6a/a}
q: How many times is `a` contained in `ab`? {$~ ab/a}
q: Is `b` contained in `3ab`? How many times? {$~ 3ab/b}
q: How many times is 2 contained in `4a`? {$~ 4a/2}
q: Is `2a` contained in `4ab`? How many times? {$~ 4ab/(2a)}
q: Is `a` contained in `a^3`? How many times? {$~ a^3/a}
q: Is `ab` contained in `5a^2b`? How many times? {$~ 5a^2b/(ab)}
q: Is `4ab^2` contained in `12a^3b^3c`? How many times? {$~ 12a^3b^3c/(4ab^2)}
q: Is `2a^2` contained in `6a^5b`? How many times? {$~ 6a^5b/(2a^2)}
q: Divide `15a^3bc` by `3a^2b`. {$~ 15a^3bc/(3a^2b)}
q: Divide `27x^2y^2` by `-3xy`. {$~ 27x^2y^2/(-3xy)}
q: Divide `-18a^3x` by `-6ax`. {$~ -18a^3x/(-6ax)}
q: Divide `-12c^4x^3y^5` by `-4c^4xy^2`. {$~ -12c^4x^3y^5/(-4c^4xy^2)}
q: Divide `6acx^2y^6v` by `3ax^2y^4v`. {$~ 6acx^2y^6v/(3ax^2y^4v)}
q: Divide `-10c^2x^5y^5v` by `-2cy^4v`. {$~ -10c^2x^5y^5v/(-2cy^4v)}
q: Divide `-28ac^2x^8y^4v^2` by `14ax^5y^4`. {$~ -28ac^2x^8y^4v^2/(14ax^5y^4)}
q: Divide `30ac^4e^4x^4y^2` by `-2aex^4`. {$~ 30ac^4e^4x^4y^2/(-2aex^4)}
q: Divide `(x+y)^2` by `(x+y)`. {$ x+y @ (x+y)^2/(x+y)}
q: Divide `(a+b)^4` by `(a+b)`. {$ (a+b)^3 @ (a+b)^4/(a+b)}
q: Divide `6(m+n)^3` by `2(m+n)`. {$ 3(m+n)^2 @ 6(m+n)^3/(2(m+n))}
q: Divide `6a^2b(x+y)^3` by `2ab(x+y)^2`. {$ 3a(x+y) @ 6a^2b(x+y)^3/(2ab(x+y)^2)}
q: Divide `(x-y)^3(m-n)^2` by `(x-y)^2(m-n)^2`. {$ x-y @ (x-y)^3(m-n)^2/((x-y)^2(m-n)^2)}
== 10 | Fundamental Rules | Division of polynomials
art: 78 | | In multiplying a polynomial by a monomial, we multiply each term of the multiplicand by the multiplier. Hence, to divide a polynomial by a monomial, divide each term of the dividend by the divisor, according to the rule for the division of monomials. Place the divisor on the left, as in arithmetic.
art: 79 | | To explain the method of dividing one polynomial by another, we first find the product of two factors, and then reverse the operation. `2a^2-ab` multiplied by `a-b` gives `2a^3-3a^2b+ab^2`. In the multiplicand and the multiplier, `a` is called the leading letter, because its exponents decrease from left to right. In the division of `2a^3-3a^2b+ab^2` by `a-b`, both should be arranged with reference to the same leading letter, in order that the quotient may have the same order of arrangement.
art: 79 | | If we divide `2a^3` by `a`, the result, `2a^2`, will be the term of the quotient by which `a-b` was first multiplied. If we now multiply `a-b` by `2a^2`, and subtract the product from the dividend, there will remain `-a^2b+ab^2`, which is the product of `a-b` by the other term of the quotient. Dividing `-a^2b` by `a`, we find this unknown term, `-ab`. Multiplying `a-b` by it, and subtracting the product, nothing remains. Had there been a second remainder, the third term of the quotient would have been found in the same manner.
art: 79 | Rule | To divide one polynomial by another: 1. Arrange the dividend and divisor with reference to the leading letter, and place the divisor on the right of the dividend. 2. Divide the first term of the dividend by the first term of the divisor, for the first term of the quotient. Multiply the divisor by this term, and subtract the product from the dividend. 3. Divide the first term of the remainder by the first term of the divisor, for the second term of the quotient. Multiply the divisor by this term, and subtract the product from the last remainder. 4. Proceed in the same manner, and if you obtain 0 for a remainder, the division is said to be exact.
art: 79 | Remarks | 1. Bring down no more terms of the remainder, at each successive subtraction, than are necessary. 2. It is well to perform the same example in two ways: first, by making the powers of the letter diminish from left to right; and, secondly, increase from left to right. 3. When the first term of the arranged dividend, or of any remainder, is not exactly divisible by the first term of the arranged divisor, the exact division will be impossible.
art: 79 | Example | Divide `6a^2-13ax+6x^2` by `2a-3x`. `6a^2` divided by `2a` gives `3a`; `3a` times `2a-3x` is `6a^2-9ax`, which subtracted leaves `-4ax+6x^2`. `-4ax` divided by `2a` gives `-2x`; `-2x` times `2a-3x` is `-4ax+6x^2`, which subtracted leaves nothing. The quotient is `3a-2x`.
mc: To divide a polynomial by a monomial... | *divide each term of the polynomial by the monomial | divide only the first term | subtract the monomial
mc: Before dividing one polynomial by another, both should be... | *arranged with reference to the same leading letter | written backward | multiplied together
mc: The first term of the quotient is found by dividing... | *the first term of the dividend by the first term of the divisor | the last terms | the divisor by the dividend
mc: When the remainder is 0, the division is... | *exact | impossible | not finished
mc: `(x^2-y^2)/(x-y)` is... | *`x+y` | `x-y` | `x^2+y^2`
tf: When the first term of a remainder is not exactly divisible by the first term of the divisor, exact division is impossible. {T}
q: Divide `6x+12y` by 3. {$~ (6x+12y)/3}
q: Divide `15x-20b` by 5. {$~ (15x-20b)/5}
q: Divide `21a+35b` by `-7`. {$~ (21a+35b)/(-7)}
q: Divide `abc-acf` by `ac`. {$~ (abc-acf)/(ac)}
q: Divide `10ax-15ay` by `-5a`. {$~ (10ax-15ay)/(-5a)}
q: Divide `a^2b^2-2ab^3x` by `ab`. {$~ (a^2b^2-2ab^3x)/(ab)}
q: Divide `12a^2bc-9acx^2+6ab^2c` by `-3ac`. {$~ (12a^2bc-9acx^2+6ab^2c)/(-3ac)}
q: Divide `15a^5b^2c-21a^2b^3c^2` by `3a^2bc`. {$~ (15a^5b^2c-21a^2b^3c^2)/(3a^2bc)}
q: Divide `6(a+c)+9(a+x)` by 3. {$ 2(a+c)+3(a+x) @ (6(a+c)+9(a+x))/3}
q: Divide `a^2b(c+d)+ab^2(c^2-d)` by `ab`. {$ a(c+d)+b(c^2-d) @ (a^2b(c+d)+ab^2(c^2-d))/(ab)}
q: Divide `ac(m+n)-bc(m+n)` by `m+n`. {$ ac-bc @ (ac(m+n)-bc(m+n))/(m+n)}
q: Divide `(m+n)(x+y)^2+(m+n)(x-y)^2` by `m+n`. {$ (x+y)^2+(x-y)^2 @ ((m+n)(x+y)^2+(m+n)(x-y)^2)/(m+n)}
q: Divide `2a^3-3a^2b+ab^2` by `a-b`. {$~ (2a^3-3a^2b+ab^2)/(a-b)}
q: Divide `6a^2-13ax+6x^2` by `2a-3x`. {$~ (6a^2-13ax+6x^2)/(2a-3x)}
q: Divide `x^2-y^2` by `x-y`. {$~ (x^2-y^2)/(x-y)}
q: Divide `a^3+x^3` by `a+x`. {$~ (a^3+x^3)/(a+x)}
q: Divide `5a^2x+5ax^2+a^3+x^3` by `4ax+a^2+x^2`. {$~ (5a^2x+5ax^2+a^3+x^3)/(4ax+a^2+x^2)}
q: Divide `a^2+a^3-5a^4+3a^5` by `a-a^2`. {$~ (a^2+a^3-5a^4+3a^5)/(a-a^2)}
q: Divide `4a^2-8ax+4x^2` by `2a-2x`. {$~ (4a^2-8ax+4x^2)/(2a-2x)}
q: Divide `2x^2+7xy+6y^2` by `x+2y`. {$~ (2x^2+7xy+6y^2)/(x+2y)}
q: Divide `2mx+3nx+10mn+15n^2` by `x+5n`. {$~ (2mx+3nx+10mn+15n^2)/(x+5n)}
q: Divide `x^2+2xy+y^2` by `x+y`. {$~ (x^2+2xy+y^2)/(x+y)}
q: Divide `8a^4-8x^4` by `2a^2-2x^2`. {$~ (8a^4-8x^4)/(2a^2-2x^2)}
q: Divide `ac+bc-ad-bd` by `a+b`. {$~ (ac+bc-ad-bd)/(a+b)}
q: Divide `x^3+y^3+5xy^2+5x^2y` by `x^2+4xy+y^2`. {$~ (x^3+y^3+5xy^2+5x^2y)/(x^2+4xy+y^2)}
q: Divide `a^3-9a^2+27a-27` by `a-3`. {$~ (a^3-9a^2+27a-27)/(a-3)}
q: Divide `4a^4-5a^2x^2+x^4` by `2a^2-3ax+x^2`. {$~ (4a^4-5a^2x^2+x^4)/(2a^2-3ax+x^2)}
q: Divide `x^4-y^4` by `x-y`. {$~ (x^4-y^4)/(x-y)}
q: Divide `a^3-b^3` by `a^2+ab+b^2`. {$~ (a^3-b^3)/(a^2+ab+b^2)}
q: Divide `x^3-y^3+3xy^2-3x^2y` by `x-y`. {$~ (x^3-y^3+3xy^2-3x^2y)/(x-y)}
q: Divide `4x^4-64` by `2x-4`. {$~ (4x^4-64)/(2x-4)}
q: Divide `a^5-5a^4x+10a^3x^2-10a^2x^3+5ax^4-x^5` by `a^2-2ax+x^2`. {$~ (a^5-5a^4x+10a^3x^2-10a^2x^3+5ax^4-x^5)/(a^2-2ax+x^2)}
q: Divide `4a^6-25a^2x^4+20ax^5-4x^6` by `2a^3-5ax^2+2x^3`. {$~ (4a^6-25a^2x^4+20ax^5-4x^6)/(2a^3-5ax^2+2x^3)}
q: Divide `y^3+1` by `y+1`. {$~ (y^3+1)/(y+1)}
q: Divide `6a^4+4a^3x-9a^2x^2-3ax^3+2x^4` by `2a^2+2ax-x^2`. {$~ (6a^4+4a^3x-9a^2x^2-3ax^3+2x^4)/(2a^2+2ax-x^2)}
q: Divide `3a^4-8a^2b^2+3a^2c^2+5b^4-3b^2c^2` by `a^2-b^2`. {$~ (3a^4-8a^2b^2+3a^2c^2+5b^4-3b^2c^2)/(a^2-b^2)}
q: Divide `x^6-3x^4y^2+3x^2y^4-y^6` by `x^3-3x^2y+3xy^2-y^3`. {$~ (x^6-3x^4y^2+3x^2y^4-y^6)/(x^3-3x^2y+3xy^2-y^3)}
# Miscellaneous exercises (p46)
q: `3a+5x-9c+7d+5a-3x-3d-(4a+2x-8c+4d)` = what? {$~ 3a+5x-9c+7d+5a-3x-3d-(4a+2x-8c+4d)}
q: `a+b-(2a-3b)-(5a+7b)-(-13a+2b)` = what? {$~ a+b-(2a-3b)-(5a+7b)-(-13a+2b)}
q: `(a+b)(a+b)+(a-b)(a-b)` = what? {$~ (a+b)(a+b)+(a-b)(a-b)}
q: `(a^2+a^4+a^6)(a^2-1)-(a^4+a)(a^4-a)` = what? {$~ (a^2+a^4+a^6)(a^2-1)-(a^4+a)(a^4-a)}
q: `(a^3+a^2b-ab^2-b^3)÷(a-b)-(a-b)(a-b)` = what? {$~ (a^3+a^2b-ab^2-b^3)/(a-b)-(a-b)(a-b)}
== 11 | Theorems, Factoring | Algebraic theorems
art: 80 | Theorem I | If we square `a+b`, that is, multiply `a+b` by itself, the product will be `a^2+2ab+b^2`. But `a+b` is the sum of the quantities, `a` and `b`. Hence, the square of the sum of two quantities is equal to the square of the first, plus twice the product of the first by the second, plus the square of the second. Thus, `(2+3)^2=4+12+9=25`.
art: 81 | Theorem II | If we square `a-b`, the product will be `a^2-2ab+b^2`. But `a-b` is the difference of the quantities. Hence, the square of the difference of two quantities is equal to the square of the first, minus twice the product of the first by the second, plus the square of the second. Thus, `(5-4)^2=25-40+16=1`.
art: 82 | Theorem III | If we multiply `a+b` by `a-b`, the product will be `a^2-b^2`. But `a+b` represents the sum of two quantities, and `a-b`, their difference. Hence, the product of the sum and difference of two quantities is equal to the difference of their squares. Thus, `(5+3)(5-3)=25-9=16=8*2`.
art: 83 | Theorem IV | If we divide `a^3` by `a^5`, observing the rule for the exponents, we have `a^(3-5)=a^-2`. But `a^3/a^5=1/a^2`. So `a^m/a^n=a^(m-n)`, and also `1/a^(n-m)`. Hence, 1. The reciprocal of a quantity is equal to the same quantity with the sign of its exponent changed. 2. Any quantity may be transferred from one term of a fraction to the other, if the sign of the exponent be changed. Thus, `a/b=ab^-1`, and `1/(ab^2)=a^-1b^-2`.
art: 84 | Theorem V | By the rule for the exponents, `a^2/a^2=a^(2-2)=a^0`; but since any quantity is contained in itself once, `a^2/a^2=1`. Similarly, `a^m/a^m=a^0`, but it is also 1; therefore, `a^0=1`. Hence, any quantity whose exponent is 0 is equal to unity.
art: 85 | Theorem VI | If we divide `a^2-b^2` by `a-b`, the quotient will be `a+b`. If we divide `a^3-b^3` by `a-b`, the quotient will be `a^2+ab+b^2`. In the same manner, `(a^4-b^4)÷(a-b)=a^3+a^2b+ab^2+b^3`, and `(a^5-b^5)÷(a-b)=a^4+a^3b+a^2b^2+ab^3+b^4`. The exponent of the first letter decreases by unity, while that of the second increases by unity. Hence, the difference of the same powers of two quantities is always divisible by the difference of the quantities.
art: 86 | Theorem VII | The difference of the even powers of two quantities of the same degree, is always divisible by the sum of the quantities. Thus, `(a^2-b^2)÷(a+b)=a-b`; `(a^4-b^4)÷(a+b)=a^3-a^2b+ab^2-b^3`.
art: 86 | Theorem VIII | The sum of the odd powers of two quantities of the same degree, is always divisible by the sum of the quantities. Thus, `(a^3+b^3)÷(a+b)=a^2-ab+b^2`; `(a^5+b^5)÷(a+b)=a^4-a^3b+a^2b^2-ab^3+b^4`.
mc: The square of the sum of two quantities, `(a+b)^2`, is... | *`a^2+2ab+b^2` | `a^2+b^2` | `a^2+ab+b^2`
mc: The square of the difference, `(a-b)^2`, is... | *`a^2-2ab+b^2` | `a^2-b^2` | `a^2+2ab-b^2`
mc: The product of the sum and difference of two quantities, `(a+b)(a-b)`, is... | *`a^2-b^2` | `a^2+b^2` | `a^2-2ab+b^2`
mc: The reciprocal of `a^2` may be written... | *`a^-2` | `-a^2` | `a^(1/2)`
mc: `a^0` is equal to... | *1 | 0 | `a`
mc: `a^m/a^n` is equal to... | *`a^(m-n)` | `a^(m+n)` | `a^(mn)`
mc: The difference of the same powers of two quantities is always divisible by... | *the difference of the quantities | the sum of the quantities | neither
mc: The sum of the odd powers, like `a^3+b^3`, is always divisible by... | *the sum of the quantities, `a+b` | the difference, `a-b` | `a^2+b^2`
mc: `(a^3-b^3)÷(a-b)` is... | *`a^2+ab+b^2` | `a^2-ab+b^2` | `a^2+b^2`
tf: The difference of the even powers of two quantities, like `a^4-b^4`, is divisible by `a+b`. {T}
tf: `a^2+b^2` is divisible by `a+b`. {F}
q: What is the square of `2+3`? {25 @= (2+3)^2}
q: What is the square of `2a+b`? {$~ (2a+b)^2}
q: What is the square of `2x+3y`? {$~ (2x+3y)^2}
q: What is the square of `ab+cd`? {$~ (ab+cd)^2}
q: What is the square of `x^2+xy`? {$~ (x^2+xy)^2}
q: What is the square of `2a^2+3ax`? {$~ (2a^2+3ax)^2}
q: What is the square of `5-4`? {1 @= (5-4)^2}
q: What is the square of `2a-b`? {$~ (2a-b)^2}
q: What is the square of `3x-2y`? {$~ (3x-2y)^2}
q: What is the square of `x^2-y^2`? {$~ (x^2-y^2)^2}
q: What is the square of `ax-x^2`? {$~ (ax-x^2)^2}
q: What is the square of `5a^2-b^2`? {$~ (5a^2-b^2)^2}
q: What is `(5+3)(5-3)`? {16 @= (5+3)*(5-3)}
q: What is `(2a+b)(2a-b)`? {$~ (2a+b)(2a-b)}
q: What is `(2x+3y)(2x-3y)`? {$~ (2x+3y)(2x-3y)}
q: What is `(5a+4b)(5a-4b)`? {$~ (5a+4b)(5a-4b)}
q: What is `(a^2+b^2)(a^2-b^2)`? {$~ (a^2+b^2)(a^2-b^2)}
q: What is `(2am+3bn)(2am-3bn)`? {$~ (2am+3bn)(2am-3bn)}
q: Divide `a^4-b^4` by `a-b`. {$~ (a^4-b^4)/(a-b)}
q: Divide `a^5-1` by `a-1`. {$~ (a^5-1)/(a-1)}
q: Divide `1-b^5` by `1-b`. {$ 1+b+b^2+b^3+b^4 @ (1-b^5)/(1-b)}
q: Divide `a^4-b^4` by `a+b`. {$~ (a^4-b^4)/(a+b)}
q: Divide `a^6-1` by `a+1`. {$~ (a^6-1)/(a+1)}
q: Divide `a^3+b^3` by `a+b`. {$~ (a^3+b^3)/(a+b)}
q: Divide `a^7+1` by `a+1`. {$~ (a^7+1)/(a+1)}
mc: Which is equal to `a/b`? | *`ab^-1` | `a^-1b` | `-ab`
mc: Which is equal to `1/(ab^2)`? | *`a^-1b^-2` | `ab^-2` | `-ab^2`
== 12 | Theorems, Factoring | Factoring
art: 87 | Divisor | A Divisor or Measure of a quantity is any quantity that divides it without a remainder. Thus, 2 is a divisor or measure of 6, and `a^2` of `a^2x`.
art: 88 | Prime Number | A Prime Number is one which has no divisors except itself and unity. A Composite Number is one which has one or more divisors besides itself and unity. Hence, all numbers are either prime or composite; and every composite number is the product of two or more prime numbers. The prime numbers are 1, 2, 3, 5, 7, 11, 13, 17, etc. The composite numbers are 4, 6, 8, 9, 10, 12, 14, 15, 16, etc. To resolve a composite number into its prime factors: 1. Divide by any prime number that will exactly divide it; divide the quotient again in the same manner, and so continue. 2. The last quotient and the several divisors will be the prime factors. It is most convenient to divide first by the smallest prime number that is a factor.
art: 89 | Prime Quantity | A Prime Quantity, in Algebra, is one which is exactly divisible only by itself and by unity. Thus, `a`, `b`, and `b+c` are prime quantities.
art: 90 | | Two quantities are prime to each other when no quantity except unity will exactly divide both. Thus, `ab` and `cd` are prime to each other.
art: 91 | Composite Quantity | A Composite Quantity is one which is the product of two or more factors, neither of which is unity. Thus, `ax` is a composite quantity, the factors being `a` and `x`.
art: 92 | | To separate a monomial into its prime factors: resolve the coefficient into its prime factors. To these annex the literal factors.
art: 93 | | To separate a polynomial into its factors when one of them is a monomial and the other a polynomial: divide the given quantity by the greatest monomial that will exactly divide each of its terms; the divisor will be one factor and the quotient the other.
art: 94 | | To separate a quantity which is the product of two or more polynomials into its prime factors, no general rule can be given. When the given quantity does not consist of more than three terms, it may generally be accomplished by reversing some one of the preceding theorems. 1st. For a trinomial, whose extremes are squares and positive, and whose middle term is twice the product of the square roots of the extremes: `a^2+2ab+b^2=(a+b)(a+b)`, and `a^2-2ab+b^2=(a-b)(a-b)`. 2d. For a binomial, which is the difference of two squares: `a^2-b^2=(a+b)(a-b)`.
art: 94 | | 3d. For the difference of the same powers of two quantities: `a^3-b^3=(a-b)(a^2+ab+b^2)`. 4th. The difference of the even powers of two quantities, higher than the second degree, may be separated thus: `a^4-b^4=(a^2+b^2)(a^2-b^2)=(a^2+b^2)(a+b)(a-b)`. 5th. For the sum of the odd powers of two quantities: `a^3+b^3=(a+b)(a^2-ab+b^2)`.
art: 95 | Quadratic Trinomial | A Quadratic Trinomial is of the form `x^2+ax+b`, in which the signs of the second and third terms may be either plus or minus. Such quantities may be resolved into two binomial factors by inspection. Thus: `x^2-5x+6` will evidently be the product of `x-2` by `x-3`. The whole difficulty consists in finding two numbers whose sum is equal to the coefficient of the second term, and whose product is equal to the third term. We may often separate other trinomials into factors by first taking out the monomial factor common to each term. Thus, `5ax^2-10ax-40a=5a(x^2-2x-8)=5a(x-4)(x+2)`.
art: 96 | | The principal use of factoring is to shorten algebraic operations by canceling common factors. Whenever there is an opportunity of doing this, the operations to be performed should be merely indicated. Thus, multiply `a-b` by `x^2+2xy+y^2`, and divide the product by `x+y`: `(a-b)(x+y)(x+y)/(x+y)=(a-b)(x+y)=ax+ay-bx-by`.
mc: A quantity that divides another without a remainder is called a... | *divisor or measure | multiple | remainder
mc: A number with no divisors except itself and unity is... | *prime | composite | even
mc: What are the prime factors of 105? | *3, 5 and 7 | 3 and 35 | 5 and 21
mc: What are the prime factors of 210? | *2, 3, 5 and 7 | 2, 3 and 35 | 10 and 21
mc: Resolve 4290 into its prime factors. | *2, 3, 5, 11 and 13 | 2, 5, 429 | 3, 10, 11, 13
mc: Which two quantities are prime to each other? | *`ab` and `cd` | `ab` and `ac` | `2a` and `4b`
mc: The prime factors of `15a^2bc` are... | *3, 5, `a`, `a`, `b`, `c` | 15, `a^2`, `bc` | 3, 5, `a^2`, `b`
mc: The prime factors of `21ab^2d` are... | *3, 7, `a`, `b`, `b`, `d` | 21, `a`, `b^2`, `d` | 3, 7, `ab`, `bd`
mc: The prime factors of `35abc^2x` are... | *5, 7, `a`, `b`, `c`, `c`, `x` | 35, `a`, `b`, `c^2`, `x` | 5, 7, `abc`, `cx`
mc: To factor `x^2-5x+6`, find two numbers whose sum is -5 and whose product is... | *6 | -5 | 5
mc: `a^2-b^2` separates into... | *`(a+b)(a-b)` | `(a-b)(a-b)` | `(a+b)(a+b)`
tf: `b+c` is a prime quantity. {T}
tf: 9 is a prime number. {F}
q: Separate `x+ax` into factors. {$ x(1+a) @ x+ax}
q: Separate `am+ac` into factors. {$ a(m+c) @ am+ac}
q: Separate `bc^2+bcd` into factors. {$ bc(c+d) @ bc^2+bcd}
q: Separate `4x^2+6xy` into factors. {$ 2x(2x+3y) @ 4x^2+6xy}
q: Separate `6ax^2y+9bxy^2-12cx^2y` into factors. {$ 3xy(2ax+3by-4cx) @ 6ax^2y+9bxy^2-12cx^2y}
q: Separate `5ax^2-35ax^3y+5a^2x^3y` into factors. {$ 5ax^2(1-7xy+axy) @ 5ax^2-35ax^3y+5a^2x^3y}
q: Separate `a^3cm^2+a^2c^2m^2-a^2cm^3` into factors. {$ a^2cm^2(a+c-m) @ a^3cm^2+a^2c^2m^2-a^2cm^3}
q: Separate `x^2+2xy+y^2` into its simplest factors. {$ (x+y)^2 @ x^2+2xy+y^2}
q: Separate `9a^2+12ab+4b^2` into its simplest factors. {$ (3a+2b)^2 @ 9a^2+12ab+4b^2}
q: Separate `4+12x+9x^2` into its simplest factors. {$ (2+3x)^2 @ 4+12x+9x^2}
q: Separate `m^2-2mn+n^2` into its simplest factors. {$ (m-n)^2 @ m^2-2mn+n^2}
q: Separate `4x^2-20xz+25z^2` into its simplest factors. {$ (2x-5z)^2 @ 4x^2-20xz+25z^2}
q: Separate `x^2-y^2` into its simplest factors. {$ (x+y)(x-y) @ x^2-y^2}
q: Separate `9m^2-16n^2` into its simplest factors. {$ (3m+4n)(3m-4n) @ 9m^2-16n^2}
q: Separate `x^4-b^4` into its simplest factors. {$ (x^2+b^2)(x+b)(x-b) @ x^4-b^4}
q: Separate `y^3+1` into its simplest factors. {$ (y+1)(y^2-y+1) @ y^3+1}
q: Separate `x^3-1` into its simplest factors. {$ (x-1)(x^2+x+1) @ x^3-1}
q: Separate `8a^3-27b^3` into its simplest factors. {$ (2a-3b)(4a^2+6ab+9b^2) @ 8a^3-27b^3}
q: Separate `a^5+b^5` into its simplest factors. {$ (a+b)(a^4-a^3b+a^2b^2-ab^3+b^4) @ a^5+b^5}
q: Decompose `x^2+5x+6` into two binomial factors. {$ (x+2)(x+3) @ x^2+5x+6}
q: Decompose `a^2+7a+12` into two binomial factors. {$ (a+3)(a+4) @ a^2+7a+12}
q: Decompose `x^2-5x+6` into two binomial factors. {$ (x-2)(x-3) @ x^2-5x+6}
q: Decompose `x^2+x-6` into two binomial factors. {$ (x+3)(x-2) @ x^2+x-6}
q: Decompose `x^2+x-2` into two binomial factors. {$ (x+2)(x-1) @ x^2+x-2}
q: Decompose `x^2-13x+40` into two binomial factors. {$ (x-5)(x-8) @ x^2-13x+40}
q: Decompose `x^2-7x-8` into two binomial factors. {$ (x-8)(x+1) @ x^2-7x-8}
q: Decompose `x^2-x-30` into two binomial factors. {$ (x-6)(x+5) @ x^2-x-30}
q: Separate `5ax^2-10ax-40a` into factors. {$ 5a(x-4)(x+2) @ 5ax^2-10ax-40a}
q: Separate `3x^2+12x-15` into factors. {$ 3(x+5)(x-1) @ 3x^2+12x-15}
q: Separate `2abx^2-14abx-60ab` into factors. {$ 2ab(x-10)(x+3) @ 2abx^2-14abx-60ab}
q: Separate `2x^3-4x^2-30x` into factors. {$ 2x(x-5)(x+3) @ 2x^3-4x^2-30x}
q: Multiply `a-b` by `x^2+2xy+y^2`, and divide the product by `x+y`. {$~ (a-b)(x^2+2xy+y^2)/(x+y)}
q: Multiply `x-3` by `x^2-1`, and divide the product by `x-1`, by factoring. {$~ (x-3)(x^2-1)/(x-1)}
q: Divide `z^3+1` by `z+1`, and multiply the quotient by `z^2-1`, by factoring. {$~ (z^3+1)/(z+1)*(z^2-1)}
q: Multiply `x^2-5x+6` by `x^2-7x+12`, and divide the product by `x^2-6x+9`, by factoring. {$~ (x^2-5x+6)(x^2-7x+12)/(x^2-6x+9)}
== 13 | Theorems, Factoring | Greatest common divisor
art: 97 | Common Divisor | A Common Divisor, or Common Measure, is any quantity that will exactly divide two or more quantities. Thus, 2 is a common divisor of 8 and 12; and `a` is a common divisor of `ab` and `a^2x`. Two quantities may sometimes have more than one common divisor. Thus, 8 and 12 have two common divisors, 2 and 4.
art: 98 | Greatest Common Divisor | The Greatest Common Divisor, or Greatest Common Measure, of two or more quantities, is the greatest quantity that will exactly divide each of them. Thus, the greatest common divisor of `4a^2xy` and `6a^3x^2y^2` is `2a^2xy`. G.C.D. stands for greatest common divisor.
art: 99 | | Quantities that have a common divisor are said to be commensurable; and those that have no common divisor incommensurable.
art: 100 | | To find the G.C.D. of `6ab` and `15a^2c`: by separating each quantity into its prime factors, we have `6ab=2*3ab`, `15a^2c=3*5aac`. Here, 3 and `a` are the only factors common to both terms; hence, both can be divided either by 3 or `a`, or by their product `3a`, and by no other quantity; consequently, `3a` is their G.C.D. Rule: 1. Resolve the quantities into their prime factors. 2. Take the product of those factors that are common to each of the terms for the greatest common divisor. The G.C.D. of the literal parts will be the highest power of each letter which is common to all the quantities.
art: 101 | Propositions | To find the G.C.D. of two polynomials, we use three propositions. I. A measure or divisor of a quantity is also a measure of any number of times that quantity: if 3 is a measure of 6, it is a measure of 12, of 18, etc. II. A common measure of two quantities is also a measure of their sum: 3 measures 27 and 18, so it measures 45. III. A common measure of two quantities is also a measure of their difference: 3 measures 27 and 18, so it measures 9.
art: 102 | | To find the G.C.D. of 36 and 116: dividing 116 by 36, the quotient is 3, and the remainder is 8. The G.C.D. must divide 116, 36, and 8. Dividing 36 by 8, the quotient is 4, with a remainder 4. The G.C.D. must divide 36, 8, and 4. By trial, 4 will divide 8, leaving no remainder. Hence 4 is the number sought.
art: 103 | | The same reasoning holds for two polynomials, A and B: divide A by B, then B by the remainder, and so on; the last divisor is the G.C.D. When this last divisor is unity, or does not contain the letter of arrangement, there is no common divisor to the quantities.
art: 104 | | If one of the quantities contain a factor not found in the other, it may be canceled without affecting the common divisor. If both quantities contain a common factor, it may be set aside as a factor of the common divisor; and we may proceed to find the G.C.D. of the other factors.
art: 105 | | We may multiply either quantity by a factor not found in the other, without affecting the G.C.D. Thus, in the fraction `2abx/(3abc)`, whose G.C.D. is `ab`, if we multiply the dividend by 4, we have `8abx/(3abc)`, of which the common divisor is still `ab`. If, however, we multiply the numerator by 3, which is a factor of the denominator, the G.C.D. becomes `3ab`.
art: 106 | Rule | To find the greatest common divisor of two polynomials: 1. Divide the greater polynomial by the less, and if there is no remainder, the less quantity will be the divisor sought. 2. If there is a remainder, divide the first divisor by it, and continue to divide the last divisor by the last remainder, until a divisor is obtained which leaves no remainder; this will be the greatest common divisor. When the highest power of the leading letter is the same in both, it is immaterial which is made the dividend. If the remainder does not contain the leading letter, there is no common divisor. To find the G.C.D. of three or more quantities, first find the G.C.D. of two of them; then, of that divisor and one of the other quantities, and so on. It may often be found most easily by separating the quantities into factors.
mc: A quantity that exactly divides two or more quantities is a... | *common divisor | common multiple | remainder
mc: Quantities that have no common divisor are called... | *incommensurable | commensurable | composite
mc: The G.C.D. of the literal parts is the... | *highest power of each letter common to all the quantities | lowest power of every letter | product of all the letters
mc: What is the G.C.D. of 8 and 12? | *4 | 2 | 24
mc: In finding the G.C.D. of two polynomials, when the last divisor does not contain the letter of arrangement... | *there is no common divisor | it is the G.C.D. | we start again
mc: A factor found in only one of the quantities... | *may be canceled without affecting the G.C.D. | must be kept | doubles the G.C.D.
tf: A common measure of two quantities is also a measure of their sum and of their difference. {T}
tf: Multiplying one quantity by a factor of the other can change the G.C.D. {T}
q: Find the G.C.D. of `6ab` and `15a^2c`. {$ 3a @gcd: 6ab; 15a^2c}
q: Find the G.C.D. of `4a^2x^3`, `6a^3x^2`, and `10a^4x`. {$ 2a^2x @gcd: 4a^2x^3; 6a^3x^2; 10a^4x}
q: Find the G.C.D. of `4a^2x^2` and `10ax^3`. {$ 2ax^2 @gcd: 4a^2x^2; 10ax^3}
q: Find the G.C.D. of `4a^3b^2x^5y^3` and `8a^5x^2y^2`. {$ 4a^3x^2y^2 @gcd: 4a^3b^2x^5y^3; 8a^5x^2y^2}
q: Find the G.C.D. of `8ax^2y^4z^5`, `12x^5z^6`, and `24a^3x^3z^2`. {$ 4x^2z^2 @gcd: 8ax^2y^4z^5; 12x^5z^6; 24a^3x^3z^2}
q: Find the G.C.D. of `6a^2xy^2`, `12a^3y^4z^5`, `9a^5x^3y^4`, and `24a^3y^6z`. {$ 3a^2y^2 @gcd: 6a^2xy^2; 12a^3y^4z^5; 9a^5x^3y^4; 24a^3y^6z}
q: Find the G.C.D. of 36 and 116. {4}
q: Find the G.C.D. of `x^3-y^3` and `x^4-x^2y^2`. {$ x-y @gcd: x^3-y^3; x^4-x^2y^2}
q: Find the G.C.D. of `x^5+a^3x^2` and `x^4-a^2x^2`. {$ x^2(x+a) | ~x^2(x+a) @gcd: x^5+a^3x^2; x^4-a^2x^2}
q: Find the G.C.D. of `5a^5+10a^4x+5a^3x^2` and `a^3x+2a^2x^2+2ax^3+x^4`. {$ a+x @gcd: 5a^5+10a^4x+5a^3x^2; a^3x+2a^2x^2+2ax^3+x^4}
q: Find the G.C.D. of `2a^4-a^2x^2-6x^4` and `4a^5+6a^3x^2-2a^2x^3-3x^5`. {$ 2a^2+3x^2 @gcd: 2a^4-a^2x^2-6x^4; 4a^5+6a^3x^2-2a^2x^3-3x^5}
q: Find the G.C.D. of `5a^2+5ax` and `a^2-x^2`. {$ a+x @gcd: 5a^2+5ax; a^2-x^2}
q: Find the G.C.D. of `x^3-a^2x` and `x^3-a^3`. {$ x-a @gcd: x^3-a^2x; x^3-a^3}
q: Find the G.C.D. of `x^3-c^2x` and `x^2+2cx+c^2`. {$ x+c @gcd: x^3-c^2x; x^2+2cx+c^2}
q: Find the G.C.D. of `x^2+2x-3` and `x^2+5x+6`. {$ x+3 @gcd: x^2+2x-3; x^2+5x+6}
q: Find the G.C.D. of `6a^2+11ax+3x^2` and `6a^2+7ax-3x^2`. {$ 2a+3x @gcd: 6a^2+11ax+3x^2; 6a^2+7ax-3x^2}
q: Find the G.C.D. of `a^4-x^4` and `a^3+a^2x-ax^2-x^3`. {$ a^2-x^2 | (a+x)(a-x) @gcd: a^4-x^4; a^3+a^2x-ax^2-x^3}
q: Find the G.C.D. of `a^2-5ax+4x^2` and `a^3-a^2x+3ax^2-3x^3`. {$ a-x @gcd: a^2-5ax+4x^2; a^3-a^2x+3ax^2-3x^3}
q: Find the G.C.D. of `a^2x^4-a^2y^4` and `x^5+x^3y^2`. {$ x^2+y^2 @gcd: a^2x^4-a^2y^4; x^5+x^3y^2}
q: Find the G.C.D. of `a^6-x^6` and `a^10-x^10`. {$ a^2-x^2 | (a+x)(a-x) @gcd: a^6-x^6; a^10-x^10}
== 14 | Theorems, Factoring | Least common multiple
art: 107 | Multiple | A Multiple of a quantity is that which contains it exactly. Thus, 6 is a multiple of 2, or of 3; and 24 is a multiple of 2, 3, 4, etc.; also, `8a^2b^3` is a multiple of `2a`, of `2a^2`, of `2a^2b`, etc.
art: 108 | Common Multiple | A Common Multiple of two or more quantities is one that will exactly contain each quantity. Thus, 12 is a common multiple of 2 and 3; and `6ax` is a common multiple of 2, 3, `a`, and `x`.
art: 109 | Least Common Multiple | The Least Common Multiple of two or more quantities is the least quantity that will contain them exactly. Thus, 6 is the least common multiple of 2 and 3; and `10xy` is the least common multiple of `2x` and `5y`. L.C.M. stands for least common multiple. Two or more quantities can have but one L.C.M., while they may have an unlimited number of common multiples.
art: 110 | | It is evident that one quantity will not contain another exactly, unless it contains all of its prime factors. Thus, 30 does not exactly contain 14, because `30=2*3*5`, and `14=2*7`; the prime factor 7 not being one of the prime factors of 30. It contains 6, because `6=2*3`, the prime factors 2 and 3 being common to both numbers.
art: 111 | | In order that any quantity may exactly contain two or more quantities, it must contain all the different prime factors of those quantities. And, to be the least quantity that shall exactly contain them, it should contain these different prime factors only once, and no other factors beside. Thus, the L.C.M. of `a^2bc` and `acx`, is `a^2bcx`. To find the L.C.M. of `ax`, `bx`, and `abc`: `a` is a factor common to two of the terms, so it is a factor of the L.C.M.; divide those terms by it; then `x` is common to the first two; then `b`; the factors are `a`, `x`, `b`, and `c`, and their product, `abcx`, is the L.C.M.
art: 111 | Rule | To find the least common multiple of two or more quantities: 1. Arrange the quantities in a horizontal line. 2. Divide them by any prime factor that will divide two or more of them without a remainder, and set the quotients, together with the undivided quantities, in a line beneath. 3. Continue dividing as before, until no prime factor, except unity, will divide two or more of the quantities without a remainder. 4. Multiply the divisors and the quantities in the last line together, and the product will be the least common multiple required. Or, separate the quantities into their prime factors; then, to form a product, 1st, take each factor once; 2d, if any factor occurs more than once, take it the greatest number of times it occurs in either of the quantities.
art: 112 | | Since the G.C.D. of two quantities contains all the factors common to them, it follows, that if we divide the product of two quantities by their G.C.D., the quotient will be their L.C.M.
mc: A quantity that contains another exactly is a... | *multiple | divisor | factor
mc: The L.C.M. of 2 and 3 is... | *6 | 1 | 12
mc: The L.C.M. of `2x` and `5y` is... | *`10xy` | `7xy` | `xy`
mc: How many L.C.M.'s can two quantities have? | *only one | two | an unlimited number
mc: 30 does not contain 14 exactly, because... | *7 is not a prime factor of 30 | 30 is even | 14 is greater than 3
mc: The product of two quantities divided by their G.C.D. gives their... | *L.C.M. | sum | difference
tf: Two quantities may have an unlimited number of common multiples. {T}
q: Find the L.C.M. of `a^2bc` and `acx`. {$ a^2bcx @lcm: a^2bc; acx}
q: Find the L.C.M. of `ax`, `bx`, and `abc`. {$ abcx @lcm: ax; bx; abc}
q: Find the L.C.M. of `4a^2`, `3a^3x`, and `6ax^2y^3`. {$ 12a^3x^2y^3 @lcm: 4a^2; 3a^3x; 6ax^2y^3}
q: Find the L.C.M. of `12a^2x^2`, `6a^3`, and `8x^4y^2`. {$ 24a^3x^4y^2 @lcm: 12a^2x^2; 6a^3; 8x^4y^2}
q: Find the L.C.M. of 15, `6xz^2`, `9x^2z^4`, and `18cx^3`. {$ 90cx^3z^4 @lcm: 15; 6xz^2; 9x^2z^4; 18cx^3}
q: Find the L.C.M. of `4a^2(a-x)` and `6ax^4(a^2-x^2)`. {$ 12a^2x^4(a^2-x^2) | 12a^2x^4(a+x)(a-x) | ~12a^2x^4(a^2-x^2) @lcm: 4a^2(a-x); 6ax^4(a^2-x^2)}
q: Find the L.C.M. of `10a^2x^2(x-y)`, `15x^5(x+y)`, and `12(x^2-y^2)`. {$ 60a^2x^5(x^2-y^2) | 60a^2x^5(x+y)(x-y) | ~60a^2x^5(x^2-y^2) @lcm: 10a^2x^2(x-y); 15x^5(x+y); 12(x^2-y^2)}
== 15 | Algebraic Fractions | What a fraction is
art: 113 | Fraction | A Fraction is an expression representing one or more of the equal parts into which a unit is supposed to be divided. Thus, if the line AB be supposed to represent 1 foot, and it be divided into 4 equal parts, 1 of those parts is called one fourth, `1/4`; 2 of them are called two fourths, `2/4`; and 3 of them are called three fourths, `3/4`. In the algebraic fraction `1/c`, if `c=4` and 1 denotes 1 foot, then `1/c` denotes one fourth of a foot. In the fraction `a/c`, if `a=3`, then `a/c` represents three fourths of a foot.
art: 114 | Entire Quantity | An Entire Algebraic Quantity is one not expressed under the form of a fraction. Thus, `ax+b` is an entire quantity.
art: 115 | Mixed Quantity | A Mixed Quantity is one composed of an entire quantity and a fraction. Thus, `a+b/x` is a mixed quantity.
art: 116 | Improper Fraction | An Improper Algebraic Fraction is one whose numerator can be divided by the denominator, either with or without a remainder. Thus, `ab/a` and `(ax^2+b)/x` are improper fractions.
art: 117 | Simple Fraction | A Simple Fraction is a single fractional expression; as `1/3`, `a/b`, or `c/d`. It may be either proper or improper.
art: 118 | Compound Fraction | A Compound Fraction is a fraction of a fraction; as `1/2` of `2/3`, or `m/n` of `a/b`.
art: 119 | Complex Fraction | A Complex Fraction is one that has a fraction either in its numerator or denominator, or in both. Thus, two and a half over 4, and `(a+b/c)/d`, are complex fractions.
art: 120 | Terms | The Denominator is the quantity below the line, and is so called because it denominates or shows the number of parts into which the unit is divided. The Numerator is the quantity above the line, and is so called because it numbers or shows how many parts are taken. Thus, in the fraction `3/4`, the unit is divided into 4 equal parts, and three of these parts are taken: `a/c` denotes that a unit is divided into `c` equal parts, and that `a` of these parts are taken. The numerator and denominator are called the terms of a fraction.
art: 121 | | There is another point of view. If required to divide 3 apples equally between 4 boys, it can be effected by dividing each of the 3 apples into 4 equal parts, and giving to each boy 3 parts from 1 apple, or 1 part from each of the 3 apples; that is, `3/4` of 1 unit is the same as `1/4` of 3 units. So, `m/n` is either the fraction `1/n` of one unit taken `m` times, or it is the nth of `m` units. Hence, the numerator may be regarded as showing the number of units to be divided; and the denominator, as showing the divisor, or what part is taken from each.
art: 122 | Proposition I | If we multiply the numerator of a fraction without changing the denominator, the value of the fraction is increased as many times as there are units in the multiplier. If we multiply the numerator of `2/7` by 3, it becomes `6/7`, which is three times as large.
art: 123 | Proposition II | If we divide the numerator of a fraction without changing the denominator, the value of the fraction is diminished as many times as there are units in the divisor. If we divide the numerator of `4/5` by 2, it becomes `2/5`, only one half as large.
art: 124 | Proposition III | If we multiply the denominator of a fraction without changing the numerator, the value of the fraction is diminished as many times as there are units in the multiplier. If we multiply the denominator of `3/4` by 2, it becomes `3/8`; the parts are only one half the size, so its value is one half that of the first.
art: 125 | Proposition IV | If we divide the denominator of a fraction without changing the numerator, the value of the fraction is increased as many times as there are units in the divisor. If we divide the denominator of `2/9` by 3, it becomes `2/3`, three times the value.
art: 126 | Proposition V | Multiplying both terms of a fraction by the same number or quantity, changes the form of a fraction, but does not alter its value. Multiplying the numerator increases the value, multiplying the denominator decreases it as many times; the increase is equal to the decrease, and the value remains unchanged.
art: 127 | Proposition VI | Dividing both terms of a fraction by the same number or quantity, changes the form of the fraction but not its value. The decrease is equal to the increase, and the value remains unchanged.
mc: An expression not in the form of a fraction, like `ax+b`, is... | *an entire quantity | a mixed quantity | an improper fraction
mc: `a+b/x` is... | *a mixed quantity | an entire quantity | a complex fraction
mc: A fraction of a fraction, like `1/2` of `2/3`, is a... | *compound fraction | complex fraction | simple fraction
mc: A fraction with a fraction in its numerator or denominator is a... | *complex fraction | compound fraction | mixed quantity
mc: The quantity below the line is the... | *denominator | numerator | coefficient
mc: The numerator and denominator are called the ___ of the fraction. | *terms | factors | roots
mc: Multiplying only the numerator of a fraction by 3 makes its value... | *three times as large | one third as large | unchanged
mc: Multiplying only the denominator of a fraction by 2 makes its value... | *one half as large | twice as large | unchanged
mc: Multiplying both terms of a fraction by the same quantity... | *changes its form but not its value | doubles its value | changes its value
tf: `3/4` of one apple is the same as `1/4` of three apples. {T}
tf: Dividing both terms of a fraction by the same quantity changes its value. {F}
tf: `ab/a` is an improper fraction. {T}
== 16 | Algebraic Fractions | Lowest terms
art: 128 | Case I | To reduce a fraction to its lowest terms. Since the value of a fraction is not changed by dividing both terms by the same quantity: Rule. Divide both terms by their greatest common divisor. Or, resolve the numerator and denominator into their prime factors, and then cancel those factors common to both terms. The last rule is generally most convenient. Thus, `4ab^2/(6bx^2)=(2ab*2b)/(3x^2*2b)=2ab/(3x^2)`.
art: 128 | Example | Reduce `(3a^3-3ab^2)/(5ab+5b^2)`. This is equal to `3a(a^2-b^2)/(5b(a+b))=3a(a+b)(a-b)/(5b(a+b))=3a(a-b)/(5b)`.
art: 129 | | In division, when the quotient is a fraction, it can often be reduced to lower terms. Thus `5x^2y` divided by `3xy^2` is `5x^2y/(3xy^2)`, which reduces to `5x/(3y)`.
mc: To reduce a fraction to its lowest terms, divide both terms by their... | *greatest common divisor | least common multiple | sum
mc: `4ab^2/(6bx^2)` in lowest terms is... | *`2ab/(3x^2)` | `4ab/(6x^2)` | `2b/(3x)`
mc: Can you cancel the `a` in `(a+b)/a`? | *No, `a` is not a factor of the whole numerator | Yes, it gives `b` | Yes, it gives `1+b`
tf: In `3a(a+b)(a-b)/(5b(a+b))` we may cancel the factor `a+b`. {T}
q: Reduce `4ab^2/(6bx^2)` to its lowest terms. {$ 2ab/(3x^2) @ 4ab^2/(6bx^2)}
q: Reduce `4a^3x^2/(6a^4)` to its lowest terms. {$ 2x^2/(3a) @ 4a^3x^2/(6a^4)}
q: Reduce `6a^2x^2/(8ax^3)` to its lowest terms. {$ 3a/(4x) @ 6a^2x^2/(8ax^3)}
q: Reduce `9x^4y^3z^5/(12x^3y^4z^5)` to its lowest terms. {$ 3x/(4y) @ 9x^4y^3z^5/(12x^3y^4z^5)}
q: Reduce `12x^2y^2z^4/(8x^2z^3)` to its lowest terms. {$ 3y^2z/2 @ 12x^2y^2z^4/(8x^2z^3)}
q: Reduce `(2a^2cx^2+2acx)/(10ac^2x)` to its lowest terms. {$ (ax+1)/(5c) @ (2a^2cx^2+2acx)/(10ac^2x)}
q: Reduce `(5a^2b+5ab^2)/(5abc+5abd)` to its lowest terms. {$ (a+b)/(c+d) @ (5a^2b+5ab^2)/(5abc+5abd)}
q: Reduce `(12x^2y-18xy^2)/(18x^2y+12xy^2)` to its lowest terms. {$ (2x-3y)/(3x+2y) @ (12x^2y-18xy^2)/(18x^2y+12xy^2)}
q: Reduce `(3a^3-3ab^2)/(5ab+5b^2)` to its lowest terms. {$ 3a(a-b)/(5b) | (3a^2-3ab)/(5b) @ (3a^3-3ab^2)/(5ab+5b^2)}
q: Reduce `(3z^3-24z+9)/(4z^3-32z+12)` to its lowest terms. {$ 3/4 @ (3z^3-24z+9)/(4z^3-32z+12)}
q: Reduce `(n^2-2n+1)/(n^2-1)` to its lowest terms. {$ (n-1)/(n+1) @ (n^2-2n+1)/(n^2-1)}
q: Reduce `(x^3-xy^2)/(x^4-y^4)` to its lowest terms. {$ x/(x^2+y^2) @ (x^3-xy^2)/(x^4-y^4)}
q: Reduce `(x^2-y^2)/(x^2-2xy+y^2)` to its lowest terms. {$ (x+y)/(x-y) @ (x^2-y^2)/(x^2-2xy+y^2)}
q: Reduce `(x^3-ax^2)/(x^2-2ax+a^2)` to its lowest terms. {$ x^2/(x-a) @ (x^3-ax^2)/(x^2-2ax+a^2)}
q: Reduce `(x^2+2x-15)/(x^2+8x+15)` to its lowest terms. {$ (x-3)/(x+3) @ (x^2+2x-15)/(x^2+8x+15)}
q: Divide `5x^2y` by `3xy^2`. {$ 5x/(3y) @ 5x^2y/(3xy^2)}
q: Divide `amn^2` by `a^2m^2n`. {$ n/(am) @ amn^2/(a^2m^2n)}
q: Divide `3m^2+3n^2` by `15m^2+15n^2`. {$ 1/5 @ (3m^2+3n^2)/(15m^2+15n^2)}
q: Divide `x^3y^2+x^2y^3` by `ax^2y+axy^2`. {$ xy/a @ (x^3y^2+x^2y^3)/(ax^2y+axy^2)}
q: Divide `x^2+2x-3` by `x^2+5x+6`. {$ (x-1)/(x+2) @ (x^2+2x-3)/(x^2+5x+6)}
== 17 | Algebraic Fractions | Mixed quantities and signs
art: 130 | Case II | To reduce a fraction to an entire or mixed quantity. Since the numerator of the fraction may be regarded as a dividend, and the denominator as a divisor, this is merely a case of division. Rule. Divide the numerator by the denominator for the entire part; and, if there be a remainder, place it over the denominator for the fractional part. The fractional part should be reduced to its lowest terms.
art: 131 | Case III | To reduce a mixed quantity to the form of a fraction. In `2 1/3`, there are how many thirds? In 1 unit there are 3 thirds; hence, in 2 units there are 6 thirds; then, 2 and 1 third, or `2+1/3=6/3+1/3=7/3`. So, `a+b/c=ac/c+b/c=(ac+b)/c`; and `a-b/c=(ac-b)/c`. Rule. Multiply the entire part by the denominator of the fraction. Add the numerator of the fractional part to this product, or subtract it, as the sign may direct, and place the result over the denominator. Cases II and III are the reverse of, and mutually prove each other.
art: 131 | Example | Reduce `3a+(ax-a)/x` to a fractional form. `3a=3ax/x`, and `3ax/x+(ax-a)/x=(3ax+ax-a)/x=(4ax-a)/x`. Reduce `4a-(a-b)/(3c)`: `4a=12ac/(3c)`, and `12ac/(3c)-(a-b)/(3c)=(12ac-(a-b))/(3c)=(12ac-a+b)/(3c)`.
art: 132 | The Signs of Fractions | The signs prefixed to the terms of a fraction affect only those terms; but the sign placed before the dividing line of a fraction, affects its whole value. Thus, in `-(a^2-b^2)/(x+y)`, the sign of `a^2`, in the numerator, is plus; of `b^2`, minus; while the sign of each term of the denominator is plus. But the sign of the fraction, taken as a whole, is minus.
art: 132 | | By the rule for the signs in division, `+ab/+a=+b`; or, changing the signs of both terms, `-ab/-a=+b`. Changing the sign of the numerator, we have `-ab/+a=-b`. Changing the sign of the denominator, `+ab/-a=-b`. Hence, the signs of both terms of a fraction may be changed without altering its value or changing its sign; but, if the sign of either term of a fraction be changed, and not that of the other, the sign of the fraction will be changed. Hence, the signs of either term of a fraction may be changed, without altering its value, if the sign of the fraction be changed at the same time. Thus, `(ax-x^2)/c=-(ax-x^2)/-c=-(x^2-ax)/c`; and `a-(a-x)/b=a+(a-x)/-b=a+(x-a)/b`.
mc: To reduce a fraction to an entire or mixed quantity... | *divide the numerator by the denominator | multiply the terms together | add the terms
mc: In 2 and one third, there are how many thirds? | *7 | 6 | 5
mc: `a+b/c` as a fraction is... | *`(ac+b)/c` | `(a+b)/c` | `ab/c`
mc: The sign placed before the dividing line of a fraction affects... | *its whole value | only the numerator | only the denominator
mc: If the signs of both terms of a fraction are changed, its value... | *is not altered | changes sign | becomes zero
mc: `-ab/-a` is... | *`+b` | `-b` | `ab`
mc: `(ax-x^2)/c` is equal to... | *`-(x^2-ax)/c` | `(x^2-ax)/c` | `-(ax-x^2)/c`
tf: Changing the sign of the numerator only changes the sign of the fraction. {T}
q: Reduce `(3ax+b^2)/x` to an entire or mixed quantity. {$ 3a+b^2/x @ (3ax+b^2)/x}
q: Reduce `(ab+b^2)/a` to an entire or mixed quantity. {$ b+b^2/a @ (ab+b^2)/a}
q: Reduce `(a^2+x^2)/(a-x)` to an entire or mixed quantity. {$ a+x+2x^2/(a-x) @ (a^2+x^2)/(a-x)}
q: Reduce `(2a^2x-x^3)/a` to an entire or mixed quantity. {$ 2ax-x^3/a @ (2a^2x-x^3)/a}
q: Reduce `(4ax-2x^2-a^2)/(2a-x)` to an entire or mixed quantity. {$ 2x-a^2/(2a-x) @ (4ax-2x^2-a^2)/(2a-x)}
q: Reduce `(a^3+x^3-x^4)/(a+x)` to an entire or mixed quantity. {$ a^2-ax+x^2-x^4/(a+x) @ (a^3+x^3-x^4)/(a+x)}
q: Reduce `(12x^3-3x^2)/(4x^3-x^2-4x+1)` to an entire or mixed quantity. {$ 3+3/(x^2-1) @ (12x^3-3x^2)/(4x^3-x^2-4x+1)}
q: In 2 and one third, there are how many thirds? {7}
q: Reduce `3a+(ax-a)/x` to a fractional form. {$ (4ax-a)/x @ 3a+(ax-a)/x}
q: Reduce `4a-(a-b)/(3c)` to a fractional form. {$ (12ac-a+b)/(3c) @ 4a-(a-b)/(3c)}
q: Reduce `2+3/5` to an improper fraction. {=13/5}
q: Reduce `2-3/5` to an improper fraction. {=7/5}
q: Reduce `5c+(a-b)/(2x)` to an improper fraction. {$ (10cx+a-b)/(2x) @ 5c+(a-b)/(2x)}
q: Reduce `5c-(a-b)/(2x)` to an improper fraction. {$ (10cx-a+b)/(2x) @ 5c-(a-b)/(2x)}
q: Reduce `3x-(4x^2-5)/(5x)` to an improper fraction. {$ (11x^2+5)/(5x) @ 3x-(4x^2-5)/(5x)}
q: Reduce `8y+(3a-y^2)/(5y)` to an improper fraction. {$ (39y^2+3a)/(5y) @ 8y+(3a-y^2)/(5y)}
q: Reduce `z-1+(1-z)/(1+z)` to an improper fraction. {$ (z^2-z)/(1+z) @ z-1+(1-z)/(1+z)}
q: Reduce `4y/(2x+z)-5` to an improper fraction. {$ (4y-10x-5z)/(2x+z) @ 4y/(2x+z)-5}
q: Reduce `(3+5c)/8-6` to an improper fraction. {$ (5c-45)/8 @ (3+5c)/8-6}
q: Reduce `a-x+(a^2+x^2-5)/(a+x)` to an improper fraction. {$ (2a^2-5)/(a+x) @ a-x+(a^2+x^2-5)/(a+x)}
q: Reduce `a^3-a^2x+ax^2-x^3-(a^4+x^4)/(a+x)` to an improper fraction. {$ -2x^4/(a+x) @ a^3-a^2x+ax^2-x^3-(a^4+x^4)/(a+x)}
== 18 | Algebraic Fractions | Common denominators
art: 133 | Case IV | To reduce fractions of different denominators to equivalent fractions having a common denominator. Reduce `a/b` and `c/d` to a common denominator: multiply both terms of the first fraction by `d`, the denominator of the second, and both terms of the second fraction by `b`, the denominator of the first. We shall then have `ad/(bd)` and `bc/(bd)`. The values of the fractions are not changed, since, in each, both terms are multiplied by the same quantity; and the denominators must be the same, since they consist of the product of the same quantities.
art: 133 | Rule | To reduce fractions to a common denominator: multiply both terms of each fraction by the product of all the denominators except its own. This is the same as to multiply each numerator by all the denominators except its own, for the new numerators; and all the denominators together, for the common denominator. Thus `a/m`, `b/n`, and `c/r` become `anr/(mnr)`, `bmr/(mnr)`, and `cmn/(mnr)`.
art: 134 | Least Common Denominator | When the denominators of the fractions to be reduced contain one or more common factors, the preceding rule does not give the least common denominator. If we find the L.C.M. of all the denominators, and divide it by the denominators severally, we obtain multipliers for each of the fractions which will make their denominators the same as the L.C.M. Thus, for `m/b`, `n/(bc)`, and `r/(cd)`, the L.C.M. of the denominators is `bcd`; dividing this by `b`, `bc`, and `cd`, we obtain `cd`, `d`, and `b`, and the fractions become `mcd/(bcd)`, `nd/(bcd)`, and `br/(bcd)`.
art: 134 | Rule | To reduce fractions to the least common denominator: 1. Find the least common multiple of all the denominators; this will be the common denominator. 2. Divide the least common multiple by the first of the given denominators, and multiply the quotient by the first of the given numerators; the product will be the first of the required numerators. 3. Proceed, in a similar manner, to find each of the other numerators. Each fraction should first be reduced to its lowest terms.
art: 135 | | To reduce an entire quantity to the form of a fraction having a given denominator: since `a=a/1`, if we multiply both terms by `b`, which will not change its value, we have `a/1=ab/b`. Rule: multiply the entire quantity by the given denominator, and write the product over it.
art: 136 | | To convert a fraction to an equivalent one, having a denominator equal to some multiple of the denominator of the given fraction: reduce `a/b` to a fraction whose denominator is `bc`. This is done by multiplying both terms by `c`, which may be found by dividing `bc` by `b`. Rule: divide the given denominator by the denominator of the fraction, and multiply both terms by the quotient. If the required denominator is not a multiple of the given one, the result will be a complex fraction: `1/2` with the denominator 5 would have the numerator two and a half.
mc: To reduce `a/b` and `c/d` to a common denominator, the common denominator is... | *`bd` | `b+d` | `ac`
mc: When the denominators have common factors, the least common denominator is their... | *least common multiple | product | greatest common divisor
mc: `a` written as a fraction with the denominator `b` is... | *`ab/b` | `a/b` | `b/a`
mc: To convert `a/b` to a fraction whose denominator is `bc`, multiply both terms by... | *`c` | `b` | `bc`
tf: Multiplying both terms of a fraction by the same quantity does not change its value. {T}
q: Reduce `a/b` and `c/d` to a common denominator. The common denominator is {$ bd} The first numerator is {$ ad} The second numerator is {$ bc}
q: Reduce `a/b`, `c/d`, and `1/2` to a common denominator. Common denominator: {$ 2bd} First numerator: {$ 2ad} Second: {$ 2bc} Third: {$ bd}
q: Reduce `x/y` and `(x+a)/c` to a common denominator. Common denominator: {$ cy} First numerator: {$ cx} Second: {$ xy+ay}
q: Reduce `2/3`, `3a/4`, and `(x-y)/b` to a common denominator. Common denominator: {$ 12b} First numerator: {$ 8b} Second: {$ 9ab} Third: {$ 12x-12y}
q: Reduce `2x/(3y)`, `3x/(5z)`, and `a` to a common denominator. Common denominator: {$ 15yz} First numerator: {$ 10xz} Second: {$ 9xy} Third: {$ 15ayz}
q: Reduce `(x+y)/(x-y)` and `(x-y)/(x+y)` to a common denominator. Common denominator: {$ x^2-y^2 | (x+y)(x-y)} First numerator: {$~ (x+y)^2} Second: {$~ (x-y)^2}
q: Reduce `a`, `3b/c`, `d`, and 5 to a common denominator. Common denominator: {$ c} First numerator: {$ ac} Second: {$ 3b} Third: {$ cd} Fourth: {$ 5c}
q: Reduce `m/b`, `n/(bc)`, and `r/(cd)` to the least common denominator. Least common denominator: {$ bcd} First numerator: {$ cdm} Second: {$ dn} Third: {$ br}
q: Reduce `2a/(3bc)`, `3x/(cd)`, and `5y/(6bd)` to the least common denominator. Least common denominator: {$ 6bcd @lcm: 3bc; cd; 6bd} First numerator: {$ 4ad} Second: {$ 18bx} Third: {$ 5cy}
q: Reduce `m/(ac)`, `n/(b^2c)`, and `r/(c^2d)` to the least common denominator. Least common denominator: {$ ab^2c^2d @lcm: ac; b^2c; c^2d} First numerator: {$ b^2cdm} Second: {$ acdn} Third: {$ ab^2r}
q: Reduce `(x+y)/(x-y)`, `(x-y)/(x+y)`, and `(x^2+y^2)/(x^2-y^2)` to the least common denominator. Least common denominator: {$ x^2-y^2 | (x+y)(x-y)} First numerator: {$~ (x+y)^2} Second: {$~ (x-y)^2} Third: {$ x^2+y^2}
q: Reduce `x` to a fraction whose denominator is 4. The numerator is {$ 4x}
q: Reduce `m` to a fraction whose denominator is `9a^2`. The numerator is {$ 9a^2m}
q: Reduce `3c+5` to a fraction whose denominator is `16c^2`. The numerator is {$~ (3c+5)16c^2}
q: Reduce `a-b` to a fraction whose denominator is `a^2-2ab+b^2`. The numerator is {$~ (a-b)(a^2-2ab+b^2)}
q: Reduce `a/b` to a fraction whose denominator is `bc`. The numerator is {$ ac}
q: Convert `3/4` to an equivalent fraction, having the denominator 16. The numerator is {12}
q: Convert `b/c` to an equivalent fraction, having the denominator `a^2c^2`. The numerator is {$ a^2bc}
q: Convert `(m+n)/(m-n)` to an equivalent fraction, having the denominator `m^2-2mn+n^2`. The numerator is {$ m^2-n^2 | (m+n)(m-n)}
== 19 | Algebraic Fractions | Adding and subtracting fractions
art: 137 | Case V | Addition and subtraction of fractions. Required to find the sum of `2/5` and `4/5`. Here, both parts being of the same kind, that is, fifths, we may add them together, and the sum is 6 fifths, `6/5`. The sum of `a/m` and `b/m`: the parts being the same, that is, mths, we shall have `a/m+b/m=(a+b)/m`. The sum of `a/m` and `c/n`: the denominators being different, we can not add the numerators, and call them by the same name. We may, however, reduce them to a common denominator, and then add: `a/m=an/(mn)`; `c/n=cm/(mn)`; and `an/(mn)+cm/(mn)=(an+cm)/(mn)`.
art: 137 | Rule | To add fractions: reduce the fractions, if necessary, to a common denominator; add the numerators together, and write their sum over the common denominator. Entire quantities and fractions may be added separately; or, the entire quantities may be put into the form of fractions by making their denominators unity. When mixed quantities occur, it is often better to reduce them to the form of improper fractions.
art: 138 | Rule | It is obvious that the same principles would apply in finding the difference between two fractions. To subtract fractions: reduce the fractions, if necessary, to a common denominator; subtract the numerator of the subtrahend from the numerator of the minuend, and write the remainder over the common denominator.
mc: The sum of `2/5` and `4/5` is... | *`6/5` | `6/10` | `8/25`
mc: The sum of `a/m` and `b/m` is... | *`(a+b)/m` | `(a+b)/(2m)` | `ab/m`
mc: Before adding `a/m` and `c/n`, we must... | *reduce them to a common denominator | add the denominators | multiply the numerators
mc: To subtract fractions with a common denominator... | *subtract the numerators and keep the denominator | subtract the denominators too | multiply the numerators
tf: The sum of `a/m` and `c/n` is `(an+cm)/(mn)`. {T}
q: Find the sum of `a/m` and `b/m`. {$ (a+b)/m @ a/m+b/m}
q: Find the sum of `a/m` and `c/n`. {$ (an+cm)/(mn) @ a/m+c/n}
q: Add `a/2`, `a/3`, and `a/6` together. {$ a @ a/2+a/3+a/6}
q: Add `x/3`, `x/5`, and `x/6` together. {$ 7x/10 @ x/3+x/5+x/6}
q: Add `1/a`, `1/b`, and `1/c` together. {$ (bc+ac+ab)/(abc) @ 1/a+1/b+1/c}
q: Add `x/2`, `y/3`, and `z/4` together. {$ (6x+4y+3z)/12 @ x/2+y/3+z/4}
q: Add `3x/4`, `4x/5`, and `5x/6` together. {$ 143x/60 @ 3x/4+4x/5+5x/6}
q: Add `(x+y)/2` and `(x-y)/2` together. {$ x @ (x+y)/2+(x-y)/2}
q: Add `1/(a+b)` and `1/(a-b)` together. {$ 2a/(a^2-b^2) | 2a/((a+b)(a-b)) @ 1/(a+b)+1/(a-b)}
q: Add `(5+x)/y`, `(3-ax)/(ay)`, and `b/(3a)` together. {$ (15a+9+by)/(3ay) @ (5+x)/y+(3-ax)/(ay)+b/(3a)}
q: Add `(a-b)/(ab)`, `(b-c)/(bc)`, and `(c-a)/(ac)` together. {$ 0 @ (a-b)/(ab)+(b-c)/(bc)+(c-a)/(ac)}
q: Add `2x`, `3x+3z/5`, and `x+2z/9` together. {$ 6x+37z/45 @ 2x+3x+3z/5+x+2z/9}
q: Add `5x+(x-2)/3` and `4x-(2x-3)/(5x)` together. {$ 9x+(5x^2-16x+9)/(15x) @ 5x+(x-2)/3+4x-(2x-3)/(5x)}
q: From `a/2` take `a/3`. {$ a/6 @ a/2-a/3}
q: From `3x/4` take `2x/3`. {$ x/12 @ 3x/4-2x/3}
q: From `(a+b)/2` take `(a-b)/2`. {$ b @ (a+b)/2-(a-b)/2}
q: From `2ax/3` take `5ax/2`. {$ -11ax/6 @ 2ax/3-5ax/2}
q: From `3/(4a)` take `5/(2x)`. {$ (3x-10a)/(4ax) @ 3/(4a)-5/(2x)}
q: From `(x+y)/(x-y)` take `(x-y)/(x+y)`. {$ 4xy/(x^2-y^2) | 4xy/((x+y)(x-y)) @ (x+y)/(x-y)-(x-y)/(x+y)}
q: From `(2a+b)/(5c)` take `(3a-b)/(7c)`. {$ (12b-a)/(35c) @ (2a+b)/(5c)-(3a-b)/(7c)}
q: From `5x+x/b` take `2x-(x-b)/c`. {$ 3x+(cx+bx-b^2)/(bc) @ 5x+x/b-(2x-(x-b)/c)}
q: From `1/(a-b)` take `1/(a+b)`. {$ 2b/(a^2-b^2) | 2b/((a+b)(a-b)) @ 1/(a-b)-1/(a+b)}
q: From `a+b` take `1/a+1/b`. {$ (a^2b+ab^2-a-b)/(ab) | (a+b)(ab-1)/(ab) @ a+b-(1/a+1/b)}
q: From `(x^3+y^3)/(x-y)` take `(x^3-y^3)/(x+y)`. {$ (2x^3y+2xy^3)/(x^2-y^2) @ (x^3+y^3)/(x-y)-(x^3-y^3)/(x+y)}
q: From `x+1/(x-1)` take `2/(x+1)`. {$ x+(3-x)/(x^2-1) @ x+1/(x-1)-2/(x+1)}
q: From `2a-3x+(a-x)/a` take `a-5x+(x-a)/x`. {$ a+2x+(a^2-x^2)/(ax) @ 2a-3x+(a-x)/a-(a-5x+(x-a)/x)}
== 20 | Algebraic Fractions | Multiplying and dividing fractions
art: 139 | Case VI | To multiply a fraction by an entire quantity, or an entire quantity by a fraction: it is evident, from Prop. I, that this may be done by multiplying the numerator. Thus, `a/b*2=2a/b`, and `a/b*m=am/b`. Rule: multiply the numerator by the entire quantity, and write the product over the denominator. A fraction may also be multiplied by dividing its denominator by the entire quantity: in multiplying `5/8` by 2, we may divide the denominator by 2, and the result will be `5/4`. We should always divide the denominator of the fraction by the entire quantity, when it can be done without a remainder. If a fraction is multiplied by a quantity equal to its denominator, the product will equal the numerator.
art: 140 | | To multiply a fraction by a fraction: let it be required to multiply `4/5` by `2/3`. Since `2/3` is the same as 2 multiplied by `1/3`, multiply `4/5` by 2, and take `1/3` of the product: `4/5*2=8/5`, and `1/3` of `8/5` is `8/15`. So, to multiply `a/c` by `m/n`, multiply `a/c` by `m`, and take `1/n` of the product: `ma/(nc)`. Rule: multiply the numerators together for a new numerator, and the denominators together for a new denominator. If either of the factors is a mixed quantity, reduce it to an improper fraction first. When the numerators and denominators have common factors, indicate the multiplication, and cancel such factors. Thus, `5a/(a^2-b^2)*(a+b)/(2a)=5a(a+b)/(2a(a+b)(a-b))=5/(2(a-b))`.
art: 141 | Case VII | To divide a fraction by an entire quantity: a fraction is divided by an entire quantity, by dividing its numerator, or multiplying its denominator. Thus, `4/5` divided by 2 is `2/5`; or `4/10`, which is `2/5`. Rule: divide the numerator by the divisor, if it can be done without a remainder; if not, multiply the denominator. Or, write the divisor in the form of a fraction, as `m/1`, then invert it, and proceed as in multiplication of fractions.
art: 142 | | To divide by a fraction: how many times is `2/3` contained in 4? `1/3` is contained in 4, 12 times; `2/3` is contained in 4 only one half as often, that is, 6 times. How many times is `m/n` contained in `a`? `1/n` is contained in `a`, `na` times, and `m/n` is contained `na/m` times. The process consists in multiplying the dividend by the denominator of the divisor, and dividing it by the numerator. Rule: invert the divisor, and proceed as in multiplication of fractions. After inverting the divisor, abbreviate by canceling.
mc: To multiply a fraction by an entire quantity... | *multiply the numerator | multiply the denominator | add it to the numerator
mc: `a/b*m` is... | *`am/b` | `a/(bm)` | `(a+m)/b`
mc: To multiply a fraction by a fraction... | *multiply numerators together and denominators together | add the numerators | invert the second fraction
mc: `4/5*2/3` is... | *`8/15` | `6/8` | `12/10`
mc: To divide by a fraction... | *invert the divisor and multiply | invert the dividend | subtract the fractions
mc: How many times is `2/3` contained in 4? | *6 | 12 | `8/3`
mc: If a fraction is multiplied by its own denominator, the product is... | *the numerator | 1 | the denominator
tf: "`2/3` of 6" is the same as `2/3*6`. {T}
q: Multiply `2a/(bc)` by `ad`. {$ 2a^2d/(bc) @ 2a/(bc)*ad}
q: Multiply `(a+b)/c` by `xy`. {$ (axy+bxy)/c @ (a+b)/c*xy}
q: Multiply `a-2b` by `4c/(2a+c)`. {$ (4ac-8bc)/(2a+c) @ (a-2b)*4c/(2a+c)}
q: Multiply `a^2-b^2` by `(3c-a)/(2a)`. {$ (3a^2c-a^3-3b^2c+ab^2)/(2a) @ (a^2-b^2)*(3c-a)/(2a)}
q: Multiply `(2a+3xz)/(a^2b)` by `ab`. {$ (2a+3xz)/a @ (2a+3xz)/(a^2b)*ab}
q: Multiply `(5bc+3bx)/(10x^3y^2-14x^4y^3)` by `2x^2y^2`. {$ (5bc+3bx)/(5x-7x^2y) @ (5bc+3bx)/(10x^3y^2-14x^4y^3)*2x^2y^2}
q: Multiply `(ax+by)/(4(a+b)(a-b))` by `2(a-b)`. {$ (ax+by)/(2a+2b) @ (ax+by)/(4(a+b)(a-b))*2(a-b)}
q: Multiply `(5c+4d)/(5(a-b)(c^2-d^2))` by `5(a-b)(c+d)`. {$ (5c+4d)/(c-d) @ (5c+4d)/(5(a-b)(c^2-d^2))*5(a-b)(c+d)}
q: Multiply `a/c` by `c`. {$ a @ a/c*c}
q: Multiply `(a-b)/(c+d)` by `c+d`. {$ a-b @ (a-b)/(c+d)*(c+d)}
q: Multiply `(m^2-n^2)/(2x+5y)` by `2x+5y`. {$ m^2-n^2 @ (m^2-n^2)/(2x+5y)*(2x+5y)}
q: Multiply `4/5` by `2/3`. {=8/15}
q: Multiply `14a/(15b)` by `5c/(21d)`. {$ 2ac/(9bd) @ 14a/(15b)*5c/(21d)}
q: Multiply `3a/4` by `5x/8`. {$ 15ax/32 @ 3a/4*5x/8}
q: Multiply `4a/(5x)` by `3x/(7a)`. {$ 12/35 @ 4a/(5x)*3x/(7a)}
q: Multiply `3(a+x)/2` by `4x/(a+x)`. {$ 6x @ 3(a+x)/2*4x/(a+x)}
q: Multiply `(2x+3)/5` by `10x/7`. {$ (4x^2+6x)/7 @ (2x+3)/5*10x/7}
q: Multiply `(x^2-y^2)/(ab)` by `a^2/(x+y)`. {$ (ax-ay)/b @ (x^2-y^2)/(ab)*a^2/(x+y)}
q: Multiply `xyz/(x^4+y^3)` by `(x^4+y^3)/(xyz)`. {$ 1 @ xyz/(x^4+y^3)*(x^4+y^3)/(xyz)}
q: Multiply `(a-x)/x^2` by `a^2/(a^2-x^2)`. {$ a^2/(ax^2+x^3) @ (a-x)/x^2*a^2/(a^2-x^2)}
q: Multiply `x/(a+x)`, `(a^2-x^2)/x^2`, and `a/(a-x)` together. {$ a/x @ x/(a+x)*(a^2-x^2)/x^2*a/(a-x)}
q: Multiply `(a-b)/2`, `2/(a^2-b^2)`, and `a+b` together. {$ 1 @ (a-b)/2*2/(a^2-b^2)*(a+b)}
q: Multiply `(x^2+y^2)/(x^2-y^2)` by `(x-y)/(x+y)`. {$ (x^2+y^2)/(x^2+2xy+y^2) @ (x^2+y^2)/(x^2-y^2)*(x-y)/(x+y)}
q: Multiply `c+cx/(c-x)` by `(c^2-x^2)/(x+1)`. {$ (c^3+c^2x)/(x+1) @ (c+cx/(c-x))*(c^2-x^2)/(x+1)}
q: Divide `ma/n` by `m`. {$ a/n @ ma/n/m}
q: Divide `6a^2b/(7n)` by `3ab`. {$ 2a/(7n) @ 6a^2b/(7n)/(3ab)}
q: Divide `14ac^3m^2/(11xy)` by `7acm^2`. {$ 2c^2/(11xy) @ 14ac^3m^2/(11xy)/(7acm^2)}
q: Divide `(a^2+ab)/(3+2x)` by `a`. {$ (a+b)/(3+2x) @ (a^2+ab)/(3+2x)/a}
q: Divide `(c^2+cd)/5` by `c+d`. {$ c/5 @ (c^2+cd)/5/(c+d)}
q: Divide `(x^2+2xy+y^2)/(c+d)` by `x+y`. {$ (x+y)/(c+d) @ (x^2+2xy+y^2)/(c+d)/(x+y)}
q: Divide `2a/(3c)` by `b`. {$ 2a/(3bc) @ 2a/(3c)/b}
q: Divide `(3+5a)/(a-b)` by `a+b`. {$ (3+5a)/(a^2-b^2) @ (3+5a)/(a-b)/(a+b)}
q: Divide `(3a+5c)/(2x+3y)` by `2x-3y`. {$ (3a+5c)/(4x^2-9y^2) @ (3a+5c)/(2x+3y)/(2x-3y)}
q: Divide `(b-c)/(a^2+ab+b^2)` by `a-b`. {$ (b-c)/(a^3-b^3) @ (b-c)/(a^2+ab+b^2)/(a-b)}
q: Divide `(x-y)/(x^2-xy+y^2)` by `x+y`. {$ (x-y)/(x^3+y^3) @ (x-y)/(x^2-xy+y^2)/(x+y)}
q: Divide `(a^2+abc)/(b+c)` by `a+bc`. {$ a/(b+c) @ (a^2+abc)/(b+c)/(a+bc)}
q: Divide `(m^2-n^2)/(b+c)` by `am-an`. {$ (m+n)/(ab+ac) @ (m^2-n^2)/(b+c)/(am-an)}
q: Divide `(a^3-b^3)/c` by `a^2+ab+b^2`. {$ (a-b)/c @ (a^3-b^3)/c/(a^2+ab+b^2)}
q: How many times is `2/3` contained in 4? {6}
q: How many times is `m/n` contained in `a`? {$ an/m @ a/(m/n)}
q: How many times is `2/3` contained in `3/4`? {=9/8}
q: How many times is `m/n` contained in `a/c`? {$ an/(cm) @ (a/c)/(m/n)}
q: Divide 4 by `a/3`. {$ 12/a @ 4/(a/3)}
q: Divide `a` by `1/4`. {$ 4a @ a/(1/4)}
q: Divide `ab^2` by `2ab/(5c)`. {$ 5bc/2 @ ab^2/(2ab/(5c))}
q: Divide `a/3` by `c/2`. {$ 2a/(3c) @ (a/3)/(c/2)}
q: Divide `x^2y/(3a)` by `xy^2/(2b)`. {$ 2bx/(3ay) @ (x^2y/(3a))/(xy^2/(2b))}
q: Divide `16ax/5` by `4x/15`. {$ 12a @ (16ax/5)/(4x/15)}
q: Divide `(6z+4)/5` by `(3z+2)/(4y)`. {$ 8y/5 @ ((6z+4)/5)/((3z+2)/(4y))}
q: Divide `(a^2-b^2)/5` by `(a+b)/a`. {$ (a^2-ab)/5 @ ((a^2-b^2)/5)/((a+b)/a)}
q: Divide `(z^2-4)/6` by `(z-2)/2`. {$ (z+2)/3 @ ((z^2-4)/6)/((z-2)/2)}
q: Divide `(x^2-2xy+y^2)/(ab)` by `(x-y)/(bc)`. {$ (cx-cy)/a @ ((x^2-2xy+y^2)/(ab))/((x-y)/(bc))}
q: Divide `a/(a^2-1)` by `(a+1)/(a-1)`. {$ a/(a+1)^2 | a/(a^2+2a+1) @ (a/(a^2-1))/((a+1)/(a-1))}
q: Divide `(2z+3)/(x+y)` by `(10z+15)/(x^2-y^2)`. {$ (x-y)/5 @ ((2z+3)/(x+y))/((10z+15)/(x^2-y^2))}
q: Divide `3(a^2-x^2)/x` by `2(a+x)/(a-x)`. {$ 3(a-x)^2/(2x) | (3a^2-6ax+3x^2)/(2x) @ (3(a^2-x^2)/x)/(2(a+x)/(a-x))}
q: Divide `2x^2/(a^3+x^3)` by `x/(a+x)`. {$ 2x/(a^2-ax+x^2) @ (2x^2/(a^3+x^3))/(x/(a+x))}
== 21 | Algebraic Fractions | Complex fractions and series
art: 143 | | To reduce a complex to a simple fraction. This may be regarded as a case of division, in which the dividend and the divisor are either fractions or mixed quantities. Thus, two and a third over three and a half is the same as `2 1/3` divided by `3 1/2`: `7/3÷7/2=7/3*2/7=2/3`. Also, `(a+b/c)÷(m+n/r)=(ac+b)/c÷(mr+n)/r=(ac+b)/c*r/(mr+n)=(acr+br)/(cmr+cn)`. A complex fraction may also be reduced to a simple one, by multiplying both terms by the least common multiple of the denominators of the fractional parts of each term. Thus, to reduce four and a third over five and a half, multiply both terms by 6; the result is `26/33`.
art: 144 | Infinite Series | An Infinite Series is an unlimited succession of terms, which observe the same law. The Law of a Series is a relation existing between its terms, such that when some of them are known the others may be found. Thus, in the infinite series `1-ax+a^2x^2-a^3x^3+a^4x^4`, etc., any term may be found by multiplying the preceding term by `-ax`. Any proper algebraic fraction whose denominator is a polynomial can, by division, be resolved into an infinite series; for the process of division never can terminate. After a few of the terms of the quotient are found, the law of the series will, in general, be easily discovered.
art: 144 | Example | Convert the fraction `1/(1-x)` into an infinite series. 1 divided by `1-x` gives 1, with the remainder `+x`; `+x` divided by `1-x` gives `+x`, with the remainder `+x^2`; and so on. The law of this series evidently is, that each term is equal to the preceding term multiplied by `+x`. The fraction `1/(1-x)` is equal to the infinite series, `1+x+x^2+x^3+x^4+`, etc.
mc: A complex fraction is reduced to a simple one by treating it as a case of... | *division | addition | subtraction
mc: Two and a third over three and a half is... | *`2/3` | `3/2` | `7/6`
mc: An unlimited succession of terms which observe the same law is... | *an infinite series | a polynomial | a complex fraction
mc: In the series `1-ax+a^2x^2-a^3x^3`, each term is the one before it multiplied by... | *`-ax` | `ax` | `-a`
mc: In `1/(1-x)=1+x+x^2+x^3+...`, each term is the one before it multiplied by... | *`x` | `-x` | 2
tf: The division of 1 by `1-x` never terminates. {T}
q: Reduce two and a third over three and a half to a simple fraction. {=2/3}
q: Reduce `(a+b/c)/(m+n/r)` to a simple fraction. {$ (acr+br)/(cmr+cn) @ (a+b/c)/(m+n/r)}
q: Reduce `(a/b)/(c/d)` to a simple fraction. {$ ad/(bc) @ (a/b)/(c/d)}
q: Reduce three and a half over `a/3` to a simple fraction. {$ 21/(2a) @ (7/2)/(a/3)}
q: Reduce `(a+1/c)/m` to a simple fraction. {$ (ac+1)/(cm) @ (a+1/c)/m}
q: Reduce `m/(a+1/c)` to a simple fraction. {$ cm/(ac+1) @ m/(a+1/c)}
q: Reduce four and a third over five and a half to a simple fraction. {=26/33}
q: Convert `1/(1-x)` into an infinite series. Write the first four terms. {$ 1+x+x^2+x^3}
q: Resolve `1/(1+x)` into an infinite series by division. Write the first four terms. {$ 1-x+x^2-x^3}
q: Resolve `ax/(a-x)` into an infinite series by division. Write the first four terms. {$ x+x^2/a+x^3/a^2+x^4/a^3}
q: Resolve `(1-x)/(1+x)` into an infinite series by division. Write the first four terms. {$ 1-2x+2x^2-2x^3}
q: Resolve `(x+2)/(x+1)` into an infinite series by division. Write the first four terms. {$ 1+1/x-1/x^2+1/x^3}
== 22 | Simple Equations | Equations, transposition, fractions
art: 145 | Equation | The most useful part of Algebra is that which relates to the solution of problems. This is performed by means of equations. An Equation is an algebraic expression, stating the equality between two quantities; thus, `x-3=4`, is an equation, stating that if 3 be subtracted from `x`, the remainder will equal 4.
art: 146 | Members | Every equation is composed of two parts, separated from each other by the sign of equality. The First Member of an equation is the quantity on the left of the sign of equality. The Second Member is the quantity on the right of the sign of equality. Each member is composed of one or more terms.
art: 147 | | There are generally two classes of quantities in an equation, the known and the unknown. The known quantities are represented either by numbers or the first letters of the alphabet, as `a`, `b`, `c`, etc.; the unknown quantities, by the last letters of the alphabet, as `x`, `y`, `z`, etc.
art: 148 | Degree | Equations are divided into degrees, called first, second, third, etc. The degree of an equation depends upon the highest power of the unknown quantity which it contains. A Simple Equation, or an equation of the first degree, is one which contains no power of the unknown quantity higher than the first. Thus, `2x+5=9`, and `ax+b=c`, are simple equations. A Quadratic Equation, or an equation of the second degree, is one in which the highest power of the unknown quantity is a square. Thus, `4x^2-7=29`, and `ax^2+bx=c`, are quadratic equations. When any equation contains more than one unknown quantity, its degree is equal to the greatest sum of the exponents of the unknown quantities in any of its terms. Thus, `xy+ax+by=c` is of the second degree; `x^2y+x^2+cx=a`, of the third degree.
art: 149 | | An Identical Equation is one in which the two members are identical; as, `5=5`, or `2x-1=2x-1`. A Numerical Equation is one in which all the known quantities are expressed by numbers; as, `x^2+2x=3x+7`. A Literal Equation is one in which the known quantities are represented by letters, or by letters and numbers; as, `ax-b=cx+d`, and `ax^2+bx=2x-5`.
art: 150 | | Every equation is to be regarded as the statement, in algebraic language, of a particular question. Thus, `x-3=4`, may be regarded as the statement of the question: to find a number, from which, if 3 be subtracted, the remainder will be equal to 4. Adding 3 to each member, we have `x-3+3=4+3`, or `x=7`. An equation is said to be verified, when the value of the unknown quantity being substituted for it, the two members are rendered equal: `7-3=4`, or `4=4`. To solve an equation is to find the value of the unknown quantity.
art: 151 | Root | The Root of an equation is the value of its unknown quantity.
art: 152 | Axioms | All rules for finding the value of the unknown quantity are founded on this principle: if we perform exactly the same operation on two equal quantities, the results will be equal. 1. If, to two equal quantities, the same quantity be added, the sums will be equal. 2. If, from two equal quantities, the same quantity be subtracted, the remainders will be equal. 3. If two equal quantities be multiplied by the same quantity, the products will be equal. 4. If two equal quantities be divided by the same quantity, the quotients will be equal. 5. If two equal quantities be raised to the same power, the results will be equal. 6. If the same root of two equal quantities be extracted, the results will be equal. An axiom is a self-evident truth.
art: 153 | Transposition | Suppose we have the equation `x-3=5`. If we add 3 to each member, we have `x-3+3=5+3`. But `-3+3=0`; omitting these, we have `x=5+3`. The result is the same as if we had transposed the term `-3` to the opposite member, and changed its sign. Again, take `x+b=c`. Subtracting `b` from each side, `x=c-b`; the same as if we had transposed `+b`, changing its sign. Hence, any quantity may be transposed from one side of an equation to the other, if, at the same time, its sign be changed.
art: 154 | Clearing of Fractions | Clear `x/2+x/3=5` of fractions. Multiplying both sides by 2, we have `x+2x/3=10`; multiplying both sides by 3, we have `3x+2x=30`. We might have multiplied at once by `2*3`. So, `x/(ab)+x/(bc)=d`, multiplied by the L.C.M. of the denominators, which is `abc`, gives `cx+ax=abcd`. Rule: find the least common multiple of all the denominators, and multiply each term of the equation by it.
mc: The quantity on the left of the sign of equality is the... | *first member | second member | root
mc: The degree of an equation depends on... | *the highest power of the unknown quantity | the number of terms | the largest number
mc: `2x+5=9` is... | *a simple equation | a quadratic equation | an identical equation
mc: `4x^2-7=29` is... | *a quadratic equation | a simple equation | an identical equation
mc: `xy+ax+by=c` is an equation of the... | *second degree | first degree | third degree
mc: The value of the unknown quantity of an equation is called its... | *root | member | coefficient
mc: Substituting the value found to see that both members are equal is called... | *verification | transposition | reduction
mc: A term moved to the other side of an equation must... | *have its sign changed | keep its sign | be doubled
mc: To clear an equation of fractions, multiply each term by... | *the L.C.M. of the denominators | the largest denominator | the numerators
tf: An axiom is a self-evident truth. {T}
tf: `5=5` is an identical equation. {T}
q: In `x-3=4`, what is `x`? {7 @x: x-3=4}
q: In `x+b=c`, what is `x`? {$ c-b @x: x+b=c}
q: Clear `x/2+x/3=5` of fractions. Multiply each term by {6} Then `5x=30`, and `x` = {6 @x: x/2+x/3=5}
q: Clear `x/3-x/4=2` of fractions. Multiply each term by {12} Then `x` = {24 @x: x/3-x/4=2}
q: Clear `x/4+x/8-x/6=5/12` of fractions. Multiply each term by {24} Then `x` = {2 @x: x/4+x/8-x/6=5/12}
q: Clear `(2x-3)/4+x/7=(x-3)/2+5/14` of fractions. Multiply each term by {28} Then `x` = {$ -11/4 @x: (2x-3)/4+x/7=(x-3)/2+5/14}
q: Clear `x-(x-3)/2=5-(x+4)/3` of fractions. Multiply each term by {6} Then `x` = {13/5 @x: x-(x-3)/2=5-(x+4)/3}
q: Clear `x/a+(x-5)/2=b` of fractions. Multiply each term by {$ 2a}
q: Clear `4/(x-3)+2a/3=3/4` of fractions. Multiply each term by {$ 12(x-3) | 12x-36}
q: Clear `(x+1)/(x-3)+(3-c)/(a-b)=a` of fractions. Multiply each term by {$ (x-3)(a-b) | ~(x-3)(a-b)}
q: Clear `x/(a+b)+x/(a-b)=c/(a^2-b^2)` of fractions. Multiply each term by {$ a^2-b^2 | (a+b)(a-b)}
q: Clear `a/(bx)+c/(dx)+e/(fx)=h` of fractions. Multiply each term by {$ bdfx}
== 23 | Simple Equations | Solving simple equations
art: 155 | | The unknown quantity in an equation may be combined with the known quantities, by addition, subtraction, multiplication, or division; or, in two or more of these methods. In `x+3=5`, by subtracting 3 from each side, `x=5-3=2`. In `x-3=5`, by adding 3 to each side, `x=5+3=8`. In `3x=15`, by dividing each side by 3, `x=15/3=5`. In `x/3=2`, by multiplying each side by 3, `x=2*3=6`. When the unknown quantity is connected by addition, it is to be separated by subtraction; when connected by subtraction, by addition; when connected by multiplication, by division; when connected by division, by multiplication.
art: 155 | Examples | Find `x` in `3x-3=x+5`. Transposing, `3x-x=5+3`; reducing, `2x=8`; dividing by 2, `x=4`. Verification: `3*4-3=4+5`, or `9=9`. Find `x` in `x-(x-2)/3=4+(x+2)/5`. Multiplying by 15, `15x-(5x-10)=60+3x+6`; or `15x-5x+10=60+3x+6`; transposing, `15x-5x-3x=60+6-10`; reducing, `7x=56`; `x=8`. Find `x` in `x/b-d=x/a+c`. Multiplying by `ab`, `ax-abd=bx+abc`; transposing, `ax-bx=abc+abd`; separating into factors, `(a-b)x=ab(c+d)`; dividing by `a-b`, `x=ab(c+d)/(a-b)`.
art: 155 | Rule | For the solution of simple equations: 1. If necessary, clear the equation of fractions. 2. Transpose all the terms containing the unknown quantity to one side, and the known quantities to the other. 3. Combine the terms in each member by the rule for addition. 4. Divide both members by the coefficient of the unknown quantity. Verify the value of the unknown quantity in each example.
mc: When the unknown quantity is connected by addition, it is separated by... | *subtraction | addition | multiplication
mc: When the unknown quantity is connected by division, it is separated by... | *multiplication | division | subtraction
mc: The last step in solving `2x=8` is to... | *divide both members by 2 | add 2 | multiply by 2
tf: In `3x-3=x+5`, `x=4`. {T}
q: Find `x` in `x+3=5`. {2 @x: x+3=5}
q: Find `x` in `x-3=5`. {8 @x: x-3=5}
q: Find `x` in `3x=15`. {5 @x: 3x=15}
q: Find `x` in `x/3=2`. {6 @x: x/3=2}
q: Find `x` in `3x-3=x+5`. {4 @x: 3x-3=x+5}
q: Find `x` in `x-(x-2)/3=4+(x+2)/5`. {8 @x: x-(x-2)/3=4+(x+2)/5}
q: Find `x` in `x/b-d=x/a+c`. {$ ab(c+d)/(a-b) | (abc+abd)/(a-b) @x: x/b-d=x/a+c}
q: Find `x` in `3x-5=2x+7`. {12 @x: 3x-5=2x+7}
q: Find `x` in `3x-8=16-5x`. {3 @x: 3x-8=16-5x}
q: Find `x` in `3x-25=-x-9`. {4 @x: 3x-25=-x-9}
q: Find `x` in `15-2x=6x-25`. {5 @x: 15-2x=6x-25}
q: Find `x` in `5(x+1)+6(x+2)=9(x+3)`. {5 @x: 5(x+1)+6(x+2)=9(x+3)}
q: Find `x` in `10(x+5)+8(x+4)=5(x+13)+121`. {8 @x: 10(x+5)+8(x+4)=5(x+13)+121}
q: Find `x` in `x/2-2=5-x/5`. {10 @x: x/2-2=5-x/5}
q: Find `x` in `x/2+x/3-x/4=14`. {24 @x: x/2+x/3-x/4=14}
q: Find `x` in `3x/4+2x/3-x/6=5/2`. {2 @x: 3x/4+2x/3-x/6=5/2}
q: Find `x` in `(x-2)/4-2=1-(x+7)/3`. {2 @x: (x-2)/4-2=1-(x+7)/3}
q: Find `x` in `(3x+1)/2-2x/3=10+(x-1)/6`. {14 @x: (3x+1)/2-2x/3=10+(x-1)/6}
q: Find `x` in `(3x-2)/4-(4-x)/2=2x-(7x-2)/3`. {2 @x: (3x-2)/4-(4-x)/2=2x-(7x-2)/3}
q: Find `x` in `4x/5-5x/4+18=(4x+1)/9`. {20 @x: 4x/5-5x/4+18=(4x+1)/9}
q: Find `x` in `5x/(x+4)=1`. {1 @x: 5x/(x+4)=1}
q: Find `x` in `2x-(x-2)/10=x+(x+18)/15`. {6/5 @x: 2x-(x-2)/10=x+(x+18)/15}
q: Find `x` in `3/4-(x-2)/3=5/4-(x+3)/4`. {11 @x: 3/4-(x-2)/3=5/4-(x+3)/4}
q: Find `x` in `2x-(2x+11)/5-(4x-6)/11=-(7-8x)/7`. {7 @x: 2x-(2x+11)/5-(4x-6)/11=-(7-8x)/7}
q: Find `x` in `(x+7)/3-23/4=(2x+5)/7+(10-5x)/8`. {8 @x: (x+7)/3-23/4=(2x+5)/7+(10-5x)/8}
q: Find `x` in `x/8+2(x-1)/5=(7x-4)/15-(x-1)/60`. {2 @x: x/8+2(x-1)/5=(7x-4)/15-(x-1)/60}
q: Find `x` in `4x-b=2x-d`. {$ (b-d)/2 @x: 4x-b=2x-d}
q: Find `x` in `ax+b=cx+d`. {$ (d-b)/(a-c) @x: ax+b=cx+d}
q: Find `x` in `ax-bx=c+dx-e`. {$ (c-e)/(a-b-d) @x: ax-bx=c+dx-e}
q: Find `x` in `7+9a-5x=6x+5ax`. {$ (7+9a)/(11+5a) @x: 7+9a-5x=6x+5ax}
q: Find `x` in `(a+b)(b-x)+(a-b)(a+x)=c^2`. {$ (a^2+b^2-c^2)/(2b) @x: (a+b)(b-x)+(a-b)(a+x)=c^2}
q: Find `x` in `x/a+x/b=c`. {$ abc/(a+b) @x: x/a+x/b=c}
q: Find `x` in `a/x+b/x+c/x=1`. {$ a+b+c @x: a/x+b/x+c/x=1}
q: Find `x` in `x/a+x/b+x/c=d`. {$ abcd/(ab+ac+bc) @x: x/a+x/b+x/c=d}
q: Find `x` in `ab/x+ac/x+bc/x=2`. {$ (ab+ac+bc)/2 @x: ab/x+ac/x+bc/x=2}
q: Find `x` in `a/x+b/c-d/e=0`. {$ ace/(cd-be) @x: a/x+b/c-d/e=0}
q: Find `x` in `(1+x)/(1-x)=1+1/a`. {$ 1/(2a+1) @x: (1+x)/(1-x)=1+1/a}
== 24 | Simple Equations | Problems with one unknown quantity
art: 156 | | The solution of a problem, by Algebra, consists of two distinct parts: 1. Expressing the conditions of the problem in algebraic language; that is, forming the equation. 2. Solving the equation, or finding the value of the unknown quantity. The first is the most difficult part of the operation. Sometimes, the statement of the question furnishes the equation directly; and, sometimes, it is necessary, from the conditions given, to deduce others from which to form the equation. In the one case, the conditions are called explicit conditions; in the other, implied conditions.
art: 156 | Rule | It is impossible to give a precise rule for forming an equation. The first point is to understand fully the nature of the question or problem. After this, the equation may generally be formed thus: denote the required quantity by one of the final letters of the alphabet; then, by means of signs, indicate the same operations that it would be necessary to make on the answer to verify it. All the quantities in both members of an equation must be of the same denomination.
art: 156 | Ratio | When two or more unknown quantities in any problem are to each other in a given ratio, assume each of them a multiple of an unknown quantity, so that they shall have to each other the given ratio. Thus, to divide 55 into two parts, in proportion as 2 to 3, let `2x` be one part and `3x` the other; then `2x+3x=55`, `x=11`, and the parts are 22 and 33.
mc: The most difficult part of solving a problem by Algebra is... | *forming the equation | solving the equation | verifying the answer
mc: Conditions that must be deduced from the question are called... | *implied conditions | explicit conditions | axioms
mc: To divide a number into parts as 2 to 3, call the parts... | *`2x` and `3x` | `x` and `x+1` | `2` and `3`
tf: All the quantities in both members of an equation must be of the same denomination. {T}
q: There are two numbers, the second of which is three times the first, and their sum is 48; what are the numbers? The first is {12 @x: x+3x=48} the second {36}
sol: Let x = the first number. Then 3x = the second, and x + 3x = 48. Reducing, 4x = 48, and x = 12; 3x = 36. Proof: 12 + 36 = 48.
q: A father said to his son, "The difference of our ages is 48 years, and I am 5 times as old as you." What is the son's age? {12 @x: 5x-x=48} The father's? {60}
sol: Let x = the son's age; 5x = the father's. Then 5x - x = 48; 4x = 48; x = 12, and 5x = 60.
q: What number is that, to which if its third part be added, the sum will be 16? {12 @x: x+x/3=16}
sol: x + x/3 = 16. Multiplying by 3, 3x + x = 48; 4x = 48; x = 12. Verification: 12 + 4 = 16.
q: What number is that, which being increased by its half, and then diminished by its two thirds, the remainder will be 105? {126 @x: x+x/2-2x/3=105}
sol: x + x/2 - 2x/3 = 105. Multiplying by 6, 6x + 3x - 4x = 630; 5x = 630; x = 126.
q: It is required to divide a line 25 inches long, into two parts, so that the greater shall be 3 inches longer than the less. The less is {11 @x: x+x+3=25} the greater {14}
sol: Let x = the smaller part; x + 3 = the greater. x + x + 3 = 25; 2x = 22; x = 11, and x + 3 = 14.
q: Divide $68 between A, B, and C, so that B shall have $5 more than A, and C $7 more than B. A's share {17 @x: x+(x+5)+(x+12)=68} B's {22} C's {29}
sol: Let x = A's share; x + 5 = B's; x + 12 = C's. 3x + 17 = 68; 3x = 51; x = 17.
q: What number is that, which being added to its third part, the sum will be equal to its half added to 10? {12 @x: x+x/3=x/2+10}
sol: x + x/3 = x/2 + 10. Multiplying by 6, 6x + 2x = 3x + 60; 5x = 60; x = 12.
q: A cistern was found to be one third full of water, and, after emptying into it 17 barrels more, it was found to be half full; how many barrels will it contain when full? {102 @x: x/3+17=x/2}
sol: x/3 + 17 = x/2; 2x + 102 = 3x; x = 102. The signs of all the terms of both members of an equation may be changed at pleasure, since this would be the result of multiplying by -1.
q: A cistern is supplied by two pipes; the less alone can fill it in 40 minutes, and the greater in 30 minutes; in what time will they fill it, both running at once? (minutes) {17 1/7 @x: 1/40+1/30=1/x}
sol: In 1 min. the less fills 1/40 of it, the greater 1/30, and both 1/x. So 1/40 + 1/30 = 1/x. Multiplying by 120x, 3x + 4x = 120; 7x = 120; x = 17 1/7 min.
q: A can perform a piece of work in 5 days, B in 6 days, and C in 8 days; in what time can the three perform it? (days) {2 2/59 @x: 1/5+1/6+1/8=1/x}
sol: 1/5 + 1/6 + 1/8 = 1/x. Or, 24x + 20x + 15x = 120; 59x = 120; x = 2 2/59 days.
q: How many pounds of sugar at 5 cents and at 9 cents per pound, must be mixed, to make a box of 100 pounds, at 6 cents per pound? At 5 cents {75 @x: 5x+9(100-x)=600} at 9 cents {25}
sol: Let x = the pounds at 5 cents; 100 - x at 9 cents. 5x + 9(100 - x) = 600; 5x + 900 - 9x = 600; -4x = -300; x = 75.
q: A laborer was engaged for 30 days. For each day he worked, he received 25 cents and his board; and, for each day he was idle, he paid 20 cents for his board. At the expiration of the time, he received $3; how many days did he work? {20 @x: 25x-20(30-x)=300} How many was he idle? {10}
sol: Let x = the days he worked; 30 - x the days idle. 25x - 20(30 - x) = 300 (the $3 in cents); 45x = 900; x = 20.
q: A hare is 50 leaps before a greyhound, and takes 4 leaps to the greyhound's 3; but 2 of the greyhound's leaps are equal to 3 of the hare's; how many leaps must the greyhound take to catch the hare? {300 @x: 3x/2=4x/3+50}
sol: Let x = the hound's leaps. The hare takes 4x/3 leaps meanwhile, and x hound leaps = 3x/2 hare leaps. So 3x/2 = 4x/3 + 50; 9x = 8x + 300; x = 300.
q: The hour and minute hands of a watch are exactly together between 8 and 9 o'clock; how many minutes after 8 o'clock? {43 7/11 @x: x=40+x/12}
sol: Let x = the minutes from VIII to the point where they meet; the minute hand moves 40 + x while the hour hand moves x, and it moves 12 times as fast: 12x = 40 + x; 11x = 40; x = 3 7/11 min. The time is 43 min. 38 2/11 sec. after 8 o'clock.
q: A person spent one fourth of his money, and then received $5. He next spent one half of what he then had, and found that he had only $7 remaining; what sum had he at first? {12 @x: (3x/4+5)/2=7}
sol: After spending x/4 and receiving 5 he had 3x/4 + 5; half of that is left: 3x/8 + 5/2 = 7; 3x + 20 = 56; x = 12.
q: Divide 42 cents between A and B, giving to B twice as many as to A. A {14 @x: x+2x=42} B {28}
q: Divide 48 into three parts, so that the second may be twice, and the third three times the first. {8 @x: x+2x+3x=48} {16} {24}
q: Divide 60 into 3 parts, so that the second may be 3 times the first, and the third double the second. {6 @x: x+3x+6x=60} {18} {36}
q: A boy bought an equal number of apples, lemons, and oranges for 56 cents; for the apples he gave 1 cent, for the lemons 2 cents, and for the oranges 5 cents apiece; how many of each did he purchase? {7 @x: x+2x+5x=56}
q: Bought 5 apples and 3 lemons for 22 cents; gave as much for 1 lemon as for 2 apples; what did I give for an apple? {2 @x: 5x+6x=22} For a lemon? {4}
q: A's age is double that of B; the age of B is twice that of C; the sum of their ages is 98 years; what is the age of A? {56} B? {28} C? {14 @x: x+2x+4x=98}
q: A, B, C, and D have among them, 44 cents; A has a certain number, B three times as many as A, C as many as A and one third as many as B, and D as many as B and C; how many has A? {4 @x: x+3x+2x+5x=44} B? {12} C? {8} D? {20}
q: Divide 55 into two parts, in proportion to each other as 2 to 3. {22 @x: x+3x/2=55} {33}
q: The sum of two numbers is 60, and the less is to the greater as 5 to 7; what are the numbers? {25 @x: x+7x/5=60} {35}
q: Divide 60 into 3 parts, which shall be in proportion to each other as 2, 3, and 5. {12} {18} {30}
q: Divide 60 into 3 such parts, that one half of the first, one third of the second, and one fifth of the third shall be equal. {12} {18} {30}
sol: Let 2x, 3x, and 5x represent the parts. 10x = 60; x = 6.
q: What number is that whose half, third, and fourth parts are together equal to 65? {60 @x: x/2+x/3+x/4=65}
q: What number is that, one fifth of which is greater than one seventh by 4? {70 @x: x/5-x/7=4}
q: The age of B is 2 4/5 times that of A, and the sum of their ages is 76 years; what is the age of A? {20 @x: x+14x/5=76} B? {56}
q: Divide $440 between A, B, and C, so that the share of A may be three fifths that of B, and the share of B three fourths that of C. A {90} B {150} C {200 @x: 9x/20+3x/4+x=440}
q: Four towns are situated in the order of the letters A, B, C, D. From A to D is 120 miles; from A to B is to the distance from B to C as 3 to 5; and one third of the distance from A to B, added to the distance from B to C, is three times the distance from C to D; how far is it from A to B? {36} B to C? {60} C to D? {24}
q: A merchant having engaged in trade with a certain capital, lost one third of it the 1st year; the 2d year he gained a sum equal to two fifths of what remained at the close of the 1st year; the 3d year he lost one seventh of what he had at the close of the 2d year, when he was worth $1236. What was his original capital? {1545 @x: 2x/3*7/5*6/7=1236}
q: The rent of a house this year is greater by 5% than it was last year; this year the rent is $168: what was it last year? {160 @x: x*105/100=168}
q: Divide the number 32 into 2 parts, so that the greater shall exceed the less by 6. {13 @x: x+x+6=32} {19}
q: At an election, the number of votes given for two candidates was 256; the successful candidate had a majority of 50 votes; how many votes had each? {153} {103 @x: x+x+50=256}
q: Divide $1520 among A, B, and C, so that B may receive $100 more than A, and C $270 more than B; what is the share of each? A {350 @x: x+(x+100)+(x+370)=1520} B {450} C {720}
q: A company of 90 persons consists of men, women, and children; the men are 4 more than the women, and the children 10 more than both men and women; how many men? {22} women? {18 @x: x+(x+4)+(2x+14)=90} children? {50}
q: After cutting off a certain quantity of cloth from a piece of 45 yards, there remained 9 yards less than had been cut off; how many yards had been cut off? {27 @x: x+(x-9)=45}
q: What number is that, which being multiplied by 7, gives a product as much greater than 20 as the number itself is less than 20? {5 @x: 7x-20=20-x}
== 25 | Simple Equations | More problems with one unknown
note: Let x stand for the quantity asked for, write the equation, then solve it.
q: A person dying left an estate of $6500, to be divided among his widow, 2 sons, and 3 daughters, so that each son shall receive twice as much as a daughter, and the widow $500 less than all her children together; required the share of the widow {3000} of each son {1000} and of each daughter {500 @x: 7x+7x-500=6500}
q: Two men set out at the same time, one from London, the other from Edinburgh; one goes 20, the other 30 miles a day; in how many days will they meet, the distance being 400 miles? {8 @x: 20x+30x=400}
q: A and B depart from the same place, to go in the same direction; B travels at the rate of 3, and A at the rate of 5 miles an hour, but B has 10 hours the start of A; in how many hours will A overtake B? {15 @x: 5x=3(x+10)}
q: Being asked the time of day, I replied, "If, to the time past noon, there be added its half, third, and two thirds, the sum will equal one sixth of the time to midnight." How many minutes past noon was it? {45 @x: x+x/2+x/3+2x/3=(720-x)/6}
q: Divide 120 into two such parts that the less may be contained in the greater one and a half times. The less {48 @x: x+3x/2=120} the greater {72}
q: If I multiply a certain number by 7, add 3 to the product, divide this by 2, and subtract 4 from the quotient, the remainder is 15. What is the number? {5 @x: (7x+3)/2-4=15}
q: What number is that, which, if you multiply it by 5, subtract 24 from the product, divide the remainder by 6, and add 13 to the quotient, will give the number itself? {54 @x: (5x-24)/6+13=x}
q: A and B engaged in trade, the capital of B being two thirds that of A; B gained, and A lost, $100; after which, if five sevenths of what A had left be subtracted from what B has, the remainder will be $134; what capital had A at first? {786 @x: 2x/3+100-5(x-100)/7=134} B? {524}
q: A man having spent $3 more than two thirds of his money, had $7 more than one fifth of it left; how much had he at first? {75 @x: x-(2x/3+3)=x/5+7}
q: A and B have the same annual income; A saves one fifth of his, but B spends $25 per annum more than A, and at the end of 5 years finds he has saved $200; what is the income of each? {325 @x: 5(x/5-25)=200}
q: In a quantity of gunpowder, two thirds of the whole, plus 10 lb., was niter; two twenty-thirds of the whole, plus 1 lb., was sulphur; and one third of the whole, minus 17 lb., was charcoal; how many lb. of gunpowder were there? {69 @x: 2x/3+10+2x/23+1+x/3-17=x}
q: Bought a chaise, horse, and harness for $245; the horse cost 3 times as much as the harness, and the chaise $19 less than 2 2/3 times as much as both horse and harness; what was the cost of the chaise {173} the horse {54} the harness {18 @x: x+3x+(8/3)*4x-19=245}
q: What two numbers are as 3 to 4, to each of which, if 4 be added, the sums will be as 5 to 6? {6 @x: 6(x+4)=5(4x/3+4)} {8}
q: The ages of two brothers are now 25 and 30 years, or as 5 to 6; in how many years will they be as 8 to 9? {15 @x: 9(25+x)=8(30+x)}
q: A cistern has 3 pipes; by the 1st it can be filled in 1 1/3 hours, by the 2d in 3 1/3 hours, and by the 3d in 5 hours; in what time can it be filled by all running at once? (hours) {4/5 @x: 3/4+3/10+1/5=1/x}
q: Find the time in which A, B, and C together can perform a piece of work, which requires 7, 6, and 9 days respectively, when done singly. (days) {2 20/53 @x: 1/7+1/6+1/9=1/x}
q: From a certain sum I took one third part, and put in its stead $50; from this sum I took the tenth part, and put in its stead $37; I then found I had $100; what was the original sum? {30 @x: (2x/3+50)*9/10+37=100}
q: A spent two fifths of his salary for board, one third of the remainder for clothes, one third of the rest for books, and still saved $120 per annum; what was his salary? {450 @x: x*3/5*2/3*2/3=120}
q: A was engaged for a year at $80 and a suit of clothes; he served 7 months, and received for his wages the clothes and $35; what was the value of the clothes? {28 @x: 7(80+x)/12=x+35}
q: A man and his wife can drink a keg of wine in 6 days, and the man alone in 10 days; how many days will it last the woman? {15 @x: 1/6-1/10=1/x}
q: A steamboat that can run 15 miles per hour with the current, and 10 miles per hour against it, requires 25 hours to go from Cincinnati to Louisville, and return; what is the distance between these cities, in miles? {150 @x: x/15+x/10=25}
q: In a mixture of wine and water, one half the whole, plus 25 gallons, was wine, and one third of the whole, minus 5 gallons, was water; how many gallons of wine? {85 @x: 120/2+25=x} of water? {35}
sol: x/2 + 25 + x/3 - 5 = x; x/6 = 20; x = 120 gallons in all.
q: Required to divide 72 into 4 such parts, that if the 1st be increased by 2, the 2d diminished by 2, the 3d multiplied by 2, and the 4th divided by 2, the sum, difference, product, and quotient shall be equal. {14} {18} {8} {32}
sol: Let the four parts be x - 2, x + 2, x/2, and 2x. Their sum, 4 1/2 x = 72, so x = 16.
q: A merchant having cut 19 yards from each of 3 equal pieces of silk, and 17 from another of the same length, found that the remnants taken together measured 142 yards; what was the length of each piece? {54 @x: 4x-3*19-17=142}
q: For every 10 sheep I keep, I plow an acre of land, and allow 1 acre of pasture for every 4 sheep; how many sheep can I keep on 161 acres? {460 @x: x/10+x/4=161}
q: It is required to divide 34 into 2 such parts, that if 18 be subtracted from the greater, and the less be subtracted from 18, the first remainder shall be to the second as 2 to 3. The greater {22 @x: 3(x-18)=2(18-(34-x))} the less {12}
q: A person was desirous of giving 3 cents apiece to some beggars, but found that he had not money enough by 8 cents; he therefore gave each of them 2 cents and then had 3 cents left; required the number of beggars. {11 @x: 3x-8=2x+3}
q: A could reap a field in 20 days, but if B assisted him for 6 days, he could reap it in 16 days; in how many days could B reap it alone? {30 @x: 16/20+6/x=1}
q: When the price of a bushel of barley wanted but 3 cents to be to the price of a bushel of oats as 8 to 5, nine bushels of oats were received as an equivalent for 4 bushels of barley and 90 cents in money; what was the price of a bushel of oats, in cents? {30 @x: 9x=4(8x/5-3)+90} of barley? {45}
q: Four places are situated in the order of the 4 letters, A, B, C, and D; the distance from A to D is 34 miles; the distance from A to B is to the distance from C to D as 2 to 3; and one fourth the distance from A to B, added to one half the distance from C to D, is 3 times the distance from B to C. Required the distances: A to B {12} B to C {4} C to D {18 @x: 2x/3+(x/6+x/2)/3+x=34}
q: The ingredients of a loaf of bread are rice, flour, and water, and the whole weighs 15 lb.; the weight of the rice, plus 5 lb., is two thirds that of the flour; and the weight of the water is one fifth the weight of the flour and rice together; what is the weight of the rice {2} the flour {10 1/2 @x: 6(x+2x/3-5)/5=15} and the water {2 1/2}
== 26 | Simple Equations | Two unknown quantities
art: 157 | Elimination | To find the value of any unknown quantity, we must obtain a single equation containing it, and known terms. Hence, when we have two or more equations containing two or more unknown quantities, we must obtain from them a single equation containing only one unknown quantity. Elimination is the process of deducing from two or more equations containing two or more unknown quantities, a less number of equations containing one less unknown quantity. There are three methods of elimination: 1st, by substitution; 2d, by comparison; 3d, by addition and subtraction.
art: 158 | By Substitution | Elimination by substitution consists in finding the value of one of the unknown quantities in one of the equations, in terms of the other unknown quantity and known terms, and substituting this, instead of the quantity, in the other equation. Take `x+2y=17` and `2x+3y=28`. Transposing `2y` in the first, `x=17-2y`. Substituting this in the second, `2(17-2y)+3y=28`; or `34-4y+3y=28`; or `-y=28-34`; `y=6`; and `x=17-12=5`. Rule: find an expression for the value of one of the unknown quantities in either equation; substitute this value in place of the same unknown quantity in the other equation. Take the value which is least involved.
art: 159 | By Comparison | Elimination by comparison consists in finding the value of the same unknown quantity in two different equations, and then placing these values equal to each other. From `x+2y=17`, `x=17-2y`. From `2x+3y=28`, `x=(28-3y)/2`. Therefore, `(28-3y)/2=17-2y`; or, `28-3y=34-4y`; `y=6`. Then `x=5`.
art: 160 | By Addition and Subtraction | Elimination by addition and subtraction consists in multiplying or dividing two equations, so as to render the coefficient of one of the unknown quantities the same in both; and then, by adding or subtracting, to cause the term containing it to disappear. Multiplying `x+2y=17` by 2, `2x+4y=34`; subtracting `2x+3y=28`, `y=6`. When the terms to be eliminated have contrary signs, it is necessary to add: from `3x-5y=6` and `4x+3y=37`, multiplying by 3 and 5, `9x-15y=18` and `20x+15y=185`; adding, `29x=203`, `x=7`; then `y=3`. After making the coefficients the same, if the signs are alike, we subtract; if unlike, we add. When the coefficients are prime to each other, they may be equalized by multiplying each equation by the coefficient in the other. Fractional coefficients ought to be cleared first.
mc: Deducing from two equations with two unknowns one equation with one unknown is called... | *elimination | transposition | verification
mc: How many methods of elimination are there? | *three | two | four
mc: Finding `x` from one equation and putting its value into the other is elimination by... | *substitution | comparison | addition and subtraction
mc: Finding `x` from both equations and setting the values equal is elimination by... | *comparison | substitution | addition and subtraction
mc: After making the coefficients equal, if the signs of those terms are unlike, we... | *add | subtract | multiply
tf: In elimination by substitution, take the value which is least involved. {T}
q: Find `x` and `y`: `x+2y=17` and `2x+3y=28`. x = {5} y = {6}
chk: x=5, y=6 | x+2y=17 | 2x+3y=28
q: Find `x` and `y`: `3x-5y=6` and `4x+3y=37`. x = {7} y = {3}
chk: x=7, y=3 | 3x-5y=6 | 4x+3y=37
q: By substitution: `x+5y=38` and `3x+4y=37`. x = {3} y = {7}
chk: x=3, y=7 | x+5y=38 | 3x+4y=37
q: By substitution: `2x+4y=22` and `5x+7y=46`. x = {5} y = {3}
chk: x=5, y=3 | 2x+4y=22 | 5x+7y=46
q: By substitution: `3x+5y=57` and `5x+3y=47`. x = {4} y = {9}
chk: x=4, y=9 | 3x+5y=57 | 5x+3y=47
q: By substitution: `4x-3y=26` and `3x-4y=16`. x = {8} y = {2}
chk: x=8, y=2 | 4x-3y=26 | 3x-4y=16
q: By substitution: `y/5-x/4=1` and `5x-3y=10`. x = {20} y = {30}
chk: x=20, y=30 | y/5-x/4=1 | 5x-3y=10
q: By substitution: `2x/7-3y/8=0` and `2x/3+3y/4=26`. x = {21} y = {16}
chk: x=21, y=16 | 2x/7-3y/8=0 | 2x/3+3y/4=26
q: By comparison: `x+3y=16` and `x+5y=22`. x = {7} y = {3}
chk: x=7, y=3 | x+3y=16 | x+5y=22
q: By comparison: `5x-2y=4` and `2x-y=1`. x = {2} y = {3}
chk: x=2, y=3 | 5x-2y=4 | 2x-y=1
q: By comparison: `x/9-y/8=1` and `x/6+y/4=12`. x = {36} y = {24}
chk: x=36, y=24 | x/9-y/8=1 | x/6+y/4=12
q: By comparison: `x/4-y/4=1` and `x/3+y/2=8`. x = {12} y = {8}
chk: x=12, y=8 | x/4-y/4=1 | x/3+y/2=8
q: By comparison: `x/5+y/2=14` and `x/9-y/5=3`. x = {45} y = {10}
chk: x=45, y=10 | x/5+y/2=14 | x/9-y/5=3
q: By comparison: `3x/2+2y-x+2y/3=42` and `3x-4y/3=40+x/5`. x = {20} y = {12}
chk: x=20, y=12 | 3x/2+2y-x+2y/3=42 | 3x-4y/3=40+x/5
q: By addition and subtraction: `3x+2y=21` and `x-2y=-1`. x = {5} y = {3}
chk: x=5, y=3 | 3x+2y=21 | x-2y=-1
q: By addition and subtraction: `3x-2y=7` and `5y-2x=10`. x = {5} y = {4}
chk: x=5, y=4 | 3x-2y=7 | 5y-2x=10
q: By addition and subtraction: `2x-y=3` and `3x+2y=22`. x = {4} y = {5}
chk: x=4, y=5 | 2x-y=3 | 3x+2y=22
q: By addition and subtraction: `3x+2y=19` and `2x-3y=4`. x = {5} y = {2}
chk: x=5, y=2 | 3x+2y=19 | 2x-3y=4
q: By addition and subtraction: `x/4+y/5=8` and `x/5+y/3=9`. x = {20} y = {15}
chk: x=20, y=15 | x/4+y/5=8 | x/5+y/3=9
q: By addition and subtraction: `x/2-y/3=3` and `x/6+y/9=3`. x = {12} y = {9}
chk: x=12, y=9 | x/2-y/3=3 | x/6+y/9=3
== 27 | Simple Equations | Problems with two unknowns
art: 161 | | The problems in Art. 156 were all capable of being solved by using one unknown quantity. When this is not the case, it becomes necessary to use a separate symbol for each unknown quantity, and as many equations as there are symbols. After the equations are obtained, they may be solved by either of the three methods of elimination. Any number consisting of two places of figures is equal to 10 times the figure in the ten's place, plus the figure in the unit's place. Thus, 23 is equal to `10*2+3`. In every proportion, the product of the means is equal to the product of the extremes.
mc: How many equations are needed when a problem has two unknown quantities, each with its own letter? | *two | one | three
mc: A two-figure number with tens figure `x` and units figure `y` is... | *`10x+y` | `x+y` | `xy`
tf: In every proportion, the product of the means equals the product of the extremes. {T}
q: Given, the sum of two numbers equal to 25, and their difference equal to 9, to find the numbers. The greater {17} the less {8}
sol: Let x = the greater, y = the less. x + y = 25, x - y = 9. Adding, 2x = 34, x = 17; subtracting, 2y = 16, y = 8.
q: The sum of two numbers is 44, and they are to each other as 5 to 6; required the numbers. The less {20} the greater {24}
q: There is a certain number consisting of two places of figures; the sum of the figures equals 6; if from the double of the number, 6 be subtracted, the remainder is a number whose digits are those of the former in an inverted order; required the number. {24}
sol: Let x = the tens figure, y = the units. x + y = 6, and 2(10x + y) - 6 = 10y + x. So 19x = 8y + 6; with 8x = -8y + 48, 27x = 54, x = 2, y = 4.
q: What two numbers are those to which if 5 be added, the sums will be to each other as 5 to 6; but, if 5 be subtracted from each, the remainders will be to each other as 3 to 4? {20} {25}
chk: x=20, y=25 | 6(x+5)=5(y+5) | 4(x-5)=3(y-5)
q: A grocer sold to one person 5 lb. of coffee and 3 lb. of sugar, for 79 cents; and to another, at the same prices, 3 lb. of coffee and 5 lb. of sugar, for 73 cents; what was the price of a lb. of coffee {11} of sugar {8}
chk: x=11, y=8 | 5x+3y=79 | 3x+5y=73
q: Sold to one person 9 horses and 7 cows, for $300; to another, at the same prices, 6 horses and 13 cows, for the same sum; what was the price of a horse {24} a cow {12}
chk: x=24, y=12 | 9x+7y=300 | 6x+13y=300
q: It is required to find two numbers, such that one half of the first and one third of the second shall be 22, and one fourth of the first and one fifth of the second shall be 12. {24} {30}
chk: x=24, y=30 | x/2+y/3=22 | x/4+y/5=12
q: If the greater of two numbers be added to one third of the less, the sum will be 37; but if the less be diminished by one fourth of the greater, the difference will be 20; what are the numbers? The greater {28} the less {27}
chk: x=28, y=27 | x+y/3=37 | y-x/4=20
q: A farmer has 2 horses, and a saddle worth $25; if the saddle be put on the first horse, his value will be double that of the second; but, if put on the second horse, his value will be three times that of the first. Required the value of the first horse {15} the second {20}
chk: x=15, y=20 | x+25=2y | y+25=3x
q: A and B are in trade together; if $50 be added to A's property, and $20 taken from B's, they will have the same sum; and if A's property was 3 times, and B's 5 times as great as each is, they would together have $2350; how much has A {250} B {320}
chk: x=250, y=320 | x+50=y-20 | 3x+5y=2350
q: A number consists of two digits, which, divided by their sum, gives 7; if the digits be written in inverse order, and the number so arising be divided by their sum plus 4, the quotient will be 3. What is the number? {84}
chk: x=8, y=4 | 10x+y=7(x+y) | 10y+x=3(x+y+4)
q: If we add 8 to the numerator of a certain fraction, its value becomes 2; if we subtract 5 from the denominator, its value becomes 3; required the fraction. {=6/7}
chk: x=6, y=7 | (x+8)/y=2 | x/(y-5)=3
q: If to the ages of A and B 18 be added, the result will be double the age of A; but, if from their difference 6 be subtracted, the result will be the age of B; required the age of A {30} B {12}
chk: x=30, y=12 | x+y+18=2x | x-y-6=y
q: There are two numbers whose sum is 37, and if 3 times the less be subtracted from 4 times the greater, and the difference divided by 6, the quotient will be 6; what are the numbers? The greater {21} the less {16}
chk: x=21, y=16 | x+y=37 | (4x-3y)/6=6
q: Find a fraction, such that if 3 be subtracted from the numerator and denominator, the value will be one fourth; and if 5 be added to the numerator and denominator, the value will be one half. {=7/19}
chk: x=7, y=19 | (x-3)/(y-3)=1/4 | (x+5)/(y+5)=1/2
q: A father gave his two sons, A and B, together $2400, to engage in trade; at the close of the year, A has lost one fourth of his capital, while B, having gained a sum equal to one fourth of his capital, finds that his money is just equal to that of his brother; what sum was given to A {1500} to B {900}
chk: x=1500, y=900 | x+y=2400 | 3x/4=5y/4
q: A said to B, "give me $100, and then I shall have as much as you." B said to A, "give me $100, and then I shall have twice as much as you." How much had A {500} B {700}
chk: x=500, y=700 | x+100=y-100 | y+100=2(x-100)
q: If the greater of two numbers be multiplied by 5, and the less by 7, the sum of their products is 198; but if the greater be divided by 5, and the less by 7, the sum of their quotients is 6; what are the numbers? The greater {20} the less {14}
chk: x=20, y=14 | 5x+7y=198 | x/5+y/7=6
q: Seven years ago the age of A was just three times that of B; and seven years hence, A's age will be just double B's; what are their ages? A {49} B {21}
chk: x=49, y=21 | x-7=3(y-7) | x+7=2(y+7)
q: There is a certain number consisting of two places of figures, which being divided by the sum of its digits, the quotient is 4, and if 27 be added to it, the digits will be inverted; required the number. {36}
chk: x=3, y=6 | 10x+y=4(x+y) | 10x+y+27=10y+x
q: A grocer has two kinds of sugar, of such quality that 1 lb. of each are together worth 20 cents; but if 3 lb. of the first, and 5 lb. of the second kind be mixed, a lb. of the mixture will be worth 11 cents; what is the value of a lb. of the first {6} of the second {14}
chk: x=6, y=14 | x+y=20 | 3x+5y=88
q: A boy lays out 84 cents for lemons and oranges, giving 3 cents apiece for the lemons, and 5 cents apiece for the oranges; he afterward sold one half of the lemons and one third of the oranges for 40 cents, and cleared 8 cents on what he sold; what number of lemons did he purchase {8} of oranges {12}
chk: x=8, y=12 | 3x+5y=84 | 3x/2+5y/3=32
q: A owes $500 and B $600, but neither has sufficient money to pay his debts. A said to B, "lend me one fifth of your money, and I can pay my debts." B said to A, "lend me one fourth of your money, and I can pay mine." How much has A {400} B {500}
chk: x=400, y=500 | x+y/5=500 | y+x/4=600
q: A son said to his father, "how old are we?" The father replied, "six years ago my age was 3 1/3 times yours, but 3 years hence my age will be only 2 1/6 times yours." Required the father's age {36} the son's {15}
chk: x=36, y=15 | x-6=10(y-6)/3 | x+3=13(y+3)/6
q: A farmer having mixed a certain number of bushels of oats and rye, found, that if he had mixed 6 bushels more of each, he would have mixed 7 bushels of oats for every 6 of rye; but if he had mixed 6 bushels less of each, he would have put in 6 bushels of oats for every 5 of rye. How many bushels of oats {78} of rye {66}
chk: x=78, y=66 | 6(x+6)=7(y+6) | 5(x-6)=6(y-6)
q: A person having laid out a rectangular yard, observed that if each side had been 4 yards longer, the length would have been to the breadth as 5 to 4; but, if each had been 4 yards shorter, the length would have been to the breadth as 4 to 3; required the length {36} the breadth {28}
chk: x=36, y=28 | 4(x+4)=5(y+4) | 3(x-4)=4(y-4)
q: A farmer rents a farm for $245 per annum; the tillable land being rented at $2 an acre, and the pasture at $1 and 40 cents an acre; now the number of acres tillable is to the excess of the tillable above the pasture, as 14 to 9; how many acres tillable {98} pasture {35}
chk: x=98, y=35 | 2x+1.4y=245 | 9x=14(x-y)
q: After drawing 15 gallons from each of 2 casks of wine, the quantity remaining in the first is two thirds of that in the second; after drawing 25 gallons more from each, the quantity left in the first is only half that in the second; what number of gallons in the first before the first drawing {65} the second {90}
chk: x=65, y=90 | x-15=2(y-15)/3 | x-40=(y-40)/2
q: If 1 be added to the numerator of a certain fraction, and the numerator to the denominator, its value will be one fourth; but if the denominator be increased by unity, and the numerator by the denominator, its value will be 8/7; find it. {=3/13}
chk: x=3, y=13 | (x+1)/(y+x)=1/4 | (x+y)/(y+1)=8/7
q: Find two numbers in the ratio of 5 to 7, to which two other required numbers, in the ratio of 3 to 5, being respectively added, the sums shall be in the ratio of 9 to 13, and the difference of their sums 16. The first two: {30} {42} The other two: {6} {10}
chk: x=6, y=2 | 13(5x+3y)=9(7x+5y) | (7x+5y)-(5x+3y)=16
q: A farmer, with 28 bushels of barley, worth 28 cents per bushel, would mix rye at 36 cents, and wheat at 48 cents per bushel, so that the whole mixture may consist of 100 bushels, and be worth 40 cents a bushel; how much rye {20} and wheat {52} must be mixed with the barley?
chk: x=20, y=52 | 28+x+y=100 | 28*28+36x+48y=4000
q: A person has two horses, and two saddles, one of which cost $50, and the other $2. If he places the best saddle upon the first horse, and the other on the second, then the latter is worth $8 less than the former; but if he puts the worst saddle upon the first, and the best upon the second, then the value of the latter is to that of the former as 15 to 4; required the value of the first horse {30} the second {70}
chk: x=30, y=70 | y+2=x+50-8 | 4(y+50)=15(x+2)
q: The weights of two loaded wagons were in the ratio of 4 to 5; parts of their loads, which were in the ratio of 6 to 7, being taken out, their weights were in the ratio of 2 to 3, and the sum of their weights was then 10 tons; what were their weights at first, in tons? {16} {20}
chk: x=4, y=2 | 3(4x-6y)=2(5x-7y) | (4x-6y)+(5x-7y)=10
q: A person had two casks and a certain quantity of wine in each; in order to have the same quantity in each cask, he poured as much out of the first cask into the second as it already contained; he next poured as much out of the second into the first as it then contained; and, lastly, he poured out as much from the first into the second as there was remaining in it; after this, he had 16 gallons in each cask; how many gallons in the first at first {22} the second {10}
chk: x=22, y=10 | 2(x-y)-(3y-x)=16 | 2(3y-x)=16
== 28 | Simple Equations | Three or more unknown quantities
art: 162 | | Equations involving three or more unknown quantities may be solved by either of the three methods of elimination already explained. Take `x+2y+z=20`, `2x+y+3z=31`, `3x+4y+2z=44`. Multiplying the first by 2 and subtracting the second, `3y-z=9`. Multiplying the first by 3 and subtracting the third, `2y+z=16`. Adding these, `5y=25`, `y=5`. Then `10+z=16`, `z=6`; and `x+10+6=20`, `x=4`. In practice, the method of elimination by addition and subtraction is generally to be preferred.
art: 162 | General Rule | For elimination by addition and subtraction: 1. Eliminate the same unknown quantity from each of the equations; the number of equations and of unknown quantities will be one less. 2. Proceed in the same way with another unknown quantity; the number of equations and of unknown quantities will be two less. 3. Continue this series of operations until a single equation is obtained, containing but one unknown quantity. 4. By going back and substituting, the values of the other unknown quantities may be readily found. When one or more of the equations contains but one or two of the unknown quantities, the method of substitution will generally be found the shortest. In literal equations, the method of comparison may be most convenient.
art: 163 | | When a problem contains three or more unknown quantities, the equations may be formed according to the directions given in Art. 156 and 161. When one or more of the unknown quantities can be expressed in terms of another, it is best to reduce the number of equations and symbols by doing so.
mc: Eliminating one unknown from three equations leaves... | *two equations with two unknowns | one equation | three equations with two unknowns
mc: Which method is generally preferred in practice? | *addition and subtraction | substitution | comparison
tf: When an equation contains only one or two of the unknowns, substitution is often shortest. {T}
q: Find `x`, `y` and `z`: `x+2y+z=20`, `2x+y+3z=31`, `3x+4y+2z=44`. x = {4} y = {5} z = {6}
chk: x=4, y=5, z=6 | x+2y+z=20 | 2x+y+3z=31 | 3x+4y+2z=44
q: Find `v`, `x`, `y`, `z`: `v+2x+3y+4z=30`, `2v+3x+y+z=15`, `3v+x+2y+3z=23`, `4v+2x-y+14z=61`. v = {1} x = {2} y = {3} z = {4}
chk: v=1, x=2, y=3, z=4 | v+2x+3y+4z=30 | 2v+3x+y+z=15 | 3v+x+2y+3z=23 | 4v+2x-y+14z=61
q: Solve `x+y=50`, `x+z=28`, `y+z=42`. x = {18} y = {32} z = {10}
chk: x=18, y=32, z=10 | x+y=50 | x+z=28 | y+z=42
q: Solve `3x+5y=76`, `4x+6z=108`, `5z+7y=106`. x = {12} y = {8} z = {10}
chk: x=12, y=8, z=10 | 3x+5y=76 | 4x+6z=108 | 5z+7y=106
q: Solve `x+y+z=26`, `x+y-z=-6`, `x-y+z=12`. x = {3} y = {7} z = {16}
chk: x=3, y=7, z=16 | x+y+z=26 | x+y-z=-6 | x-y+z=12
q: Solve `x+y/2=100`, `y+z/3=100`, `z+x/4=100`. x = {64} y = {72} z = {84}
chk: x=64, y=72, z=84 | x+y/2=100 | y+z/3=100 | z+x/4=100
q: Solve `2x-y+z=9`, `x-2y+3z=14`, `3x+4y-2z=7`. x = {3} y = {2} z = {5}
chk: x=3, y=2, z=5 | 2x-y+z=9 | x-2y+3z=14 | 3x+4y-2z=7
q: Solve `x/3-y/2+z=3`, `x/6+y/4-z/3=1`, `x/2-y/4+z=5`. x = {6} y = {4} z = {3}
chk: x=6, y=4, z=3 | x/3-y/2+z=3 | x/6+y/4-z/3=1 | x/2-y/4+z=5
q: A has 3 ingots; 1 lb. of the first contains 7 oz. of silver, 3 of copper, and 6 of tin; 1 lb. of the second contains 12 oz. of silver, 3 of copper, and 1 of tin; and 1 lb. of the third contains 4 oz. of silver, 7 of copper, and 5 of tin. How many oz. of each must be taken to form an ingot of 1 lb. weight, containing 8 oz. of silver, 3 3/4 of copper, and 4 1/4 of tin? Of the first {8} the second {5} the third {3}
chk: x=8, y=5, z=3 | 7x+12y+4z=128 | 3x+3y+7z=60 | 6x+y+5z=68
sol: x oz. of the first hold 7x/16 oz. of silver, and so on: 7x + 12y + 4z = 128, 3x + 3y + 7z = 60, 6x + y + 5z = 68. Eliminating y gives 5x + 24z = 112 and 15x + 8z = 144; so x = 8, z = 3, y = 5.
q: The sums of three numbers, taken two and two, are 27, 32, and 35; required the numbers. {12} {15} {20}
chk: x=12, y=15, z=20 | x+y=27 | x+z=32 | y+z=35
q: The sum of three numbers is 59; one half the difference of the first and second is 5, and one third the difference of the first and third is 9; required the numbers. {32} {22} {5}
chk: x=32, y=22, z=5 | x+y+z=59 | (x-y)/2=5 | (x-z)/3=9
q: A person bought three silver watches; the price of the first, with one half the price of the other two, was $25; the price of the second, with one third the price of the other two, was $26; and the price of the third, with one half the price of the other two, was $29; required the price of the first {8} the second {18} the third {16}
chk: x=8, y=18, z=16 | x+(y+z)/2=25 | y+(x+z)/3=26 | z+(x+y)/2=29
q: Find three numbers, such that the first with one third of the other two, the second with one fourth of the other two, and the third with one fifth of the other two, shall each equal 25. {13} {17} {19}
chk: x=13, y=17, z=19 | x+(y+z)/3=25 | y+(x+z)/4=25 | z+(x+y)/5=25
q: A boy bought at one time 2 apples and 5 pears, for 12 cents; at another, 3 pears and 4 peaches, for 18 cents; at another, 4 pears and 5 oranges, for 28 cents; and at another, 5 peaches and 6 oranges, for 39 cents; required the cost of an apple {1} a pear {2} a peach {3} an orange {4}
chk: a=1, p=2, e=3, o=4 | 2a+5p=12 | 3p+4e=18 | 4p+5o=28 | 5e+6o=39
q: A and B together possess only two thirds as much money as C; B and C together have 6 times as much as A; and B has $680 less than A and C together; how much has A {200} B {360} C {840}
chk: a=200, b=360, c=840 | a+b=2c/3 | b+c=6a | b=a+c-680
q: A, B, and C compare their money; A says to B, "give me $700, and I shall have twice as much as you will have left." B says to C, "give me $1400, and I shall have three times as much as you will have left." C says to A, "give me $420, and I shall have five times as much as you will have left." How much has A {980} B {1540} C {2380}
chk: a=980, b=1540, c=2380 | a+700=2(b-700) | b+1400=3(c-1400) | c+420=5(a-420)
q: A certain number is expressed by three figures, whose sum is 11; the figure in the place of units is double that in the place of hundreds; and if 297 be added to the number, its figures will be inverted; required the number. {326}
chk: h=3, t=2, u=6 | h+t+u=11 | u=2h | 100h+10t+u+297=100u+10t+h
q: The sum of 3 numbers is 83; if from the first and second you subtract 7, the remainders are as 5 to 3; but if from the second and third you subtract 3, the remainders are to each other as 11 to 9; required the numbers. {37} {25} {21}
chk: x=37, y=25, z=21 | x+y+z=83 | 3(x-7)=5(y-7) | 9(y-3)=11(z-3)
q: Divide $180 among three persons, A, B, and C, so that twice A's share plus $80, three times B's share plus $40, and four times C's share plus $20, may be all equal to each other. A {70} B {60} C {50}
chk: a=70, b=60, c=50 | a+b+c=180 | 2a+80=3b+40 | 3b+40=4c+20
q: If A and B can perform a certain work in 12 days, A and C in 15 days, and B and C in 20 days, in what time could A do it alone {20} B {30} C {60}
chk: a=20, b=30, c=60 | 1/a+1/b=1/12 | 1/a+1/c=1/15 | 1/b+1/c=1/20
q: A number expressed by three figures, when divided by the sum of the figures plus 9, gives a quotient of 19; the middle figure equals half the sum of the first and third; and if 198 be added to the number, we obtain a number with the same figures in an inverted order; what is the number? {456}
chk: h=4, t=5, u=6 | 100h+10t+u=19(h+t+u+9) | 2t=h+u | 100h+10t+u+198=100u+10t+h
q: A farmer mixes barley at 28 cents, with rye at 36, and wheat at 48 cents per bushel, so that the whole is 100 bushels, and worth 40 cents per bushel. Had he put twice as much rye, and 10 bushels more wheat, the whole would have been worth exactly the same per bushel; how much barley {28} rye {20} wheat {52}
chk: b=28, r=20, w=52 | b+r+w=100 | 28b+36r+48w=4000 | 28b+72r+48(w+10)=40(b+2r+w+10)
q: A, B, and C killed 96 birds, which they wish to share equally; to do this, A, who has the most, gives to B and C as many as they already had; next, B gives to A and C as many as they had after the first division; lastly, C gives to A and B as many as they both had after the second division, and each then had the same number; how many had A at first {52} B {28} C {16}
chk: a=52, b=28, c=16 | a+b+c=96 | 4(a-b-c)=32 | 2(2b-(a-b-c)-2c)=32
== 29 | Supplement to Simple Equations | General solutions and formulas
art: 164 | Literal Equation | A Literal Equation is an equation in which the known quantities are represented, either entirely or partly, by letters. Values expressed by letters are termed general, because, by giving particular values to the letters, the solution of one problem furnishes a general solution to all others of the same kind. A Formula is the answer to a problem, when the known quantities are represented by letters. A Rule is a formula expressed in ordinary language.
art: 165 | | Find a number which being divided by 3, and by 5, the sum of the quotients will be 16: `x/3+x/5=16`, `5x+3x=16*15`, `x=30`. Instead of solving every example of the same kind separately, we may give a general solution: find a number which being divided by two given numbers, `a` and `b`, the sum of the quotients may be equal to another given number, `c`. `x/a+x/b=c`; `bx+ax=abc`; `x=abc/(a+b)`. That is: multiply together the three given numbers, and divide the product by the sum of the divisors.
art: 166 | Sum and Difference | The sum of two numbers is `a`, and their difference `b`. Let `x` be the greater, `y` the less: `x+y=a`, `x-y=b`; by addition, `x=(a+b)/2=a/2+b/2`; by subtraction, `y=(a-b)/2=a/2-b/2`. Rule: to find the greater, add half the difference to half the sum; to find the less, subtract half the difference from half the sum.
art: 167 | Work | A can do a piece of work in `m` days, and B in `n` days; in how many days can they both together do it? `1/m+1/n=1/x`; `nx+mx=mn`; `x=mn/(m+n)`. Rule: divide the product of the numbers expressing the time in which each can perform the work, by their sum; the quotient will be the time in which they can jointly perform it.
art: 168 | Partnership | A, B, and C put in stock as `m`, `n`, `r`, and gain `c` dollars. Let the shares be `mx`, `nx`, `rx`; then `mx+nx+rx=c`, and A's share is `mc/(m+n+r)`. Rule: divide the whole gain or loss by the sum of the proportions of stock, and multiply the quotient by each partner's proportion. When the times are different, multiply each man's stock by the time it was employed, to find the proportions of stock: $3 for 4 months is the same as $12 for 1 month.
art: 169 | | Two men, A and B, can perform a piece of work in `a` days, A and C in `b` days, and B and C in `c` days. Then `1/x+1/y=1/a`, `1/x+1/z=1/b`, `1/y+1/z=1/c`. Adding and dividing by 2, `1/x+1/y+1/z=1/(2a)+1/(2b)+1/(2c)`; subtracting, `x=2abc/(ac+bc-ab)`, and all together can do it in `2abc/(ab+ac+bc)` days.
art: 170 | | If 4 acres pasture 40 sheep 4 weeks, and 8 acres pasture 56 sheep 10 weeks, how many sheep will 20 acres pasture 50 weeks, the grass growing uniformly? Let `m` be the grass on an acre at first, and `n` the growth on 1 acre in 1 week. One sheep eats `m/40+n/10`, and also `m/70+n/7`, in a week; so `m=4n`. One sheep in 50 weeks eats `5m/2`; 20 acres in 50 weeks have `20m+250m=270m`; and `270m÷(5m/2)=108` sheep.
mc: An answer in letters, when the known quantities are letters, is called a... | *formula | rule | root
mc: A formula expressed in ordinary language is called a... | *rule | theorem | literal equation
mc: To find the greater of two numbers from their sum and difference... | *add half the difference to half the sum | subtract the difference from the sum | double the sum
mc: If A does a work in `m` days and B in `n` days, together they need... | *`mn/(m+n)` days | `m+n` days | `(m+n)/2` days
tf: In partnership, each partner's share is in proportion to his stock. {T}
q: Find a number which being divided by 3, and by 5, the sum of the quotients will be 16. {30 @x: x/3+x/5=16}
q: Find another number, which being divided by 4, and by 7, the sum of the quotients will be 11. {28 @x: x/4+x/7=11}
q: Find a number which being divided by `a` and `b`, the sum of the quotients may be `c`. {$ abc/(a+b) @x: x/a+x/b=c}
q: Find a number which being divided by 3, and by 7, the sum of the quotients may be 20. {42 @x: x/3+x/7=20}
q: Find a number which being divided by one third and one fourth, the sum of the quotients may be 1. {1/7 @x: 3x+4x=1}
q: The sum of $500 is to be divided between A and B, so that A may have $50 less than B. A {225} B {275}
q: The sum of two numbers is `a`, and their difference `b`; the greater is {$ (a+b)/2 | a/2+b/2} the less {$ (a-b)/2 | a/2-b/2}
q: Sum 200, difference 50. {125} {75}
q: Sum 100, difference 25. {62 1/2} {37 1/2}
q: Sum 15, difference 10. {12 1/2} {2 1/2}
q: Sum 5 1/2, difference 3/4. {3 1/8} {2 3/8}
q: A can do a piece of work in 3 days, and B in 4 days; in what time can both together do it? (days) {1 5/7 @x: 1/3+1/4=1/x}
q: A can do a piece of work in `m` days, and B in `n` days; in how many days can they both together do it? {$ mn/(m+n) @x: 1/m+1/n=1/x}
q: A cistern is filled by one pipe in 6, and by another in 9 hours; in what time will it be filled by both together? (hours) {3 3/5 @x: 1/6+1/9=1/x}
q: One man can drink a keg of cider in 5 days, and another in 7 days; in what time can both together drink it? (days) {2 11/12 @x: 1/5+1/7=1/x}
q: A, B, and C put in $3, $4, and $5 as often as each other; they gain $60. A's share {15} B's {20} C's {25}
q: A puts in `m` dollars as often as B puts in `n` and C puts in `r`; they gain `c` dollars. A's share is {$ mc/(m+n+r)}
q: A, B, and C engaged in trade; A put in $200, B $300, and C $700; they lost $60; what was A's share of the loss {10} B's {15} C's {35}
q: In a trading expedition, A put in $200 for 3 months, B $150 for 5 months, and C $100 for 8 months; they gained $215; what was A's share {60} B's {75} C's {80}
q: A and B can do a work in `a` days, A and C in `b` days, B and C in `c` days. In how many days could A do it alone? {$ 2abc/(ac+bc-ab)} All three together? {$ 2abc/(ab+ac+bc)}
q: If 4 acres pasture 40 sheep 4 weeks, and 8 acres pasture 56 sheep 10 weeks, how many sheep will 20 acres pasture 50 weeks, the grass growing uniformly all the time? {108}
q: Divide the number `a` into two parts, so that one of them shall be `n` times the other. The less {$ a/(n+1) @x: x+nx=a} the greater {$ an/(n+1)}
q: Divide the number `a` into two parts, so that `m` times one part shall be equal to `n` times the other. The first part {$ an/(m+n) @x: mx=n(a-x)} the second {$ am/(m+n)}
q: Find a number which being divided by `m`, and by `n`, the sum of the quotients shall be equal to `a`. {$ amn/(m+n) @x: x/m+x/n=a}
q: What number must be added to `a` and `b`, so that the sums shall be to each other as `m` to `n`? {$ (an-bm)/(m-n) @x: n(a+x)=m(b+x)}
q: What number must be subtracted from `a` and `b`, so that the differences shall be to each other as `m` to `n`? {$ (bm-an)/(m-n) @x: n(a-x)=m(b-x)}
q: After paying away `1/m` and `1/n` of my money, I had `a` dollars left: how many dollars had I at first? {$ amn/(mn-m-n) @x: x-x/m-x/n=a}
q: A company paid for the use of a boat for an excursion, `a` cents each; if there had been `b` persons less, each would have had to pay `c` cents; how many persons were there? {$ bc/(c-a) @x: ax=c(x-b)}
q: A farmer mixes oats at `a` cents per bushel, with rye at `b` cents, so that a bushel of the mixture is worth `c` cents; how many bushels of oats will `n` bushels of the mixture contain? {$ n(c-b)/(a-b) | (cn-bn)/(a-b) @x: ax+b(n-x)=cn} Of rye? {$ n(a-c)/(a-b) | (an-cn)/(a-b)}
q: A person borrowed as much money as he had in his purse, and then spent `a` cents; again, he borrowed as much as he had in his purse, after which he spent `a` cents; he borrowed and spent, in the same manner, a third and fourth time, after which, he had nothing left; how much had he at first? {$ 15a/16 @x: 2(2(2(2x-a)-a)-a)-a=0}
q: A person has 2 kinds of coin; it takes `a` pieces of the first, and `b` pieces of the second, to make $1; how many pieces of the first must be taken, so that `c` pieces may be equivalent to $1? {$ a(b-c)/(b-a) | (ab-ac)/(b-a) @x: x/a+(c-x)/b=1} Of the second? {$ b(c-a)/(b-a) | (bc-ab)/(b-a)}
== 30 | Supplement to Simple Equations | Negative answers and discussion
art: 171 | | Sometimes in an equation of the first degree, the second, or some higher power of the unknown quantity occurs, but in such a manner that it may be made to disappear. Given `2x^2+8x=11x^2-10x`: by dividing each side by `x`, `2x+8=11x-10`, from which `x=2`. Given `(4+x)(3+x)-6(10-x)=x(7+x)`: performing the operations, `12+7x+x^2-60+6x=7x+x^2`; omitting the quantities on each side which are equal, `12-60+6x=0`, from which `x=8`.
art: 172 | Negative Solutions | It sometimes happens, in the solution of a problem, that the value of the unknown quantity is found to be minus. Such a result is termed a negative solution. What number must be added to the number 5, that the sum shall be equal to 3? `5+x=3`; and `x=3-5=-2`. Now, `-2` added to 5, gives 3; the result is said to satisfy the question in an algebraic sense; but the problem is evidently impossible in an arithmetical sense. Since adding `-2` is the same as subtracting `+2`, the result is the answer to: what number must be subtracted from 5, that the remainder may be equal to 3? 1. A negative solution indicates some inconsistency or absurdity in the question from which the equation was derived. 2. When a negative solution is obtained, the question to which it is the answer may be so modified as to be consistent.
art: 173 | Discussion | When a question has been solved in a general manner, we may inquire what values the results will have when particular suppositions are made with regard to the known quantities; this is termed the discussion of the problem. After subtracting `b` from `a`, what number, multiplied by the remainder, will give `c`? `(a-b)x=c`, and `x=c/(a-b)`. I. When `b` is less than `a`, `x` is positive: let `a=8`, `b=3`, `c=20`; then `x=4`. II. When `b` is greater than `a`, `x` is negative: `a=2`, `b=5`, `c=12` give `x=-4`. III. When `b=a`, `x=c/0`; as the denominator decreases the fraction increases, so `c/0` is infinitely great, written ∞. IV. When `c=0`, `x=0/d=0`. V. When `b=a` and `c=0`, `x=0/0`, the symbol of indetermination: it may have any value. Before deciding the value to be indeterminate, see that it has not come from a factor which is zero: `(a^2-b^2)/(a-b)` with `b=a` gives `0/0`, but canceling `a-b` first gives `2a`.
art: 173 | Problem of the Couriers | Two couriers depart at the same time, from two places, A and B, `a` miles apart; the former travels `m` miles an hour, and the latter `n` miles. When they travel toward each other, `x/m=(a-x)/n` and the first travels `x=am/(m+n)`; if `m=n`, each travels half the distance. When they travel in the same direction, `x/m=(x-a)/n` and `x=am/(m-n)`: if `m` is greater than `n` they meet beyond B; if `n` is greater, `x` is negative, showing they met before, behind A; if `m=n`, `x=am/0`, infinite: they never meet; if `a=0` and `m=n`, `x=0/0`: they are always together.
art: 174 | Independent Equations | An Independent Equation is one in which the relation of quantities which it contains, can not be obtained directly from others with which it is compared. Thus, `x+2y=11` and `2x+5y=26` are independent; but `x+2y=11` and `2x+4y=22` are not, the second being derived from the first by multiplying both sides by 2.
art: 175 | Indeterminate Equations | An Indeterminate Equation is one that can be verified by different values of the same unknown quantity. In `x-y=5`, `x=5+y`: if `y=1`, `x=6`; if `y=2`, `x=7`; and so on. When the number of unknown quantities exceeds the number of independent equations, the problem is indeterminate. A question with one unknown is indeterminate when its equation is identical: what number is that, of which three fourths, diminished by two thirds, equals one twentieth increased by one thirtieth? Clearing, `45x-40x=3x+2x`, or `5x=5x`, true for any value.
art: 176 | Redundant and Impossible | When the number of equations is greater than the number of unknown quantities, as `x+y=10`, `x-y=4`, `2x-3y=5`, one is unnecessary: those conditions are termed redundant. Or they may be incompatible: `x+y=9`, `x+2y=13`, `2x+3y=21` give different values from each pair. A question with one unknown may be impossible: what number is that, of which one half and one third diminished by 4, is equal to five sixths increased by 8? `3x+2x-24=5x+48`, so `0=72`, which shows that the question is absurd.
art: 177 | | The equation `ax-cx=b-d` expresses a simple equation in its most general form. Let `a-c=m` and `b-d=n`; then `mx=n`, or `x=n/m`. Since `n` divided by `m` can give but one quotient, an equation of the first degree has but one root.
mc: A minus value of the unknown quantity is called... | *a negative solution | an indeterminate solution | an impossible solution
mc: A negative solution indicates... | *some inconsistency in the question | that the work is wrong | that any value will do
mc: `c/0` stands for a quantity... | *infinitely great | equal to zero | equal to `c`
mc: `0/d` is equal to... | *0 | `d` | infinity
mc: `0/0` is the symbol of... | *indetermination | infinity | zero
mc: When there are more unknown quantities than independent equations, the problem is... | *indeterminate | impossible | redundant
mc: An equation of the first degree has how many roots? | *one | two | none
mc: Two couriers traveling the same way at the same rate... | *never meet | meet halfway | meet at once
tf: `x+2y=11` and `2x+4y=22` are independent equations. {F}
tf: An equation that leads to `0=72` shows the question is absurd. {T}
q: Given `2x^2+8x=11x^2-10x`, find `x`. {2 @x: 2x^2+8x=11x^2-10x}
q: Given `(4+x)(3+x)-6(10-x)=x(7+x)`, find `x`. {8 @x: (4+x)(3+x)-6(10-x)=x(7+x)}
q: Given `3x^2-8x=24x-5x^2`, find `x`. {4 @x: 3x^2-8x=24x-5x^2}
q: Given `3ax^3-10ax^2=8ax^2+ax^3`, find `x`. {9 @x: 3ax^3-10ax^2=8ax^2+ax^3}
q: Given `(6x+13)/15-(3x+5)/(5x-25)=2x/5`, find `x`. {20 @x: (6x+13)/15-(3x+5)/(5x-25)=2x/5}
q: Given `(a+x)(b+x)-a(c-b)=x(b+x)`, find `x`. {$ c-2b @x: (a+x)(b+x)-a(c-b)=x(b+x)}
q: Given `x+a+b+c=(x^2+a^2+b^2+c^2)/(a+b-c+x)`, find `x`. {$ (c^2-ab)/(a+b) @x: x+a+b+c=(x^2+a^2+b^2+c^2)/(a+b-c+x)}
q: If a certain book had 5 more pages, with 10 more lines on a page, the number of lines would be increased 450; if it had 10 pages less, with 5 lines less on a page, the whole number of lines would be diminished 450; required the number of pages {20} and of lines on a page {40}
chk: p=20, l=40 | (p+5)(l+10)=p*l+450 | (p-10)(l-5)=p*l-450
q: What number must be added to the number 5, that the sum shall be equal to 3? {$ -2 @x: 5+x=3}
q: What number must be added to `a`, that the sum shall be equal to `b`? {$ b-a @x: a+x=b}
q: What number must be subtracted from 20, that the remainder shall be 25? {$ -5 @x: 20-x=25}
q: What number must be added to 11, that the sum being multiplied by 5, the product shall be 40? {$ -3 @x: 5(11+x)=40}
q: What number is that whose two thirds exceeds its three fourths by 3? {$ -36 @x: 2x/3-3x/4=3}
q: A father, whose age is 45 years, has a son aged 15; in how many years will the son be one fourth as old as his father? {$ -5 @x: 15+x=(45+x)/4}
sol: The answer is minus 5: five years ago the son was one fourth as old as his father (10 and 40).
mc: The question "What number must be added to 5 to make 3?" is consistent when changed to... | *What number must be subtracted from 5 to make 3? | What number must be added to 3 to make 5? | What number must be multiplied by 5?
q: After subtracting `b` from `a`, what number, multiplied by the remainder, will give `c`? {$ c/(a-b) @x: (a-b)x=c}
q: In `x=c/(a-b)`, let `a=8`, `b=3`, `c=20`. Then `x` = {4 @= 20/(8-3)}
q: In `x=c/(a-b)`, let `a=2`, `b=5`, `c=12`. Then `x` = {$ -4 @ 12/(2-5)}
q: In `x=(a^2-b^2)/(a-b)`, cancel the common factor; then let `b=a`. `x` = {$ 2a}
q: Two couriers, `a` miles apart, travel toward each other at `m` and `n` miles an hour. How far does the first travel before they meet? {$ am/(m+n) @x: x/m=(a-x)/n}
q: The couriers travel the same way, the first `m` miles an hour behind the second at `n`. How far does the first travel to overtake? {$ am/(m-n) @x: x/m=(x-a)/n}
q: In `x-y=5`, if `y=2`, what is `x`? {7}
q: In `x+3y+z=10` and `x+2y-z=6`, putting `z=1`, what are `y` {2} and `x` {3}
== 31 | Powers, Roots, and Radicals | Raising to powers
art: 178 | Power | The Power of a quantity is the product arising from multiplying the quantity by itself a certain number of times. The Root of the power is the quantity to be multiplied. Thus, `a^2` is called the second power of `a`, because `a` is taken twice as a factor; and `a` is called the second root of `a^2`. So, also, `a^3` is the third power of `a`, because `a*a*a=a^3`. The second power is generally called the square, and the second root, the square root; the third power is called the cube, and the third root, the cube root. The Exponent is the figure indicating the power to which the quantity is to be raised.
art: 179 | Case I | To raise a monomial to any given power. Let it be required to raise `2ab^2` to the third power: `(2ab^2)^3=2ab^2*2ab^2*2ab^2=2^3*a^3*b^6=8a^3b^6`. The coefficient of the power is found by raising the coefficient, 2, of the root, to the given power; and the exponent of each letter, by multiplying the exponent of the letter in the root by 3, the index of the required power.
art: 180 | Signs of Powers | When the root is positive, all the powers will be positive. When the root is negative: `-a` is the first power, negative; `-a*-a=+a^2`, positive; `-a*-a*-a=-a^3`, negative; `+a^4`, positive; `-a^5`, negative. The even powers of a negative quantity are positive, and the odd powers negative. Rule: raise the numeral coefficient to the required power, and multiply the exponent of each letter by the exponent of the power. If the monomial is positive, all the powers will be positive; if negative, the even powers will be positive, and the odd powers negative.
art: 181 | Case II | To raise a polynomial to any power. Rule: find the product of the quantity, taken as a factor as many times as there are units in the exponent of the power.
art: 182 | Case III | To raise a fraction to any power. Rule: raise both numerator and denominator to the required power.
mc: The cube of `2ab^2` is... | *`8a^3b^6` | `6a^3b^6` | `8a^3b^5`
mc: To raise a monomial to a power, the exponent of each letter is... | *multiplied by the exponent of the power | added to the exponent of the power | left the same
mc: The even powers of a negative quantity are... | *positive | negative | zero
mc: `(-a)^3` is... | *`-a^3` | `a^3` | `-3a`
mc: To raise a fraction to a power... | *raise both numerator and denominator | raise only the numerator | multiply by the exponent
tf: `(-a)^4=a^4` {T}
q: Find the square of `3ax^2y^3`. {$~ (3ax^2y^3)^2}
q: Square of `5b^2c^3`. {$~ (5b^2c^3)^2}
q: Cube of `2x^2y^3`. {$~ (2x^2y^3)^3}
q: Square of `-ab^2c`. {$~ (-ab^2c)^2}
q: Cube of `-abc^2`. {$~ (-abc^2)^3}
q: Fourth power of `3ab^3c^2`. {$~ (3ab^3c^2)^4}
q: Fourth power of `-3ab^3c^2`. {$~ (-3ab^3c^2)^4}
q: Fifth power of `ab^3cd^2`. {$~ (ab^3cd^2)^5}
q: Fifth power of `-ab^3cd^2`. {$~ (-ab^3cd^2)^5}
q: Seventh power of `-m^2n^3`. {$~ (-m^2n^3)^7}
q: Eighth power of `-mn^2`. {$~ (-mn^2)^8}
q: Cube of `-3xy^2`. {$~ (-3xy^2)^3}
q: Fourth power of `5a^2x^3`. {$~ (5a^2x^3)^4}
q: Fourth power of `7a^2x^3`. {$~ (7a^2x^3)^4}
q: Fifth power of `-3a^2xy^2z^3`. {$~ (-3a^2xy^2z^3)^5}
q: Find the square of `ax+cy`. {$~ (ax+cy)^2}
q: Square of `1-x`. {$ 1-2x+x^2 @ (1-x)^2}
q: Square of `x+1`. {$~ (x+1)^2}
q: Square of `2x^2-3y^2`. {$~ (2x^2-3y^2)^2}
q: Cube of `a+x`. {$~ (a+x)^3}
q: Cube of `x-y`. {$~ (x-y)^3}
q: Cube of `2x-1`. {$~ (2x-1)^3}
q: Find the square of `a-b+c-d`. {$~ (a-b+c-d)^2}
q: Find the cube of `2x^2-3x+1`. {$~ (2x^2-3x+1)^3}
q: Find the square of `(a+b)/(c-d)`. {$ (a+b)^2/(c-d)^2 | (a^2+2ab+b^2)/(c^2-2cd+d^2) @ ((a+b)/(c-d))^2}
q: Find the square of `2x/(3y)`. {$ 4x^2/(9y^2) @ (2x/(3y))^2}
q: Find the cube of `-ac/(x^2y)`. {$ -a^3c^3/(x^6y^3) @ (-ac/(x^2y))^3}
q: Find the square of `-2x^2/(3y)`. {$ 4x^4/(9y^2) @ (-2x^2/(3y))^2}
q: Find the square of `(x-2)/(x+3)`. {$ (x-2)^2/(x+3)^2 | (x^2-4x+4)/(x^2+6x+9) @ ((x-2)/(x+3))^2}
q: Find the cube of `2a(x-y)/(3yz^2)`. {$ 8a^3(x-y)^3/(27y^3z^6) @ (2a(x-y)/(3yz^2))^3}
== 32 | Powers, Roots, and Radicals | The binomial theorem
art: 183 | Binomial Theorem | The Binomial Theorem, discovered by Sir Isaac Newton, explains the method of involving a binomial quantity without the tedious process of multiplication. By multiplication, `(a+b)^2=a^2+2ab+b^2`; `(a+b)^3=a^3+3a^2b+3ab^2+b^3`; `(a+b)^4=a^4+4a^3b+6a^2b^2+4ab^3+b^4`; `(a+b)^5=a^5+5a^4b+10a^3b^2+10a^2b^3+5ab^4+b^5`. And `(a-b)^5=a^5-5a^4b+10a^3b^2-10a^2b^3+5ab^4-b^5`. The first letter, `a`, is called the leading quantity; and the second letter, `b`, the following quantity.
art: 184 | The Four Laws | 1st. Of the number of terms: the number of terms in any power of a binomial is one greater than the exponent of the power. 2d. Of the signs: when both terms are positive, all the terms will be positive; when the first term is positive, and the second negative, all the odd terms will be positive, and the even terms negative. 3d. Of the exponents: the exponent of the leading letter in the first term is the same as that of the power of the binomial; in the other terms, it decreases by unity from left to right, and disappears in the last term. The following letter begins with an exponent of one, in the second term; increases by unity from left to right; and, in the last term, is the same as the power of the binomial. The sum of the exponents of the two letters in any term is always the same, and is equal to the power of the binomial.
art: 184 | Coefficients | 4th. Of the coefficients: the coefficient of the first and last terms is always 1; the coefficient of the second term is the same as that of the power of the binomial. If the coefficient of any term be multiplied by the exponent of the leading letter, and the product be divided by the number of that term from the left, the quotient will be the coefficient of the next term. For the sixth power: 1, 6, `6*5/2`, `15*4/3`, `20*3/4`, `15*2/5`, `6*1/6`; or 1, 6, 15, 20, 15, 6, 1. Hence, `(a+b)^6=a^6+6a^5b+15a^4b^2+20a^3b^3+15a^2b^4+6ab^5+b^6`. The coefficients of terms equally distant from the first and the last are equal.
art: 185 | | The Binomial Theorem may be used to find the different powers of a binomial, when one or both terms consist of two or more factors. Find the cube of `2x-ac^2`: let `2x=m`, and `ac^2=n`; then `(m-n)^3=m^3-3m^2n+3mn^2-n^3`; substituting, `8x^3-12ac^2x^2+6a^2c^4x-a^3c^6`.
art: 186 | | The Binomial Theorem may likewise be used to raise a trinomial or quadrinomial to any power. Find the second power of `a+b+c`: let `b+c=x`; then `(a+x)^2=a^2+2ax+x^2`; `2ax=2ab+2ac`; `x^2=b^2+2bc+c^2`. Then `(a+b+c)^2=a^2+2ab+2ac+b^2+2bc+c^2`.
mc: How many terms in the seventh power of a binomial? | *8 | 7 | 14
mc: In `(a-b)^5`, the even terms are... | *negative | positive | zero
mc: In any term of `(a+b)^6`, the exponents of `a` and `b` add up to... | *6 | 7 | 5
mc: The coefficient of the second term of `(a+b)^9` is... | *9 | 1 | 36
mc: The coefficients of `(a+b)^4` are... | *1, 4, 6, 4, 1 | 1, 3, 3, 1 | 1, 4, 4, 4, 1
tf: The coefficient of the third term of `(a+b)^6` is `6*5/2=15`. {T}
q: Write `(x+y)^3` without the coefficients. {$ x^3+x^2y+xy^2+y^3}
q: Write `(x-y)^4` without the coefficients. {$ x^4-x^3y+x^2y^2-xy^3+y^4}
q: The coefficients of the sixth power of a binomial, in order: {1} {6} {15} {20} {15} {6} {1}
q: Raise `x+y` to the third power. {$~ (x+y)^3}
q: Raise `x-y` to the fourth power. {$~ (x-y)^4}
q: Raise `m+n` to the fifth power. {$~ (m+n)^5}
q: What is the sixth power of `x-z`? {$~ (x-z)^6}
q: What is the seventh power of `a+b`? {$~ (a+b)^7}
q: What is the eighth power of `m-n`? {$~ (m-n)^8}
q: Find the ninth power of `x-y`. {$~ (x-y)^9}
q: Find the tenth power of `a+b`. {$~ (a+b)^10}
q: Find the cube of `2x-ac^2`. {$~ (2x-ac^2)^3}
q: Find the cube of `2a-3b`. {$~ (2a-3b)^3}
q: Find the fourth power of `m+2n`. {$~ (m+2n)^4}
q: Find the third power of `4ax^2+3cy`. {$~ (4ax^2+3cy)^3}
q: Find the fourth power of `2x-5z`. {$~ (2x-5z)^4}
q: Find the second power of `a+b+c`. {$~ (a+b+c)^2}
q: Find the third power of `x+y+z`. {$~ (x+y+z)^3}
q: Find the second power of `a+b+c+d`. {$~ (a+b+c+d)^2}
== 33 | Powers, Roots, and Radicals | Square roots of numbers
art: 187 | Evolution | Evolution is the process of finding the root of a quantity. The Second, or Square Root of a number, is that number which, being multiplied by itself, will produce the given number. Thus, 2 is the square root of 4, because `2*2=4`. The Extraction of the Square Root is the process of finding the second root of a given number.
art: 188 | | The first ten numbers and their squares are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and 1, 4, 9, 16, 25, 36, 49, 64, 81, 100. When the number of places of figures in the number is either one or two, there will be one figure in the root; when three or four, two figures; when five or six, three figures; and so on.
art: 189 | | Every number may be regarded as being composed of tens and units. If we represent the tens by `t`, and the units by `u`, any number will be represented by `t+u`, and its square by `(t+u)^2=t^2+2tu+u^2=t^2+(2t+u)u`. Hence, the square of any number is composed of the square of the tens, plus a quantity consisting of twice the tens plus the units, multiplied by the units. Thus the square of 23 is `400+(40+3)*3=400+129=529`. To extract the square root of 529: the greatest square in 5 (hundreds) is 4, whose root is 2; subtracting leaves 129; dividing 12 by twice the root, 4, gives 3; then `43*3=129`, and the root is 23.
art: 189 | Rule | 1. Separate the given number into periods of two places each, beginning at the unit's place. 2. Find the greatest square in the left period, and place its root on the right, after the manner of a quotient in division. Subtract the square of the root from the left period, and to the remainder bring down the next period for a dividend. 3. Double the root already found, and place it on the left for a divisor. Find how many times the divisor is contained in the dividend, exclusive of the right hand figure, and place the figure in the root, and also on the right of the divisor. 4. Multiply the divisor, thus increased, by the last figure of the root; subtract the product from the dividend, and to the remainder bring down the next period for a new dividend. 5. Double the whole root already found for a new divisor, and continue the operation as before, until all the periods are brought down. If the dividend will not contain the divisor, place a cipher in the root, and also at the right of the divisor, and bring down the next period.
art: 190 | | The difference of the squares of two consecutive numbers, `a` and `a+1`, is `2a+1`; that is, twice the less number increased by unity. Hence, when the remainder is less than twice the part of the root already found, plus unity, the last figure can not be increased.
art: 191 | Fractions | Since `2/3*2/3=4/9`, the square root of `4/9` is `2/3`. The square root of a fraction is found by extracting the square root of both terms. Before extracting the square root of a fraction, it should be reduced to its lowest terms, unless both terms are perfect squares: `12/27=4/9`, whose root is `2/3`.
art: 192 | Surds | A Perfect Square is a number whose square root can be exactly ascertained; as, 4, 9, 16. An Imperfect Square is a number whose square root can not be exactly ascertained; as, 2, 3, 5, 6. Between `a^2` and `(a+1)^2` there are always `2a` imperfect squares. A Surd is a root which can not be exactly expressed: `√2` is a surd; it is 1.414+. The square root of an imperfect square can not be a fraction: if `√c=a/b` in lowest terms, `c=a^2/b^2`, which is also in lowest terms and can not be a whole number.
art: 193 | Approximate Roots | To find the square root of 2 to within one third: `2=18/9`; the square root of 18 is greater than 4 and less than 5; so `4/3` is the root of 2 to within less than `1/3`. Rule: multiply the given number by the square of the denominator of the fraction which determines the degree of approximation; extract the square root of this product to the nearest unit, and divide the result by the denominator of the fraction. When the fraction is a decimal, add two ciphers for each decimal place required, extract the root, and point off one place of decimals for each two ciphers added.
art: 194 | | To find the square root of `3/7` to within `1/7`: `3/7=21/49`; the root of 21 is between 4 and 5, so `4/7` is the root to within `1/7`. Multiply the numerator of a fraction by its denominator, extract the square root of the product to the nearest unit, and divide by the denominator. Any decimal may be written as a fraction with a perfect square denominator: annex ciphers until the number of decimal places is double the number required in the root, extract the root, and point off. The square root of 2.5 to 6 places is 1.581138+. When the denominator of a fraction is not a perfect square, reduce the fraction to a decimal first: `√(3/4)=√.75=.86602+`.
mc: When a number has three or four figures, its square root has... | *two figures | one figure | three figures
mc: The square of `t+u` is... | *`t^2+(2t+u)u` | `t^2+u^2` | `2t+u`
mc: To begin, separate the number into periods of... | *two places each | three places each | one place each
mc: The difference of the squares of two consecutive numbers `a` and `a+1` is... | *`2a+1` | 1 | `a+1`
mc: A root which can not be exactly expressed is called a... | *surd | perfect square | fraction
mc: The square root of an imperfect square, like 2, can be... | *only approximated, never a fraction | a fraction in lowest terms | a whole number
tf: The square root of a fraction is found by extracting the square root of both terms. {T}
q: Extract the square root of 529. {23 @= 529/23}
q: Extract the square root of 55225. {235 @= 55225/235}
q: Extract the square root of 4225. {65 @= 4225/65}
q: Extract the square root of 289444. {538 @= 289444/538}
q: Extract the square root of 498436. {706 @= 498436/706}
q: Extract the square root of 950625. {975 @= 950625/975}
q: Extract the square root of 1525225. {1235 @= 1525225/1235}
q: Extract the square root of 412252416. {20304 @= 412252416/20304}
q: Find the square root of `16/36`. {2/3}
q: Find the square root of `81/625`. {9/25}
q: Find the square root of `64/841`. {8/29}
q: Find the square root of `1071/2975`. {3/5}
q: Find the square root of `572/7007`. {2/7}
q: Find the square root of `1369/10000`. {37/100|.37}
q: Find the square root of .018225 (18225 millionths). {.135|27/200}
q: How many imperfect squares are there between 16 and 25? {8}
q: Find the square root of 2 to within one third. {4/3|1 1/3}
q: Find the square root of 5 to within one fifth. {11/5|2 1/5}
q: Of 7 to within one thirteenth. {34/13|2 8/13}
q: Of 27 to within one thirtieth. {5 1/6|5 1/5}
q: Of 14 to within one tenth. {3.7|3 7/10}
q: Of 15 to within one hundredth. {3.87}
q: Find the square root of 2 to six places of decimals. {1.414213|1.414214}
q: Find the square root of 10, to three places of decimals. {3.162}
q: Find the square root of 101, to three places of decimals. {10.049|10.05}
q: Find the square root of `3/7` to within one seventh. {4/7}
q: Find the square root of `4/11` to within one eleventh. {6/11|7/11}
q: Find the square root of `7/15` to within one fifteenth. {10/15|2/3}
q: Find the square root of .6 to six places of decimals. {.774596|.774597}
q: Find the square root of .29 to six places of decimals. {.538516}
q: Find the square root of 2.5 to six places of decimals. {1.581138|1.581139}
q: Find the square root of 10.76 to six places of decimals. {3.280243|3.280244}
q: Find the square root of 1.1025. {1.05}
q: Find the square root of `3/4` to five places of decimals. {.86602|.86603}
q: Find the square root of 3 2/9, to five places of decimals. {1.79505}
q: Find the square root of `7/16`, to five places of decimals. {.66143|.66144}
q: Find the square root of 5 8/9, to five places of decimals. {2.4267|2.42670}
q: Find the square root of `1/7`, to five places of decimals. {.37796}
== 34 | Powers, Roots, and Radicals | Square roots of algebraic quantities
art: 195 | Monomials | To square a monomial, we square its coefficient, and multiply the exponent of each letter by 2. Thus, `(3ab^2)^2=9a^2b^4`; therefore, `√(9a^2b^4)=3ab^2`. Rule: extract the square root of the coefficient, and divide the exponent of each letter by 2. Since `+a*+a=+a^2`, and `-a*-a=+a^2`, the square root of any positive quantity is either plus or minus; this is expressed by the double sign: `√(4a^2)=±2a`, read plus or minus `2a`. If a monomial is negative, the extraction of the square root is impossible, since the square of any quantity is positive. `√-9` and `√(-4a^2)` are termed imaginary quantities; when they result from a problem, they indicate some absurdity or impossibility. To find the square root of a fraction, extract the square root of both terms.
art: 196 | Polynomials | `(a+b)^2=a^2+(2a+b)b`; `(a+b+c)^2=a^2+(2a+b)b+(2a+2b+c)c`. The square of any polynomial is equal to the square of the first term, plus twice the first term, plus the second, multiplied by the second, plus twice the first and second terms, plus the third, multiplied by the third; and so on. Rule: 1. Arrange the polynomial with reference to a certain letter. 2. Extract the square root of the first term, place the result on the right, and subtract its square from the given quantity. 3. Divide the first term of the remainder by double the root already found, and annex the result both to the root and the divisor. Multiply the divisor thus increased by the second term of the root, and subtract the product from the remainder. 4. Double the terms of the root already found, for a partial divisor, divide the first term of the remainder by the first term of the divisor, and annex the result both to the root and the partial divisor. Multiply the divisor thus increased, by the third term of the root, and subtract. 5. Proceed in a similar manner until the work is finished. If the first term of any remainder is not exactly divisible by double the first term of the root, the polynomial is not a perfect square.
art: 197 | Remarks | No binomial can be a perfect square; for the square of a monomial is a monomial, and the square of a binomial is a trinomial. Thus, `a^2+b^2` is not a perfect square; but if we add to it `2ab`, it becomes the square of `a+b`. In order that a trinomial may be a perfect square, the extreme terms must be perfect squares, and the middle term twice the product of the square roots of the extreme terms. To find the square root of such a trinomial, extract the square roots of the two extreme terms, and unite them by the sign plus or minus, according as the second term is plus or minus. Thus, `4a^2-12ac+9c^2` is a perfect square, root `2a-3c`; but `9x^2+12xy+16y^2` is not, since `3x*4y*2=24xy`.
mc: To find the square root of a monomial, divide the exponent of each letter by... | *2 | 3 | the coefficient
mc: `√(4a^2)` is... | *plus or minus `2a` | only `2a` | `4a`
mc: The square root of a negative monomial, like `√-9`, is called... | *an imaginary quantity | a surd | a perfect square
mc: Can a binomial be a perfect square? | *No | Yes, always | Only if both terms are squares
mc: Which trinomial is a perfect square? | *`4a^2-12ac+9c^2` | `9x^2+12xy+16y^2` | `a^2+ab+b^2`
tf: If the first term of a remainder is not divisible by double the first term of the root, the polynomial is not a perfect square. {T}
q: Find the square root of `9a^2b^4`. {$ 3ab^2 @sq: 9a^2b^4}
q: Find the square root of `4a^2x^2`. {$ 2ax @sq: 4a^2x^2}
q: Find the square root of `9x^2y^4`. {$ 3xy^2 @sq: 9x^2y^4}
q: Find the square root of `36a^4b^6x^2`. {$ 6a^2b^3x @sq: 36a^4b^6x^2}
q: Find the square root of `49a^2b^4c^8`. {$ 7ab^2c^4 @sq: 49a^2b^4c^8}
q: Find the square root of `625x^2z^4`. {$ 25xz^2 @sq: 625x^2z^4}
q: Find the square root of `1156a^2x^4z^6`. {$ 34ax^2z^3 @sq: 1156a^2x^4z^6}
q: Find the square root of `16x^2y^4/(25a^2z^2)`. {$ 4xy^2/(5az) @sq: 16x^2y^4/(25a^2z^2)}
q: Find the square root of `r^2+2rs+s^2+2rt+2st+t^2`. {$ r+s+t @sq: (r+s+t)^2}
q: Find the square root of `25x^2y^2-24xy^3-12x^3y+4x^4+16y^4`. {$ 2x^2-3xy+4y^2 @sq: (2x^2-3xy+4y^2)^2}
q: Find the square root of `x^2+4x+4`. {$ x+2 @sq: x^2+4x+4}
q: Find the square root of `x^2y^2-8xy+16`. {$ xy-4 @sq: (xy-4)^2}
q: Find the square root of `4a^2x^2+25y^2z^2-20axyz`. {$ 2ax-5yz @sq: (2ax-5yz)^2}
q: Find the square root of `x^4+4x^3+6x^2+4x+1`. {$ x^2+2x+1 @sq: (x^2+2x+1)^2}
q: Find the square root of `9y^4-12y^3+34y^2-20y+25`. {$ 3y^2-2y+5 @sq: (3y^2-2y+5)^2}
q: Find the square root of `1-4x+10x^2-20x^3+25x^4-24x^5+16x^6`. {$ 1-2x+3x^2-4x^3 @sq: (1-2x+3x^2-4x^3)^2}
q: Find the square root of `a^6-6a^5x+15a^4x^2-20a^3x^3+15a^2x^4-6ax^5+x^6`. {$ a^3-3a^2x+3ax^2-x^3 @sq: (a-x)^6}
q: Find the square root of `x^2+ax+a^2/4`. {$ x+a/2 @sq: x^2+ax+a^2/4}
q: Find the square root of `x^2-2x+1+2xy-2y+y^2`. {$ x-1+y @sq: (x-1+y)^2}
q: Find the square root of `x(x+1)(x+2)(x+3)+1`. {$ x^2+3x+1 @sq: x*(x+1)*(x+2)*(x+3)+1}
q: What must be added to `a^2+b^2` to make it the square of `a+b`? {$ 2ab}
q: Find the square root of `4a^2-12ac+9c^2`. {$ 2a-3c @sq: (2a-3c)^2}
== 35 | Powers, Roots, and Radicals | Radicals: reducing, adding, subtracting
note: On the pad, put what is under the root in brackets: √(3a). √3a means a times √3.
art: 198 | Radicals | When a monomial is a perfect square, its numeral coefficient is a perfect square, and the exponent of each letter is exactly divisible by 2. Thus, `4a^2` is a perfect square, while `5a^3` is not. When the exact division of the exponent can not be performed, it may be indicated: `√(a^3)` may be written `a` to the three halves power. The square root of `a` may be expressed `a` to the one half power; the fractional exponent one half indicates the extraction of the square root. Radicals of the Second Degree are quantities affected by a square root sign whose root can not be exactly found; as, `√a`, `√2`, `a√b`, and `5√3`. Radicals are also called irrational quantities, or surds. The Coefficient of a radical is the quantity which stands before the radical sign: in `a√b` and `3√5`, `a` and 3 are coefficients. Similar Radicals are those which have the same quantity under the radical sign: `3√2` and `7√2` are similar; so, also, are `b√a` and `2c√a`.
art: 199 | Reduction | Reduction of radicals of the second degree consists in changing the form of the quantities without altering their value. It is founded on this principle: the square root of the product of two or more factors is equal to the product of the square roots of those factors. Thus `√(ab)=√a*√b`, and `√36=√9*√4=3*2=6`. Any radical can be reduced to a simpler form when it can be separated into factors, one of which is a perfect square: `√12=√4*√3=2√3`; `√(a^3b)=a√(ab)`; `√(27a^3c^4)=3ac^2√(3a)`. Rule: 1. Separate the quantity into two parts, one of which shall contain all the factors that are perfect squares. 2. Extract the square root of the part that is a perfect square, and prefix it as a coefficient to the other part placed under the radical sign. To reduce a fractional radical, multiply both terms by any quantity that will render the denominator a perfect square: `√(2/3)=√(6/9)=(1/3)√6`. Any quantity may be reduced to the form of a radical of the second degree by squaring it and placing it under the radical sign: `2√3=√12`.
art: 200 | Addition | `3√2+5√2=8√2`. Dissimilar radicals can only be added by placing the sign of addition between them: `2√3+5√7`. Sometimes radicals become similar after being reduced: `√2+√8=√2+2√2=3√2`. Rule: 1. Reduce the radicals to their simplest form. 2. If the radicals are similar, add the coefficients, and annex the common radicals. 3. If they are not similar, connect them by their proper signs.
art: 201 | Subtraction | `5√2-3√2=2√2`; `√8-√2=2√2-√2=√2`. If the radicals are dissimilar, their difference can only be indicated: `5√b-3√a`. Rule: 1. Reduce the radicals to their simplest form. 2. If the radicals are similar, find the difference of their coefficients, and annex the common radical. 3. If not similar, indicate their difference by the proper sign.
mc: Which is a perfect square? | *`4a^2` | `5a^3` | `8a^2`
mc: Radicals are also called... | *surds, or irrational quantities | perfect squares | exponents
mc: In `3√5`, the 3 is the... | *coefficient | radical | index
mc: Which are similar radicals? | *`3√2` and `7√2` | `3√2` and `3√7` | `√a` and `√b`
mc: `√12` in simplest form is... | *`2√3` | `3√2` | `4√3`
mc: `√(ab)` equals... | *`√a*√b` | `√a+√b` | `ab`
mc: `2√3+5√7`... | *can not be put in one term | is `7√10` | is `7√21`
tf: `√2+√8=3√2` {T}
q: Reduce `√(8a^2)` to its simplest form. {$ 2a√2 @sq: 8a^2}
q: Reduce `√(12a^3)`. {$ 2a√(3a) @sq: 12a^3}
q: Reduce `√(20a^3b^3c^3)`. {$ 2abc√(5abc) @sq: 20a^3b^3c^3}
q: Reduce `4√(27a^3c^3)`. {$ 12ac√(3ac) @sq: 16*27a^3c^3}
q: Reduce `7√(28a^5c^2)`. {$ 14a^2c√(7a) @sq: 49*28a^5c^2}
q: Reduce `√(32a^6b^2c^4)`. {$ 4a^3bc^2√2 @sq: 32a^6b^2c^4}
q: Reduce `√(44a^5b^3c)`. {$ 2a^2b√(11abc) @sq: 44a^5b^3c}
q: Reduce `√(48a^8b^6c^4)`. {$ 4a^4b^3c^2√3 @sq: 48a^8b^6c^4}
q: Reduce `√(75a^3b^3c^3)`. {$ 5abc√(3abc) @sq: 75a^3b^3c^3}
q: Reduce `√(243a^3b^2c)`. {$ 9ab√(3ac) @sq: 243a^3b^2c}
q: Reduce `√(2/3)` to its simplest form. {$ √6/3 | (1/3)√6 @sq: 2/3}
q: Reduce `√(3/5)`. {$ √15/5 | (1/5)√15 @sq: 3/5}
q: Reduce `√(7/8)`. {$ √14/4 | (1/4)√14 @sq: 7/8}
q: Reduce `√(12/25)`. {$ 2√3/5 | (2/5)√3 @sq: 12/25}
q: Reduce `9√(16/27)`. {$ 4√3 @sq: 81*16/27}
q: Reduce `5√(9/10)`. {$ 3√10/2 | (3/2)√10 @sq: 25*9/10}
q: Reduce `10√(8/50)`. {4 @= 10*√(8/50)}
q: Reduce 5 to the form of a radical of the second degree. {$ √25 @ 5}
q: Reduce `2a` to the form of a radical of the second degree. {$ √(4a^2) @ 2a}
q: Express `3√5` entirely under the radical. {$ √45 @ 3√5}
q: Pass the coefficient of `3c√(2c)` under the radical. {$ √(18c^3) @ 3c√(2c)}
q: What is the sum of `3√2` and `5√2`? {$ 8√2 @ 3√2+5√2}
q: What is the sum of `2√3` and `5√7`? {$ 2√3+5√7}
q: Find the sum of `√8` and `√18`. {$ 5√2 @ √8+√18}
q: Find the sum of `√12` and `√27`. {$ 5√3 @ √12+√27}
q: Find the sum of `√20` and `√80`. {$ 6√5 @ √20+√80}
q: Find the sum of `√40`, `√90`, and `√250`. {$ 10√10 @ √40+√90+√250}
q: Find the sum of `√(28a^2b^2)` and `√(112a^2b^2)`. {$ 6ab√7 @ √(28a^2b^2)+√(112a^2b^2)}
q: Find the sum of `√(1/3)` and `√(3/25)`. {$ 8√3/15 | (8/15)√3 @ √(1/3)+√(3/25)}
q: Find the sum of `2√(3/4)` and `3√12`. {$ 7√3 @ 2√(3/4)+3√12}
q: Find the sum of `(1/2)√(1/2)` and `(3/4)√2`. {$ √2 @ (1/2)√(1/2)+(3/4)√2}
q: Find the sum of `√(48a^2c^2x)` and `√(12b^2x)`. {$ 4ac√(3x)+2b√(3x) | (4ac+2b)√(3x) @ √(48a^2c^2x)+√(12b^2x)}
q: Find the sum of `√(2a^3-4a^2c+2ac^2)` and `√(2a^3+4a^2c+2ac^2)`, when `a` is greater than `c`. {$ 2a√(2a)}
q: Find the sum of `√(a+x)+√(ax^2+x^3)+√((a+x)^3)`. {$ (1+a+2x)√(a+x) @ √(a+x)+√(a*x^2+x^3)+√((a+x)^3)}
q: Take `3√2` from `5√2`. {$ 2√2 @ 5√2-3√2}
q: Find `√8-√2`. {$ √2 @ √8-√2}
q: Find `√32-√8`. {$ 2√2 @ √32-√8}
q: Find `√(45a^2)-√(5a^2)`. {$ 2a√5 @ √(45a^2)-√(5a^2)}
q: Find `√(54b)-√(6b)`. {$ 2√(6b) @ √(54b)-√(6b)}
q: Find `√(27b^3c^3)-√(12b^3c^3)`. {$ bc√(3bc) @ √(27b^3c^3)-√(12b^3c^3)}
q: Find `√(49ab^3c^2)-√(25ab^3c^2)`. {$ 2bc√(ab) @ √(49ab^3c^2)-√(25ab^3c^2)}
q: Find `5a√27-3a√48`. {$ 3a√3 @ 5a√27-3a√48}
q: Find `2√(3/4)-3√(1/3)`. {$ 0 @ 2√(3/4)-3√(1/3)}
q: Find `√(5/6)-√(10/27)`. {$ √30/18 | (1/18)√30 @ √(5/6)-√(10/27)}
q: Find `3√(1/2)-√2`. {$ √2/2 | (1/2)√2 @ 3√(1/2)-√2}
q: Find `√(4a^2x)-a√(x^3)`. {$ 2a√x-ax√x | (2a-ax)√x @ √(4a^2x)-a√(x^3)}
q: Find `√(3m^2x+6mnx+3n^2x)-√(3m^2x-6mnx+3n^2x)`, when `m` is greater than `n`. {$ 2n√(3x)}
== 36 | Powers, Roots, and Radicals | Radicals: multiplying and dividing
note: On the pad, put what is under the root in brackets: √(3a). √3a means a times √3.
art: 202 | Multiplication | Since `√(ab)=√a*√b`, therefore `√a*√b=√(ab)`. Also, `a√b*c√d=ac√(bd)`. Rule: multiply the coefficients together for a new coefficient, and the quantities under the radical sign for a new radical. Thus `√6*√8=√48=4√3`; and `2√14*3√2=6√28=12√7`. When two polynomials contain radicals, they may be multiplied as in multiplication of polynomials.
art: 203 | Division | Since `√a*√b=√(ab)`, therefore `√(ab)÷√a=√b`. Also, since `2√3*3√15=6√45`, therefore `6√45÷2√3=3√15`. Rule: divide the coefficient of the dividend by the coefficient of the divisor for a new coefficient, and the radical of the dividend by the radical of the divisor for a new radical. Thus `8√72÷2√6=4√12=8√3`.
art: 204 | Rational Denominators | Since `√a*√a=a`, when the square root of a quantity is multiplied by itself, or squared, the radical sign is thrown off: `√2*√2=2`. When the fraction is of the form `a/√b`, multiply both terms by `√b`: `a/√b=a√b/b`. Since the sum of two quantities, multiplied by their difference, is equal to the difference of their squares, if the denominator is `b+√c`, multiply both terms by `b-√c`; the denominator becomes `b^2-c`. General Rule: if the denominator is a monomial, multiply both terms by it; but if it is a binomial, multiply both terms by the denominator, with the sign of the second term changed. The object is to diminish the amount of calculation in obtaining the numerical value of a fractional radical: `√2/√3=√6/3`, and we need only find the square root of 6 and divide by 3.
mc: `√a*√b` equals... | *`√(ab)` | `√(a+b)` | `ab`
mc: `√2*√2` equals... | *2 | 4 | `√4*2`
mc: To make the denominator of `a/√b` rational, multiply both terms by... | *`√b` | `b` | `a`
mc: To make the denominator `b+√c` rational, multiply both terms by... | *`b-√c` | `b+√c` | `√c`
tf: `6√45÷2√3=3√15` {T}
q: Find the product of `√6` and `√8`. {$ 4√3 @ √6*√8}
q: Find the product of `2√14` and `3√2`. {$ 12√7 @ 2√14*3√2}
q: Find the product of `√8` and `√2`. {4 @= √8*√2}
q: Find the product of `2√a` and `3√a`. {$ 6a @ 2√a*3√a}
q: Find the product of `√27` and `√3`. {9 @= √27*√3}
q: Find the product of `3√2` and `2√3`. {$ 6√6 @ 3√2*2√3}
q: Find the product of `2√15` and `3√35`. {$ 30√21 @ 2√15*3√35}
q: Find the product of `√(a^3b^5c)` and `√(abc)`. {$ a^2b^3c @ √(a^3b^5c)*√(abc)}
q: Find the product of `√(2/5)` and `√(8/9)`. {$ 4√5/15 | (4/15)√5 @ √(2/5)*√(8/9)}
q: Find the product of `2√(a/5)` and `3√(a/10)`. {$ 3a√2/5 | (3/5)a√2 @ 2√(a/5)*3√(a/10)}
q: Find the product of `2+√2` and `2-√2`. {2 @= (2+√2)*(2-√2)}
q: Find the product of `√(x+2)` by `√(x-2)`. {$ √(x^2-4) @ √(x+2)*√(x-2)}
q: Find the product of `√(a+x)` by `√(a+x)`. {$ a+x @ √(a+x)*√(a+x)}
q: Find the product of `√(x+2)` by `√(x+3)`. {$ √(x^2+5x+6) @ √(x+2)*√(x+3)}
q: Find `(c√a+d√b)(c√a-d√b)`. {$ ac^2-bd^2 @ (c√a+d√b)*(c√a-d√b)}
q: Find `(7+2√6)(9-5√6)`. {$ 3-17√6 @ (7+2√6)*(9-5√6)}
q: Find `(√(a+x)+√(a-x))(√(a+x)-√(a-x))`. {$ 2x @ (√(a+x)+√(a-x))*(√(a+x)-√(a-x))}
q: Find `(x^2-x√2+1)(x^2+x√2+1)`. {$ x^4+1 @ (x^2-x√2+1)*(x^2+x√2+1)}
q: Divide `8√72` by `2√6`. {$ 8√3 @ 8√72/(2√6)}
q: Divide `√54` by `√6`. {3 @= √54/√6}
q: Divide `6√54` by `3√27`. {$ 2√2 @ 6√54/(3√27)}
q: Divide `√160` by `√8`. {$ 2√5 @ √160/√8}
q: Divide `15√378` by `5√6`. {$ 9√7 @ 15√378/(5√6)}
q: Divide `ab√(a^3b^3)` by `b√(ab)`. {$ a^2b @ a*b*√(a^3b^3)/(b√(ab))}
q: Divide `√(a/b)` by `√(d/c)`. {$ √(abcd)/(bd) @ √(a/b)/√(d/c)}
q: Divide `√(1/2)` by `√(1/3)`. {$ √6/2 | (1/2)√6 @ √(1/2)/√(1/3)}
q: Divide `(2/3)√18` by `(1/2)√2`. {4 @= (2/3)*√18/((1/2)*√2)}
q: Divide `(3/5)√(1/3)` by `(1/2)√(3/5)`. {$ 2√5/5 | (2/5)√5 @ (3/5)*√(1/3)/((1/2)*√(3/5))}
q: Divide `(1/2)√(1/2)` by `√2+3√(1/2)`. {1/10 @= (1/2)*√(1/2)/(√2+3*√(1/2))}
q: Reduce `1/√2` to an equivalent fraction having a rational denominator. {$ √2/2 | (1/2)√2 @ 1/√2}
q: Reduce `√2/√3` to a rational denominator. {$ √6/3 | (1/3)√6 @ √2/√3}
q: Reduce `3/(6-√3)` to a rational denominator. {$ (6+√3)/11 @ 3/(6-√3)}
q: Reduce `5/(√7+√6)` to a rational denominator. {$ 5√7-5√6 | 5(√7-√6) @ 5/(√7+√6)}
q: Find the numerical value of `3/√5`, to six places of decimals. {1.341641|1.34164}
q: Find the numerical value of `√2/(√5-√3)`, to six places of decimals. {2.805884|2.805883}
== 37 | Powers, Roots, and Radicals | Equations with radicals
art: 205 | | In the solution of questions involving radicals, much will depend on the judgment and practice of the pupil, as almost every question can be solved in several ways. 1st. When the equation contains one radical expression, transpose it to one side of the equation, and the rational terms to the other, then involve both sides. If `√(x-1)-1=2`: transposing, `√(x-1)=3`; squaring, `x-1=9`; `x=10`. 2d. When more than one expression is under the radical sign, the operation must be repeated: `a+x=√(a^2+x√(c^2+x^2))`; squaring, `a^2+2ax+x^2=a^2+x√(c^2+x^2)`; dividing by `x`, `2a+x=√(c^2+x^2)`; squaring, `x=(c^2-4a^2)/(4a)`. 3d. When there are two radical expressions, place one of them alone on one side, before squaring: `√(x-5)-3=4-√(x-12)`; transposing, `√(x-5)=7-√(x-12)`; squaring, `x-5=49-14√(x-12)+x-12`; reducing, `14√(x-12)=42`; `√(x-12)=3`; `x=21`.
mc: When an equation has one radical, first... | *put the radical alone on one side, then square both sides | square at once | divide by the radical
mc: When there are two radicals, before squaring... | *place one of them alone on one side | add them | multiply them
tf: In `√(x-1)-1=2`, `x=10`. {T}
q: Find `x`: `√(x-1)-1=2`. {10 @x: √(x-1)-1=2}
q: Find `x`: `√(x-5)-3=4-√(x-12)`. {21 @x: √(x-5)-3=4-√(x-12)}
q: Find `x`: `√(x+3)+3=7`. {13 @x: √(x+3)+3=7}
q: Find `x`: `x+√(x^2+11)=11`. {5 @x: x+√(x^2+11)=11}
q: Find `x`: `√(6+√(x-1))=3`. {10 @x: √(6+√(x-1))=3}
q: Find `x`: `√(x(a+x))=a-x`. {$ a/3 @x: √(x*(a+x))=a-x}
q: Find `x`: `√x-2=√(x-8)`. {9 @x: √x-2=√(x-8)}
q: Find `x`: `x+√(x^2-7)=7`. {4 @x: x+√(x^2-7)=7}
q: Find `x`: `√(x+7)=6-√(x-5)`. {9 @x: √(x+7)=6-√(x-5)}
q: Find `x`: `√(x-a)=√x-(1/2)√a`. {$ 25a/16 @x: √(x-a)=√x-√a/2}
q: Find `x`: `√(x+225)-√(x-424)-11=0`. {1000 @x: √(x+225)-√(x-424)-11=0}
q: Find `x`: `x+√(2ax+x^2)=a`. {$ a/4 @x: x+√(2a*x+x^2)=a}
q: Find `x`: `√(x+a)-√(x-a)=√a`. {$ 5a/4 @x: √(x+a)-√(x-a)=√a}
q: Find `x`: `√(x+12)=2+√x`. {4 @x: √(x+12)=2+√x}
q: Find `x`: `√(8+x)=2√(1+x)-√x`. {1/3}
sol: Squaring, 8 + x = 4(1 + x) - 4 times the square root of x plus x squared, plus x; so the square root of x plus x squared = x - 1; squaring, x = 1/3.
q: Find `x`: `√(5x)+12/√(5x+6)=√(5x+6)`. {2/5}
q: Find `x`: `√x-4=(237-10x)/(4+√x)`. {23 @x: √x-4=(237-10x)/(4+√x)}
q: Find `x`: `√(x^2+√(4x^2+x+√(9x^2+12x)))=1+x`. {1/6 @x: √(x^2+√(4x^2+x+√(9x^2+12x)))=1+x}
q: Find `x`: `√(a+√(ax))=√a-√(a-√(ax))`. {$ 3a/4}
q: Find `x`: `b(√x+√b)=a(√x-√b)`, when `a` is greater than `b`. {$ b(a+b)^2/(a-b)^2}
q: Find `x`: `√x+√(ax)=a-1`, when `a` is greater than 1. {$ (√a-1)^2 | a-2√a+1}
== 38 | Quadratic Equations | Pure quadratics
note: Every pure quadratic has two roots, equal but with contrary signs. Type the plus value; the minus value is the same number with a minus sign.
art: 206 | Quadratic Equation | A Quadratic Equation is an equation of the second degree in which the highest power of the unknown quantity is a square; as, `x^2=9`, and `5x^2+3x=26`. An equation containing two or more unknown quantities is of the second degree, when the sum of the exponents of the unknown quantities in any term is 2; as, `xy=6`, `x^2+xy=8`, and `xy+x+y=11`.
art: 207 | Pure and Affected | Quadratic equations are of two kinds, pure and affected. A Pure Quadratic Equation is one that contains the second power only of the unknown quantity, and known terms; as, `x^2=9`, and `8x^2-5x^2=12`. It is also called an incomplete equation of the second degree. An Affected Quadratic Equation is one that contains both the first and second powers of the unknown quantity, and known terms; as, `3x^2+4x=20`. It is also called a complete equation of the second degree.
art: 208 | | Every quadratic equation may be reduced to one of the forms `ax^2=b`, or `ax^2+bx=c`. In a pure quadratic, all the terms containing `x^2` may be collected together. In an affected quadratic, the terms containing `x^2` may be reduced to one term, those containing `x` to one, and the known terms to one.
art: 209 | Pure Quadratics | Find `x` in `x^2-16=0`. Transposing, `x^2=16`; extracting the square root of both members, `x=±4`; that is, `x=+4`, or `-4`. Verification: `(+4)^2-16=0`, and `(-4)^2-16=0`. Find `x` in `5x^2+4=49`: `5x^2=45`; `x^2=9`; `x=±3`. Given `ax^2+b=cx^2+d`: `(a-c)x^2=d-b`; `x^2=(d-b)/(a-c)`; `x` equals plus or minus the square root of `(d-b)/(a-c)`. Rule: reduce the equation to the form `ax^2=b`. Divide both sides by the coefficient of `x^2`, and extract the square root of both members.
art: 210 | | In `ax^2=b`, if we assume `b/a=m^2`, then `x^2-m^2=0`, or `(x+m)(x-m)=0`. When the product of two factors is 0, one of the factors must be 0. Hence this equation can be satisfied in two ways, and in two only: `x=+m`, or `x=-m`. 1. Every pure quadratic equation has two roots, and only two. 2. These roots are equal, but have contrary signs.
mc: `x^2=9` is... | *a pure quadratic | an affected quadratic | a simple equation
mc: `3x^2+4x=20` is... | *an affected quadratic | a pure quadratic | a simple equation
mc: `xy=6` is an equation of the... | *second degree | first degree | third degree
mc: How many roots has every pure quadratic equation? | *two | one | four
mc: The two roots of a pure quadratic are... | *equal, with contrary signs | always both positive | unequal
mc: In `x^2=16`, `x` is... | *plus or minus 4 | only 4 | 8
tf: When the product of two factors is 0, one of the factors must be 0. {T}
q: Find `x` in `x^2-16=0`. x = plus or minus {4 @x: x^2-16=0}
q: Find `x` in `5x^2+4=49`. x = plus or minus {3 @x: 5x^2+4=49}
q: Find `x` in `2x^2/3+3x^2/4=5 2/3`. x = plus or minus {2 @x: 2x^2/3+3x^2/4=17/3}
q: Find `x` in `x^2-8=28`. x = plus or minus {6 @x: x^2-8=28}
q: Find `x` in `3x^2-15=83+x^2`. x = plus or minus {7 @x: 3x^2-15=83+x^2}
q: Find `x` in `a^2x^2-b^2=0`. x = plus or minus {$ b/a @x: a^2x^2-b^2=0}
q: Find `x` in `x^2/3-1=4x^2/27+2/3`. x = plus or minus {3 @x: x^2/3-1=4x^2/27+2/3}
q: Find `x` in `5x^2/3+12=8x^2/7+37 2/3`. x = plus or minus {7 @x: 5x^2/3+12=8x^2/7+113/3}
q: Find `x` in `ax^2-b=(a-b)x^2+c`. x = plus or minus {$ √((b+c)/b) | √(b^2+bc)/b @x: a*x^2-b=(a-b)*x^2+c}
q: Find `x` in `(x-a)/a-(a-2x)/(x-a)=(x^2+bx)/(x^2-a^2)`. x = plus or minus {$ √(ab) @x: (x-a)/a-(a-2x)/(x-a)=(x^2+b*x)/(x^2-a^2)}
q: Find a number whose two thirds multiplied by its two fifths, equals 60. {15 @x: (2x/3)*(2x/5)=60}
q: What number is that, of which the product of its third and fourth parts is equal to 108? {36 @x: (x/3)*(x/4)=108}
q: What number is that whose square diminished by 16, is equal to half its square increased by 16? {8 @x: x^2-16=x^2/2+16}
q: What number is that, which being divided by 9, gives the same quotient as 16 divided by the number? {12 @x: x/9=16/x}
q: What two numbers are to each other as 3 to 5, and the difference of whose squares is 64? {6} {10}
chk: x=2 | 25x^2-9x^2=64
q: What two numbers are to each other as 3 to 4, the difference of whose squares is 63? {9} {12}
chk: x=3 | 16x^2-9x^2=63
q: The breadth of a lot is to its length as 5 to 9, and it contains 1620 square feet; required the breadth {30} and length {54}
chk: x=6 | 5x*9x=1620
q: Find two numbers whose sum is to the greater as 10 to 7, and whose sum, multiplied by the less, is 270. The greater {21} the less {9}
chk: x=3 | 10x*3x=270
q: What two numbers are those, whose difference is to the greater as 2 to 9, and the difference of whose squares is 128? The greater {18} the less {14}
chk: x=2 | 81x^2-49x^2=128
q: A person bought a piece of muslin for $3 and 24 cents, and the number of cents which he paid for a yard, was to the number of yards as 4 to 9; how many yards did he buy {27} and what was the price per yard, in cents {12}
chk: x=3 | 4x*9x=324
q: Find two numbers in the ratio of one half to two thirds, the sum of whose squares is 225. {9} {12}
chk: x=3 | 9x^2+16x^2=225
q: Find three numbers in the proportion of one half, two thirds, and three fourths, the sum of whose squares is 724. {12} {16} {18}
chk: x=2 | 36x^2+64x^2+81x^2=724
== 39 | Quadratic Equations | Affected quadratics: completing the square
note: A quadratic has two values of x; type them in either order. Use the minus key for a minus value.
art: 211 | Affected Quadratics | Find the values of `x` in `x^2-4x+4=1`. The first member is a perfect square. Extracting the square root of both members, `x-2=±1`; whence `x=2±1=3`, or 1. Either value verifies the equation. Find `x` in `x^2+6x=16`. The first member will become a perfect square if 9 be added to it. Adding 9 to each member, `x^2+6x+9=25`; extracting the square root, `x+3=±5`; whence `x=-3±5=+2`, or `-8`. Either of which values will verify the equation.
art: 212 | The Four Forms | Every affected quadratic equation is of the form `ax^2+bx=c`. Dividing by `a`, and making the term in `x^2` positive, there can be but four forms: `x^2+2px=q`; `x^2-2px=q`; `x^2+2px=-q`; `x^2-2px=-q`. The square of a binomial is the square of the first term, plus twice the product of the first term by the second, plus the square of the second. If we consider `x^2+2px` as the first two terms of such a square, dividing `2px` by `2x` gives `p`, half the coefficient of `x`, the second term of the binomial; its square, `p^2`, added to both sides, completes the square: `x^2+2px+p^2=q+p^2`; `x+p` = plus or minus the square root of `q+p^2`; and `x=-p` plus or minus the square root of `q+p^2`.
art: 212 | Rule | To solve an affected quadratic equation: 1. Reduce the equation, by clearing of fractions and transposition if necessary, to the form `ax^2+bx=c`. 2. Make the first term positive, if it is not so already. 3. Divide each side of the equation by the coefficient of `x^2`. 4. Add to each member the square of half the coefficient of `x`. 5. Extract the square root of both sides. 6. Transpose the known term to the second member.
art: 212 | Example | Find `x` in `12x^2/5+x=52+13x/5`. Clearing of fractions, `12x^2+5x=260+13x`; transposing and reducing, `12x^2-8x=260`; dividing, `x^2-2x/3=65/3`. Half of `-2/3` is `-1/3`, whose square is `1/9`: `x^2-2x/3+1/9=196/9`; extracting the root, `x-1/3=±14/3`; whence `x=5`, or `-13/3`.
mc: To complete the square of `x^2+6x`, add... | *9 | 6 | 36
mc: To complete the square, add to each side the square of... | *half the coefficient of `x` | the coefficient of `x` | the known term
mc: Before completing the square, divide each side by... | *the coefficient of `x^2` | the known term | 2
mc: How many values has `x` in an affected quadratic? | *two | one | four
tf: In `x^2+6x=16`, `x=2` or `x=-8`. {T}
q: Find the values of `x` in `x^2-4x+4=1`. x = {$ 3 @x: x^2-4x+4=1} or {$ 1 @x: x^2-4x+4=1}
q: Find the values of `x` in `x^2+6x=16`. x = {$ 2 @x: x^2+6x=16} or {$ -8 @x: x^2+6x=16}
q: Find the values of `x` in `x^2+8x=33`. x = {$ 3 @x: x^2+8x=33} or {$ -11 @x: x^2+8x=33}
q: Find the values of `x` in `x^2-6x=16`. x = {$ 8 @x: x^2-6x=16} or {$ -2 @x: x^2-6x=16}
q: Find the values of `x` in `x^2+6x=-5`. x = {$ -1 @x: x^2+6x=-5} or {$ -5 @x: x^2+6x=-5}
q: Find the values of `x` in `x^2-10x=-24`. x = {$ 6 @x: x^2-10x=-24} or {$ 4 @x: x^2-10x=-24}
q: Find the values of `x` in `3x-5=(7x+36)/x`. x = {$ 6 @x: 3x-5=(7x+36)/x} or {$ -2 @x: 3x-5=(7x+36)/x}
q: Find the values of `x` in `12x^2/5+x=52+13x/5`. x = {$ 5 @x: 12x^2/5+x=52+13x/5} or {$ -13/3 @x: 12x^2/5+x=52+13x/5}
q: Find the values of `x` in `x^2+8x=20`. x = {$ 2 @x: x^2+8x=20} or {$ -10 @x: x^2+8x=20}
q: Find the values of `x` in `x^2+16x=80`. x = {$ 4 @x: x^2+16x=80} or {$ -20 @x: x^2+16x=80}
q: Find the values of `x` in `x^2+3x=28`. x = {$ 4 @x: x^2+3x=28} or {$ -7 @x: x^2+3x=28}
q: Find the values of `x` in `x^2-10x=24`. x = {$ 12 @x: x^2-10x=24} or {$ -2 @x: x^2-10x=24}
q: Find the values of `x` in `x^2-5x=6`. x = {$ 6 @x: x^2-5x=6} or {$ -1 @x: x^2-5x=6}
q: Find the values of `x` in `x^2+6x=-8`. x = {$ -2 @x: x^2+6x=-8} or {$ -4 @x: x^2+6x=-8}
q: Find the values of `x` in `x^2+7x=-12`. x = {$ -3 @x: x^2+7x=-12} or {$ -4 @x: x^2+7x=-12}
q: Find the values of `x` in `x^2-8x=-15`. x = {$ 5 @x: x^2-8x=-15} or {$ 3 @x: x^2-8x=-15}
q: Find the values of `x` in `x^2-15x=-54`. x = {$ 9 @x: x^2-15x=-54} or {$ 6 @x: x^2-15x=-54}
q: Find the values of `x` in `3x^2-2x+123=256`. x = {$ 7 @x: 3x^2-2x+123=256} or {$ -19/3 @x: 3x^2-2x+123=256}
q: Find the values of `x` in `2x^2-5x=12`. x = {$ 4 @x: 2x^2-5x=12} or {$ -3/2 @x: 2x^2-5x=12}
q: Find the values of `x` in `2x^2/3-5x/2=2/3`. x = {$ 4 @x: 2x^2/3-5x/2=2/3} or {$ -1/4 @x: 2x^2/3-5x/2=2/3}
q: Find the values of `x` in `x^2-x-40=170`. x = {$ 15 @x: x^2-x-40=170} or {$ -14 @x: x^2-x-40=170}
q: Find the values of `x` in `x/4-44/(x-2)=4`. x = {$ 24 @x: x/4-44/(x-2)=4} or {$ -6 @x: x/4-44/(x-2)=4}
q: Find the values of `x` in `5x^2/6-x/2+3/4=8-2x/3-x^2+273/12`. x = {$ 4 @x: 5x^2/6-x/2+3/4=8-2x/3-x^2+273/12} or {$ -45/11 @x: 5x^2/6-x/2+3/4=8-2x/3-x^2+273/12}
q: Find the values of `x` in `x^2+x=30`. x = {$ 5 @x: x^2+x=30} or {$ -6 @x: x^2+x=30}
q: Find the values of `x` in `x/2+2/x=x/4+3/2`. x = {$ 4 @x: x/2+2/x=x/4+3/2} or {$ 2 @x: x/2+2/x=x/4+3/2}
q: Find the values of `x` in `2x^2+92=31x`. x = {$ 23/2 @x: 2x^2+92=31x} or {$ 4 @x: 2x^2+92=31x}
q: Find the values of `x` in `-x^2+x=6/25`. x = {$ 3/5 @x: -x^2+x=6/25} or {$ 2/5 @x: -x^2+x=6/25}
q: Find the values of `x` in `17x^2-19x=30`. x = {$ 2 @x: 17x^2-19x=30} or {$ -15/17 @x: 17x^2-19x=30}
q: Find the values of `x` in `4x-3x^2=6x-8`. x = {$ 4/3 @x: 4x-3x^2=6x-8} or {$ -2 @x: 4x-3x^2=6x-8}
q: Find the values of `x` in `x^2-4x=-1`. x = {$ 2+√3 @x: x^2-4x=-1} or {$ 2-√3 @x: x^2-4x=-1}
q: Find the values of `x` in `4x/7-2x^2/3=10x/3-20/7`. x = {$ 6/7 @x: 4x/7-2x^2/3=10x/3-20/7} or {$ -5 @x: 4x/7-2x^2/3=10x/3-20/7}
q: Find the values of `x` in `x/(x+8)=(x+3)/(2x+1)`. x = {$ 12 @x: x/(x+8)=(x+3)/(2x+1)} or {$ -2 @x: x/(x+8)=(x+3)/(2x+1)}
q: Find the values of `x` in `x+24/(x-1)=3x-4`. x = {$ 5 @x: x+24/(x-1)=3x-4} or {$ -2 @x: x+24/(x-1)=3x-4}
q: Find the values of `x` in `(x+3)/x+7x/(x+3)=23/4`. x = {$ 4 @x: (x+3)/x+7x/(x+3)=23/4} or {$ 1 @x: (x+3)/x+7x/(x+3)=23/4}
q: Find the values of `x` in `(2x+3)/(10-x)=2x/(25-3x)-13/2`. x = {$ 8 @x: (2x+3)/(10-x)=2x/(25-3x)-13/2} or {$ 425/31 @x: (2x+3)/(10-x)=2x/(25-3x)-13/2}
q: Find the values of `x` in `2ax-x^2=-2ab-b^2`. x = {$ 2a+b @x: 2a*x-x^2=-2a*b-b^2} or {$ -b @x: 2a*x-x^2=-2a*b-b^2}
q: Find the values of `x` in `x^2+3bx-4b^2=0`. x = {$ b @x: x^2+3b*x-4b^2=0} or {$ -4b @x: x^2+3b*x-4b^2=0}
q: Find the values of `x` in `x^2-ax-bx=-ab`. x = {$ a @x: x^2-a*x-b*x=-a*b} or {$ b @x: x^2-a*x-b*x=-a*b}
q: Find the values of `x` in `2bx^2+(a-2b)x=a`. x = {$ 1 @x: 2b*x^2+(a-2b)x=a} or {$ -a/(2b) @x: 2b*x^2+(a-2b)x=a}
q: Find the values of `x` in `x^2-(a-1)x-a=0`. x = {$ a @x: x^2-(a-1)x-a=0} or {$ -1 @x: x^2-(a-1)x-a=0}
q: Find the values of `x` in `x^2-(a+b-c)x=(a+b)c`. x = {$ a+b @x: x^2-(a+b-c)x=(a+b)c} or {$ -c @x: x^2-(a+b-c)x=(a+b)c}
== 40 | Quadratic Equations | The Hindoo method and quadratic problems
note: In story problems, give the value that makes sense (the positive one) unless the question asks for both.
art: 213 | The Hindoo Method | When an equation is brought to the form `ax^2+bx=c`, it may be reduced to a simple equation, without dividing by the coefficient of `x^2`; thus avoiding fractions. Multiplying both sides by `a`, `a^2x^2+abx=ac`. Completing the square by adding the square of `b/2`, then multiplying by 4: `4a^2x^2+4abx+b^2=4ac+b^2`. Extracting the square root, `2ax+b` = plus or minus the square root of `4ac+b^2`. This may be derived directly from `ax^2+bx=c`, by multiplying both sides by `4a`, and then adding to each member the square of `b`. Rule: 1. Reduce the equation to the form `ax^2+bx=c`, and multiply both sides by four times the coefficient of `x^2`. 2. Add the square of the coefficient of `x` to each side, and extract the square root.
art: 213 | Example | Given `3x^2-5x=28`. Multiplying both sides by 12, which is 4 times the coefficient of `x^2`, `36x^2-60x=336`. Adding to each member 25, the square of 5, `36x^2-60x+25=361`. Extracting the root, `6x-5=±19`; `6x=24`, or `-14`; `x=4`, or `-7/3`.
art: 214 | Problems | What number is that, whose square diminished by the number itself, is equal to 20? `x^2-x=20`; completing the square, `x^2-x+1/4=81/4`; `x-1/2=±9/2`; `x=5`, or `-4`. The negative value will answer the conditions in an arithmetical sense if the question be changed: whose square increased by the number itself, is equal to 20? Generally the positive root satisfies both the conditions of the question and the equation, while the other root satisfies the equation only; it is the answer to a question in which quantities that were additive have become subtractive. Sometimes both values satisfy the question: a number whose square increased by 15 is 8 times the number, is 5 or 3. When a problem has two unknown quantities and can be solved with one symbol, the two values generally give both: divide 24 into two parts whose product is 95; the parts are 19 and 5.
mc: In the Hindoo method, first multiply both sides by... | *four times the coefficient of `x^2` | the coefficient of `x` | 2
mc: Then add to each side the square of... | *the coefficient of `x` | half the coefficient of `x` | the known term
mc: The Hindoo method avoids... | *fractions | square roots | negative numbers
mc: When a story problem gives a negative root, that root... | *answers a changed question, with additions turned to subtractions | is always the right answer | means the work is wrong
q: Find the values of `x` in `3x^2-5x=28`. x = {$ 4 @x: 3x^2-5x=28} or {$ -7/3 @x: 3x^2-5x=28}
q: Find the values of `x` in `2x^2+5x=33`. x = {$ 3 @x: 2x^2+5x=33} or {$ -11/2 @x: 2x^2+5x=33}
q: Find the values of `x` in `5x^2+2x=88`. x = {$ 4 @x: 5x^2+2x=88} or {$ -22/5 @x: 5x^2+2x=88}
q: Find the values of `x` in `3x^2-x=70`. x = {$ 5 @x: 3x^2-x=70} or {$ -14/3 @x: 3x^2-x=70}
q: Find the values of `x` in `x^2-x=42`. x = {$ 7 @x: x^2-x=42} or {$ -6 @x: x^2-x=42}
q: Find the values of `x` in `x^2/3+3x/8-5=9 1/4`. x = {$ 6 @x: x^2/3+3x/8-5=37/4} or {$ -57/8 @x: x^2/3+3x/8-5=37/4}
q: What number is that, whose square diminished by the number itself, is equal to 20? {5 @x: x^2-x=20}
q: A person buys several oranges for 60 cents; had he bought 3 more for the same sum, each orange would have cost him 1 cent less; how many did he buy? {12 @x: 60/x-60/(x+3)=1}
q: Find a number, whose square increased by 15, shall be 8 times the number. {$ 5 @x: x^2+15=8x} or {$ 3 @x: x^2+15=8x}
q: Divide 24 into two such parts, that their product shall be 95. {$ 19 @x: x*(24-x)=95} and {$ 5 @x: x*(24-x)=95}
q: Find 3 numbers, such that the product of the first and third is equal to the square of the second; the sum of the first and second is 10, and the third exceeds the second by 24. Give the set of whole positive numbers: {2} {8} {32}
chk: x=2 | (10-x)^2=x*(34-x)
q: Find a number, such that if its square be diminished by 6 times the number itself, the remainder shall be 7. {7 @x: x^2-6x=7}
q: Find a number, such that twice its square, plus 3 times the number itself, shall be 65. {5 @x: 2x^2+3x=65}
q: Find a number, such that if its square be diminished by 1, and two thirds of the remainder be taken, the result shall be equal to 5 times the number divided by 2. {4 @x: 2(x^2-1)/3=5x/2}
q: Find two numbers whose difference is 8, and whose product is 240. {12} {20}
chk: x=12 | x*(x+8)=240
q: A person bought a number of sheep for $80; if he had bought 4 more for the same money, he would have paid $1 less for each; how many did he buy? {16 @x: 80/x-80/(x+4)=1}
q: There are two numbers, whose difference is 10, and if 600 be divided by each, the difference of the quotients is also 10; what are the numbers? {20} {30}
chk: x=20 | 600/x-600/(x+10)=10
q: A pedestrian, having to walk 45 miles, finds that if he increases his speed one half mile an hour, he will perform his task 1 1/4 hours sooner than if he walked at his usual rate; what is that rate, in miles an hour? {4 @x: 45/x-45/(x+1/2)=5/4}
q: Divide the number 14 into two parts, the sum of whose squares shall be 100. {8} {6}
chk: x=8 | x^2+(14-x)^2=100
q: In an orchard of 204 trees, there are 5 more trees in a row than there are rows; required the number of rows {12} and of trees in a row {17}
chk: x=12 | x*(x+5)=204
q: A and B start at the same time to travel 150 miles; A travels 3 miles an hour faster than B, and finishes his journey 8 1/3 hours before him; at what rate per hour did A travel {9} B {6}
chk: x=6 | 150/x-150/(x+3)=25/3
q: A company at a tavern had $1 and 75 cents to pay; but before the bill was paid two of them went away, when those who remained had each 10 cents more to pay; how many were in the company at first? {7 @x: 175/(x-2)-175/x=10}
q: The product of two numbers is 100, and if 1 be taken from the greater and added to the less, the product of the resulting numbers is 120; what are the numbers? The greater {25} the less {4}
chk: x=25, y=4 | x*y=100 | (x-1)(y+1)=120
q: If 4 be subtracted from a father's age, the remainder will be thrice the age of the son; and if 1 be taken from the son's age, half the remainder will be the square root of the father's age. Required the age of the father {49} the son {15}
chk: f=49, s=15 | f-4=3s | (s-1)/2=√f
q: A young lady being asked her age, answered, "If you add the square root of my age to three eighths of my age, the sum will be 10." Required her age. {16 @x: √x+3x/8=10}
q: Bought a horse, which I afterward sold for $24, thus losing as much per cent upon the price of my purchase as the horse cost; what did I pay for him? {$ 40 @x: x-x^2/100=24} or {$ 60 @x: x-x^2/100=24}
== 41 | Quadratic Equations | Properties of the roots
art: 215 | Two Roots | In a quadratic equation, the unknown quantity has two values. Take `x^2+2px=q`. Completing the square, `x^2+2px+p^2=q+p^2`. Assume `q+p^2=m^2`; then `(x+p)^2-m^2=0`; resolving into factors, `(x+p+m)(x+p-m)=0`. This can be satisfied in two ways, and in only two: `x=-p+m`, or `x=-p-m`. 1. Every quadratic equation has two roots, and only two. 2. Every affected quadratic equation, reduced to the form `x^2+2px=q`, may be decomposed into two binomial factors, of which the first term in each is `x`, and the second, the two roots with their signs changed. Thus, the roots of `x^2-5x+6=0` are 2 and 3; hence `x^2-5x+6=(x-2)(x-3)`. By reversing the operation, we can form an equation whose roots shall have any given values: for roots 4 and `-6`, `(x-4)(x+6)=x^2+2x-24=0`, or `x^2+2x=24`.
art: 216 | Sum and Product | In `x^2+2px=q`, the two values of `x` are `-p` plus and minus the square root of `q+p^2`. Their sum is `-2p`. The sum of the roots of a quadratic equation reduced to the form `x^2+2px=q`, is equal to the coefficient of the first power of `x` taken with a contrary sign. Their product is `p^2-(q+p^2)=-q`. The product of the two roots is equal to the known term taken with a contrary sign.
art: 217 | Signs of the Roots | In the first form, `x^2+2px=q`, the first root is essentially positive, the second essentially negative, and numerically greater. In the second form, `x^2-2px=q`, the first root is positive and greater than the second, which is negative. In the third form, `x^2+2px=-q`, both roots are negative. In the fourth form, `x^2-2px=-q`, both roots are positive.
art: 218 | Impossible Roots | In the third and fourth forms, when `q` is greater than `p^2`, we must extract the square root of a negative quantity, which is impossible; both values of the unknown quantity are impossible. When a number is divided into two equal parts, their product is greater than that of any other two parts into which it can be divided; or, the product of any two unequal numbers is less than the square of half their sum: `10=9+1`, `9*1=9`; `8*2=16`; `7*3=21`; `6*4=24`; `5*5=25`. Since `2p` is the sum of the two roots and `q` their product, when `q` is greater than `p^2` the roots would be two numbers whose product is greater than the square of half their sum, which is impossible. Thus, to divide 12 into two parts whose product shall be 40: `x^2-12x=-40`; `x=6` plus or minus the square root of `-4`; the problem is impossible, since 12 can not be divided into any two parts whose product will be greater than 36. When the coefficient of `x^2` is negative, change the signs of all the terms.
mc: How many roots has every quadratic equation? | *two, and only two | one | as many as you like
mc: The sum of the roots of `x^2+2px=q` is... | *`-2p` | `2p` | `q`
mc: The product of the roots of `x^2+2px=q` is... | *`-q` | `q` | `p^2`
mc: In the fourth form, `x^2-2px=-q`, both roots are... | *positive | negative | impossible
mc: In the third form, `x^2+2px=-q`, both roots are... | *negative | positive | equal
mc: A number divided into two equal parts gives the ___ product of its parts. | *greatest | least | same
mc: Can 12 be divided into two parts whose product is 40? | *No, the greatest product is 36 | Yes, 8 and 5 | Yes, 10 and 4
tf: `x^2-5x+6=(x-2)(x-3)` {T}
tf: The product of two unequal numbers is greater than the square of half their sum. {F}
q: Find an equation whose roots are 4 and `-6`, in the form `x^2+px=q`. p = {2} q = {24}
q: Find an equation whose roots are 7 and 10, in the form `x^2+px=q`. p = {$ -17} q = {$ -70}
chk: x=7 | x^2-17x=-70
q: Find an equation whose roots are `-3` and `-1`, in the form `x^2+px=q`. p = {4} q = {$ -3}
chk: x=-3 | x^2+4x=-3
q: Find an equation whose roots are 2 and `-1`, in the form `x^2+px=q`. p = {$ -1} q = {2}
chk: x=-1 | x^2-x=2
q: What is the greatest product of two parts into which 12 can be divided? {36}
q: What is the greatest product of two parts into which 10 can be divided? {25}
q: Separate `x^2-5x+6` into factors, by finding its roots. {$ (x-2)(x-3) @ x^2-5x+6}
q: Separate `x^2+2x-24` into factors. {$ (x-4)(x+6) @ x^2+2x-24}
== 42 | Quadratic Equations | Quadratics with two unknown quantities
note: Give the positive values. When x and y could be swapped, give the greater number first.
art: 219 | | In solving equations of this kind, the first step is to eliminate one of the unknown quantities. Given `x-y=2` and `x^2+y^2=100`: by the first, `x=y+2`; substituting, `(y+2)^2+y^2=100`; from which `y=6`, or `-8`; hence `x=8`, or `-6`. Given `x+y=8` and `xy=15`: `x=8-y`; `y(8-y)=15`; `y^2-8y=-15`; `y=5` or 3; `x=3` or 5.
art: 219 | A General Method | Given `x+y=a` and `xy=b`. Squaring the first, `x^2+2xy+y^2=a^2`; multiplying the second by 4, `4xy=4b`; subtracting, `x^2-2xy+y^2=a^2-4b`; extracting the root, `x-y` = plus or minus the square root of `a^2-4b`. Adding this to `x+y=a`, and dividing by 2, gives `x`; subtracting gives `y`. If we have `x-y=a` and `xy=b`, square the first and add 4 times the second, to find `x+y`. Given `x+y=a` and `x^2+y^2=b`: squaring the first and subtracting the second, `2xy=a^2-b`; taking this from the second, `x^2-2xy+y^2=2b-a^2`, and `x-y` is its square root. Given `x^2+y^2=a` and `xy=b`: adding twice the second gives `(x+y)^2=a+2b`; subtracting twice the second gives `(x-y)^2=a-2b`. Given `x^3+y^3=a` and `x+y=b`: dividing, `x^2-xy+y^2=a/b`; squaring the second, `x^2+2xy+y^2=b^2`; subtracting, `3xy=(b^3-a)/b`, and then `x-y` is found. In question 18, let `1/x=v` and `1/y=z`. In question 19, find the value of `xy` from the second equation, as if it were a single unknown quantity.
mc: To solve two equations with two unknowns of the second degree, first... | *eliminate one of the unknown quantities | add them | square them
mc: If `x+y=a` and `xy=b`, then `(x-y)^2` is... | *`a^2-4b` | `a^2+4b` | `a-2b`
mc: Dividing `x^3+y^3` by `x+y` gives... | *`x^2-xy+y^2` | `x^2+xy+y^2` | `x^2+y^2`
tf: If `x^2+y^2=a` and `xy=b`, then `(x+y)^2=a+2b`. {T}
q: Given `x-y=2` and `x^2+y^2=100`, find the positive values: x = {8} y = {6}
chk: x=8, y=6 | x-y=2 | x^2+y^2=100
q: Given `x+y=8` and `xy=15`: x = {5} y = {3}
chk: x=5, y=3 | x+y=8 | x*y=15
q: Given `x^2+y^2=34` and `x^2-y^2=16`: x = {5} y = {3}
chk: x=5, y=3 | x^2+y^2=34 | x^2-y^2=16
q: Given `x+y=16` and `xy=63`: x = {9} y = {7}
chk: x=9, y=7 | x+y=16 | x*y=63
q: Given `x-y=5` and `xy=36`: x = {9} y = {4}
chk: x=9, y=4 | x-y=5 | x*y=36
q: Given `x+y=9` and `x^2+y^2=53`: x = {7} y = {2}
chk: x=7, y=2 | x+y=9 | x^2+y^2=53
q: Given `x-y=5` and `x^2+y^2=73`: x = {8} y = {3}
chk: x=8, y=3 | x-y=5 | x^2+y^2=73
q: Given `x^3+y^3=152` and `x+y=8`: x = {5} y = {3}
chk: x=5, y=3 | x^3+y^3=152 | x+y=8
q: Given `x^3-y^3=208` and `x-y=4`: x = {6} y = {2}
chk: x=6, y=2 | x^3-y^3=208 | x-y=4
q: Given `x^3+y^3=19(x+y)` and `x-y=3`: x = {5} y = {2}
chk: x=5, y=2 | x^3+y^3=19(x+y) | x-y=3
q: Given `x+y=11` and `x^2-y^2=11`: x = {6} y = {5}
chk: x=6, y=5 | x+y=11 | x^2-y^2=11
q: Given `(x-3)(y+2)=12` and `xy=12`: x = {6} y = {2}
chk: x=6, y=2 | (x-3)(y+2)=12 | x*y=12
q: Given `y-x=2` and `3xy=10x+y`: x = {2} y = {4}
chk: x=2, y=4 | y-x=2 | 3x*y=10x+y
q: Given `3x^2+2xy=24` and `5x-3y=1`: x = {2} y = {3}
chk: x=2, y=3 | 3x^2+2x*y=24 | 5x-3y=1
q: Given `1/x+1/y=5/6` and `1/x^2+1/y^2=13/36`: x = {2} y = {3}
chk: x=2, y=3 | 1/x+1/y=5/6 | 1/x^2+1/y^2=13/36
q: Given `x-y=2` and `x^2y^2=21-4xy`: x = {3} y = {1}
chk: x=3, y=1 | x-y=2 | x^2y^2=21-4x*y
q: The sum of two numbers is 10, and the sum of their squares 52; what are the numbers? {6} {4}
chk: x=6, y=4 | x+y=10 | x^2+y^2=52
q: The difference of two numbers is 3, and the difference of their squares 39; required the numbers. {8} {5}
chk: x=8, y=5 | x-y=3 | x^2-y^2=39
q: Divide the number 25 into two such parts, that the sum of their square roots shall be 7. {16} {9}
chk: x=16, y=9 | x+y=25 | √x+√y=7
q: The product of a number, consisting of two places, by the sum of its digits, is 160; divided by 4 times the digit in unit's place, the quotient is 4; what is the number? {32}
chk: t=3, u=2 | (10t+u)(t+u)=160 | (10t+u)/(4u)=4
q: The difference of two numbers, multiplied by the greater, is 16, but by the less, 12; required the numbers. {8} {6}
chk: x=8, y=6 | (x-y)x=16 | (x-y)y=12
q: Divide 10 into two such parts, that their product shall exceed their difference by 22. {6} {4}
chk: x=6, y=4 | x+y=10 | x*y-(x-y)=22
q: The sum of two numbers is 10, and the sum of their cubes is 370; required the numbers. {7} {3}
chk: x=7, y=3 | x+y=10 | x^3+y^3=370
q: The difference of two numbers is 2, and the difference of their cubes is 98; required the numbers. {5} {3}
chk: x=5, y=3 | x-y=2 | x^3-y^3=98
q: If a number, consisting of two places, is divided by the product of its digits, the quotient will be 2; if 27 is added to it, the digits will be inverted; what is the number? {36}
chk: t=3, u=6 | (10t+u)/(t*u)=2 | 10t+u+27=10u+t
q: Find three quantities, such that the quotients arising from dividing the products of every two of them, by the one remaining, are `a`, `b`, and `c`. (xy over z is `a`, xz over y is `b`, yz over x is `c`.) x = {$ √(ab)} y = {$ √(ac)} z = {$ √(bc)}
q: Find two numbers, the sum of whose squares exceeds twice their product, by 4, and the difference of whose squares exceeds half their product, by 4. {8} {6}
chk: x=8, y=6 | x^2+y^2-2x*y=4 | x^2-y^2-x*y/2=4
q: The fore wheel of a carriage makes 6 revolutions more than the hind wheel, in going 120 yards; but if the circumference of each wheel is increased 1 yard, it will make only 4 revolutions more than the hind wheel, in the same distance; required the circumference of the fore wheel {4} and of the hind wheel {5}
chk: x=4, y=5 | 120/x-120/y=6 | 120/(x+1)-120/(y+1)=4
q: A and B depart from the same place, and travel in the same direction; A starts 2 hours before B, and after traveling 30 miles, B overtakes A; had each traveled half a mile more per hour, B would have traveled 42 miles before overtaking A. At what rate did A travel {2 1/2} and B {3}
chk: a=5/2, b=3 | 30/a-30/b=2 | 42/(a+1/2)-42/(b+1/2)=2
q: A and B started at the same time, from two different points, toward each other; when they met on the road, it appeared that A had traveled 30 miles more than B. It also appeared that it would take A 4 days to travel the road that B had come, and B 9 days to travel the road that A had come. Find the distance of A from B at starting, in miles. {150}
chk: x=90, y=60 | x=y+30 | 4x^2=9y^2
== 43 | Progressions and Proportion | Arithmetical progression
art: 220 | Series | A Series is a succession of quantities or numbers, connected together by the signs + or −, in which succeeding terms may be derived from those which precede them, by a rule deducible from the law of the series. Thus, `1+3+5+7+9`, etc., and `2+6+18+54`, etc., are series. In the former, any term may be derived from that which precedes it, by adding 2; and, in the latter, by multiplying the preceding term by 3.
art: 221 | Arithmetical Progression | An Arithmetical Progression is a series of quantities which increase or decrease, by a common difference. Thus, 1, 3, 5, 7, 9, form an increasing arithmetical progression, in which the common difference is 2; 30, 27, 24, 21, 18, 15, a decreasing arithmetical progression, in which the common difference is 3. Again, `a`, `a+d`, `a+2d`, `a+3d`, etc., is an increasing arithmetical progression, whose first term is `a`, and common difference `d`. If `d` be negative, it becomes a decreasing arithmetical progression.
art: 222 | The nth Term | The 1st term is `a`; the 2d, `a+d`; the 3d, `a+2d`; the 4th, `a+3d`. The coefficient of `d` in any term is less by unity than the number of that term; therefore, the nth term `l=a+(n-1)d`. For a decreasing series `l=a-(n-1)d`. Rule: 1. For an increasing series, multiply the common difference by the number of terms less one, and add the product to the first term. 2. For a decreasing series, multiply the common difference by the number of terms less one, and subtract the product from the first term. Thus, the 8th term of 3, 8, 13, is `3+(8-1)5=38`.
art: 223 | The Sum | Write the series forward and backward: `s=3+5+7+9+11` and `s=11+9+7+5+3`; adding, `2s=14+14+14+14+14=70`, and `s=35`. In general, `2s=(l+a)n`, and `s=(l+a)n/2`. Rule: multiply half the sum of the two extremes by the number of terms. The sum of the extremes is equal to the sum of any other two terms equally distant from the extremes. Since `l=a+(n-1)d`, also `s=(2a+(n-1)d)n/2`: to twice the first term, add the product of the number of terms less one, by the common difference, and multiply the sum by half the number of terms.
art: 224 | | The equations `l=a+(n-1)d` and `s=(a+l)n/2` furnish the means of solving this general problem: knowing any three of the five quantities `a`, `d`, `n`, `l`, `s`, to determine the other two. This furnishes ten cases. Thus `a=l-(n-1)d`: the first term of an increasing series is equal to the last term diminished by the product of the common difference into the number of terms less one. And `d=(l-a)/(n-1)`: the common difference is equal to the difference of the extremes, divided by the number of terms less one.
art: 225 | Means | To insert five arithmetical means between 3 and 15: the two given terms with the five to be inserted make seven; hence `n=7`, `a=3`, `l=15`, from which `d=2`, and the series is 3, 5, 7, 9, 11, 13, 15. If we insert the same number of means between the consecutive terms of a series, the result will form a new progression: inserting 3 terms between the terms of 1, 9, 17, gives 1, 3, 5, 7, 9, 11, 13, 15, 17.
mc: In an arithmetical progression, each term differs from the one before by... | *a common difference | a common ratio | 1
mc: The nth term of an increasing arithmetical series is... | *`a+(n-1)d` | `a+nd` | `a*d^(n-1)`
mc: The sum of an arithmetical series is... | *half the sum of the extremes, times the number of terms | the last term times the number of terms | the first term times the difference
mc: The common difference is... | *the difference of the extremes, divided by the number of terms less one | the last term divided by the first | the sum divided by the number of terms
tf: The sum of the extremes equals the sum of any two terms equally distant from the extremes. {T}
q: The first term of an increasing arithmetical series is 3, and common difference 5; required the 8th term. {38}
q: The first term of a decreasing arithmetical series is 50, and common difference 3; required the 10th term. {23}
q: `a=3`, and `d=5`; required the 6th term. {28}
q: `a=7`, and `d=1/4`; required the 16th term. {10 3/4}
q: `a=2 1/2`, and `d=1/3`; required the 100th term. {35 1/2}
q: `a=0`, and `d=1/2`; required the 11th term. {5}
q: `a=30`, and `d=-2`; required the 8th term. {16}
q: `a=-10`, and `d=-2`; required the 6th term. {$ -20}
q: If a body falls during 20 seconds, descending 16 1/12 feet the first second, 48 1/4 feet the next, and so on, how far will it fall the twentieth second, in feet? {627 1/4}
q: Find the sum of an arithmetical series, of which the first term is 3, last term 17, and number of terms 8. {80}
q: Find the sum of an arithmetical series, whose first term is 1, last term 12, and number of terms 12. {78}
q: Find the sum of an arithmetical series, whose first term is 0, common difference 1, and number of terms 20. {190}
q: Find the sum of an arithmetical series, whose first term is 3, common difference 2, and number of terms 21. {483}
q: Find the sum of an arithmetical series, whose first term is 10, common difference `-3`, and number of terms 10. {$ -35}
q: Insert five arithmetical means between 3 and 15. The common difference is {2}
q: Find the sum of the natural series of numbers 1, 2, 3, 4, carried to 1000 terms. {500500}
q: Required the last term {201} and the sum {10201} of the series 1, 3, 5, 7, to 101 terms.
q: How many times does a common clock strike in a week? {1092}
q: Find the nth term {$ n} and the sum of n terms {$ n(n+1)/2 | (n^2+n)/2} of the natural series of numbers 1, 2, 3, 4.
q: The first and last terms of an arithmetical series are 2 and 29, and the common difference is 3; required the number of terms {10} and the sum of the series {155}
q: The first and last terms of a decreasing arithmetical series are 10 and 6, and the number of terms 9; required the common difference {1/2} and the sum of the series {72}
q: The first term of a decreasing arithmetical series is 10, the number of terms 10, and the sum of the series 85; required the last term {7} and the common difference {1/3}
q: Insert four arithmetical means between each two terms of the series 1, 16, 31. The common difference of the new series is {3}
q: The sum of an arithmetical progression is 72, the first term is 24, and the common difference is `-4`; required the number of terms. {$ 9 @x: 24x-2x*(x-1)=72} or {$ 4 @x: 24x-2x*(x-1)=72}
sol: Both answers work: 24, 20, 16, 12, 8, 4, 0, -4, -8 and 24, 20, 16, 12 each add up to 72.
q: A man bought a farm, paying for the first acre $1, for the second $2, for the third $3, and so on; when he came to settle, he had to pay $12880; how many acres did the farm contain {160} and what was the average price per acre, in dollars {80 1/2|80.5}
q: If A start from a certain place, traveling `a` miles the first day, `2a` the second, `3a` the third, and so on; and at the end of 4 days, B start after him from the same place, traveling uniformly `9a` miles a day; at the end of how many days will B overtake A? {8 @x: x*(x+1)/2=9(x-4)}
sol: A travels ax(x+1)/2 in x days, B travels 9a(x-4). So x(x+1)/2 = 9(x-4), from which x = 8, or 9: B overtakes A at the end of 8 days, and since on the ninth day A travels 9a miles, they will be together at the end of the ninth day.
q: A sets out 3 hours and 20 minutes before B, and travels at the rate of 6 miles an hour; in how many hours will B overtake A, if he travel 5 miles the first hour, 6 the second, 7 the third, and so on? {8 @x: 5x+x*(x-1)/2=6x+20}
q: A and B set out from the same place, at the same time. A travels at the constant rate of 3 miles an hour, but B's rate of traveling is 4 miles the first hour, 3 1/2 the second, 3 the third, and so on; in how many hours will A overtake B? {5 @x: 3x=4x-x*(x-1)/4}
== 44 | Progressions and Proportion | Geometrical progression
art: 226 | Geometrical Progression | A Geometrical Progression is a series of terms, each of which is derived from the preceding, by multiplying it by a constant quantity, termed the ratio. Thus, 1, 2, 4, 8, 16, is an increasing geometrical series, whose common ratio is 2. Also, 54, 18, 6, 2, is a decreasing geometrical series, whose common ratio is one third. Generally, `a`, `ar`, `ar^2`, `ar^3`, etc., is a geometrical progression, whose common ratio is `r`, and which is an increasing or decreasing series, according as `r` is greater or less than 1. The common ratio is found by dividing any term of the series by that which precedes it.
art: 227 | The Last Term | Let `a` denote the 1st term, `r` the ratio, `l` the nth term, and `s` the sum of `n` terms. The terms are `a`, `ar`, `ar^2`, `ar^3`; the exponent of `r` in the second term is 1, in the third 2, in the fourth 3, and so on; the nth term will be `l=ar^(n-1)`. Rule: multiply the first term by the ratio raised to a power, whose exponent is one less than the number of terms. Thus, the 5th term of the progression whose first term is 4, and ratio 3, is `4*3^4=4*81=324`.
art: 228 | The Sum | Let `s=a+ar+ar^2+...+ar^(n-1)`. Multiplying by `r`, `rs=ar+ar^2+...+ar^n`. Subtracting the first from the second, `rs-s=ar^n-a`, or `s=a(r^n-1)/(r-1)`. Since `rl=ar^n`, `s=(rl-a)/(r-1)`. Rule: multiply the last term by the ratio, from the product subtract the first term, and divide the remainder by the ratio less one. If the ratio is less than 1, the progression is decreasing, and `s=(a-rl)/(1-r)`. Thus, the sum of 10 terms of 2, 6, 18, 54: the last term is `2*3^9=39366`, and `s=(118098-2)/(3-1)=59048`.
art: 229 | Infinite Series | In a decreasing geometrical series, when the number of terms is infinite, the last term becomes infinitely small, that is, 0. Therefore `rl=0`, and the formula becomes `s=a/(1-r)`. Rule: to find the sum of an infinite decreasing series, divide the first term by one minus the ratio. Thus, `1+1/3+1/9+...=1/(1-1/3)=3/2`.
mc: In a geometrical progression, each term is the one before it... | *multiplied by the ratio | plus the difference | squared
mc: The common ratio of 54, 18, 6, 2 is... | *`1/3` | 3 | 36
mc: The nth term of a geometrical series is... | *`ar^(n-1)` | `a+(n-1)r` | `ar^n`
mc: The sum of an infinite decreasing geometrical series is... | *the first term divided by one minus the ratio | infinite | the first term times the ratio
tf: The series 1, 2, 4, 8 is an increasing geometrical series. {T}
q: Find the 5th term of the geometric progression, whose first term is 4, and common ratio 3. {324 @= 4*3^4}
q: Find the 6th term of the progression 2, 8, 32. {2048 @= 2*4^5}
q: Given the 1st term 1, and ratio 2, to find the 7th term. {64 @= 2^6}
q: Given the 1st term 4, and ratio 3, to find the 10th term. {78732 @= 4*3^9}
q: Find the 9th term of the series 2, 10, 50. {781250 @= 2*5^8}
q: Given the first term 8, and ratio one half, to find the 15th term. {1/2048 @= 8/2^14}
q: A man purchased 9 horses, agreeing to pay for the whole what the last would cost, at $2 for the first, $6 for the second, etc.; what was the average price of each, in dollars? {1458 @= 2*3^8/9}
q: Find the sum of 10 terms of the progression 2, 6, 18, 54. {59048 @= 2*(3^10-1)/2}
q: Find the sum of 7 terms of the progression 1, 2, 4. {127 @= 2^7-1}
q: Find the sum of 10 terms of the progression 4, 12, 36. {118096 @= 4*(3^10-1)/2}
q: Find the sum of 8 terms of the series, whose first term is 6 1/4, and ratio 3/2. {307 441/512 @= (25/4)*((3/2)^8-1)/(1/2)}
q: Find the sum of 3 + 4 1/2 + 6 3/4, etc., to 5 terms. {39 9/16 @= 3*((3/2)^5-1)/(1/2)}
q: Find the sum of 15 terms of the series 8, 4, 2, 1. {15 2047/2048 @= 8*(1-(1/2)^15)/(1/2)}
q: Find the sum of 6 terms of the series 6, 4 1/2, 3 3/8. {19 373/512 @= 6*(1-(3/4)^6)/(1/4)}
q: Find the sum of the infinite series 1 + 1/3 + 1/9, etc. {3/2|1 1/2}
q: Find the sum of the infinite series 1 + 1/2 + 1/4 + 1/8, etc. {2}
q: Find the sum of the infinite series 9 + 6 + 4, etc. {27}
q: Find the sum of the infinite series 1 − 1/3 + 1/9 − 1/27, etc. {3/4}
q: Find the sum of the infinite series `1+1/x^2+1/x^4+1/x^6`, etc. {$ x^2/(x^2-1) @ 1/(1-1/x^2)}
q: Find the sum of the infinite geometrical progression `a-b+b^2/a-b^3/a^2`, etc., in which the ratio is `-b/a`. {$ a^2/(a+b) @ a/(1+b/a)}
q: A body moves 10 feet the first second, 5 the next, 2 1/2 the next, and so on forever; how many feet would it move over? {20}
q: The first and last terms of a geometrical series are 3 and 48, the number of terms 5; required the intermediate terms. {6} {12} {24}
q: In a geometrical series of three terms, the first and last terms are 4 and 16; required the middle term. {8}
q: Find a mean proportional between 8 and 32. {16}
q: The first and last terms of a geometrical series are 2 and 162, and the number of terms 5; required the ratio. {3}
== 45 | Progressions and Proportion | Ratio and proportion
art: 230 | | The equations `l=ar^(n-1)` and `s=(ar^n-a)/(r-1)` furnish this general problem: knowing three of the five quantities `a`, `r`, `n`, `l`, and `s`, of a geometrical progression, to find the other two. One of the most simple and useful cases: having given the first and last terms, and the number of terms, to find the ratio. Here `r^(n-1)=l/a`, and `r` is the root of `l/a` whose index is `n-1`. Thus, with first and last terms 3 and 48, and 5 terms, `r` is the fourth root of 16, which is 2. In a geometrical progression of three terms, the middle term is called a mean proportional between the other two.
art: 231 | Ratio | Two quantities of the same kind may be compared in two ways: 1st, by finding how much the one exceeds the other; 2d, by finding how many times the one contains the other. Comparing 2 and 6 by the first method, 6 is 4 greater than 2; by the second, 6 is equal to three times 2. The second method gives rise to proportion. Ratio is the quotient which arises from dividing one quantity by another of the same kind. Thus, the ratio of 2 to 6 is 3; the ratio of `a` to `ma` is `m`. In order that two quantities may have a ratio to each other, they must be of the same kind: 2 yards has no ratio to $6.
art: 233 | Terms | When two numbers, as 2 and 6, are compared, the first is called the antecedent, the second the consequent. When spoken of as one, they are called a couplet; when spoken of as two, the terms of the ratio. Ratio is expressed in the form of a fraction, of which the antecedent is the denominator and the consequent the numerator: the ratio of 2 to 6 is `6/2`; or by placing two points between the terms: `2:6`. The ratio may be a whole number, a common fraction, or an interminate decimal: the ratio of 10 to 4 is `2/5`; the ratio of 2 to `√5` is 1.118+.
art: 236 | | Whatever is true of a fraction is true of the terms of a ratio. 1st. To multiply the consequent, or divide the antecedent by any number, multiplies the ratio by that number. 2d. To divide the consequent, or multiply the antecedent by any number, divides the ratio by that number. 3d. To multiply or divide both the antecedent and consequent by any number, does not alter the ratio. When the two numbers are equal, the ratio is called a ratio of equality; when the second is greater than the first, a ratio of greater inequality; when less, a ratio of less inequality. A Compound Ratio is the product of two or more ratios: `10/3` compounded with `6/5` is 4. Ratios may be compared by reducing the fractions which represent them to a common denominator.
art: 240 | Proportion | Proportion is an equality of ratios. If `b/a` is equal to `d/c`, then `a`, `b`, `c`, `d` form a proportion, written `a:b::c:d`, read `a` is to `b` as `c` is to `d`. When four quantities are in proportion, the second divided by the first gives the same quotient as the fourth divided by the third. This is the test of proportionality: `3:8::2:5` is false, since `8/3` is not equal to `5/2`. A ratio subsists between two quantities, a proportion only between four. The first and last terms are called the extremes; the second and third, the means. The first and third are antecedents; the second and fourth, consequents. The last is a fourth proportional to the other three. When `a:b::b:c`, `b` is a mean proportional between `a` and `c`, and `c` a third proportional to `a` and `b`.
art: 244 | Propositions | I. In every proportion, the product of the means is equal to the product of the extremes: `ad=bc`; thus `3:6::5:10`, and `6*5=3*10`. If any three terms of a proportion are given, the fourth may be found. II. Conversely, if the product of two quantities is equal to the product of two others, two of them may be made the means, and the other two the extremes. III. If three quantities are in continued proportion, the product of the extremes is equal to the square of the mean. IV. Alternation: `a:c::b:d`. V. Inversion: `b:a::d:c`. VI. If two proportions have an antecedent and consequent in the one equal to an antecedent and consequent in the other, the remaining terms are proportional.
art: 250 | More Propositions | VII. Composition: `a+b:b::c+d:d`; thus `3:4::6:8` gives `7:4::14:8`. VIII. Division: `a-b:b::c-d:d`. IX. The sum of the first and second is to their difference, as the sum of the third and fourth is to their difference. X. Like powers or roots of proportional quantities are in proportion: `2:3::4:6` gives `4:9::16:36`. XI. If two sets of quantities are in proportion, the products of the corresponding terms are in proportion. XII. In any continued proportion, any one antecedent is to its consequent, as the sum of all the antecedents is to the sum of all the consequents: `3:4::6:8::9:12` gives `3:4::18:24`.
mc: The ratio of 2 to 6 (as this book reckons it) is... | *3 | `1/3` | 4
mc: In `2:6`, the 2 is called the... | *antecedent | consequent | mean
mc: Proportion is... | *an equality of ratios | a single ratio | a difference of two numbers
mc: In `a:b::c:d`, the extremes are... | *`a` and `d` | `b` and `c` | `a` and `b`
mc: In every proportion, the product of the means equals... | *the product of the extremes | the sum of the extremes | 1
mc: Is `3:8::2:5` a true proportion? | *No, 3 times 5 is not 8 times 2 | Yes | Only if reversed
mc: Multiplying both antecedent and consequent by the same number... | *does not alter the ratio | doubles the ratio | inverts the ratio
mc: The ratio of 4 to 8 is a ratio of... | *greater inequality | less inequality | equality
mc: If `a:b::c:d`, then by alternation... | *`a:c::b:d` | `b:a::d:c` | `a+b:b::c+d:d`
mc: If `a:b::c:d`, then by inversion... | *`b:a::d:c` | `a:c::b:d` | `d:c::a:b`
tf: Two yards has a ratio to six dollars. {F}
tf: If `ac=b^2`, then `a:b::b:c`. {T}
q: What is the ratio of 3 to 12? {4}
q: What is the ratio of 10 to 4? {2/5}
q: What is the ratio of `a` to `ma`? {$ m}
q: Compound the ratio `10/3` with the ratio `6/5`. {4}
q: The first three terms of a proportion are `ac`, `bd`, and `acxy`; what is the fourth? {$ bdxy @ bd*acxy/(ac)}
q: Find the fourth term of the proportion `3:6::5:` what? {10}
q: Find a mean proportional between 4 and 9. {6}
q: Find a third proportional to 2 and 4. {8}
q: If `3:4::6:8`, then by composition `3+4:4::14:` what? {8}
q: If `8:5::16:10`, then by division `3:5::6:` what? {10}
q: If `3:5::6:10` and `4:3::8:6`, the products of corresponding terms give `12:15::48:` what? {60}
q: If `3:4::6:8::9:12`, the sum of the antecedents is to the sum of the consequents as 18 is to what? {24}
EOF
make-book.ps1: builds any book: -Book algebra1 writes public\books\algebra1.json.
cat > /root/rays-rebuild/make-book.ps1 <<'EOF'
# Builds public/books/<id>.json from a hand-corrected book in source/<Book>.txt (format at the top of source/primary.txt).
# Generates every table exactly, works out {?} answers, and checks typed answers wherever the question is plain
# arithmetic ("How many are 3 and 5?", "One from 9?", "Nine and how many make 17?", "How many twos in 8?").
# Usage: powershell -ExecutionPolicy Bypass -File RaysArithmetic\tools\make-book.ps1 [-Book primary|intellectual|...]
param([string]$Book = 'primary')
$root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
$src = Get-Content "$root\source\$Book.txt" -Encoding UTF8
# the book's id, title, shelf line and color: "@book: primary1877 | Ray's New Primary Arithmetic | 1877 - Book One | #2f6f8f"
$head = $src | Where-Object { $_ -match '^@book: ' } | Select-Object -First 1
if (-not $head) { throw "source\$Book.txt has no @book: line" }
$bk = ($head -replace '^@book: ', '') -split '\s*\|\s*'
$script:errors = New-Object System.Collections.ArrayList
# ---------- numbers ----------
$ones = @{ naught = 0; zero = 0; one = 1; two = 2; three = 3; four = 4; five = 5; six = 6; seven = 7; eight = 8; nine = 9; ten = 10; eleven = 11; twelve = 12; thirteen = 13; fourteen = 14; fifteen = 15; sixteen = 16; seventeen = 17; eighteen = 18; nineteen = 19 }
$tens = @{ twenty = 20; thirty = 30; forty = 40; fifty = 50; sixty = 60; seventy = 70; eighty = 80; ninety = 90 }
$plural = @{ ones = 1; twos = 2; threes = 3; fours = 4; fives = 5; sixes = 6; sevens = 7; eights = 8; nines = 9; tens = 10 }
function WordNum([string]$w) {
$w = $w.ToLower()
if ($w -match '^\d+$') { return [long]$w }
if ($w -eq 'one hundred' -or $w -eq 'hundred') { return 100 }
if ($ones.ContainsKey($w)) { return $ones[$w] }
if ($tens.ContainsKey($w)) { return $tens[$w] }
if ($w -match '^(\w+)-(\w+)$' -and $tens.ContainsKey($Matches[1]) -and $ones.ContainsKey($Matches[2])) { return $tens[$Matches[1]] + $ones[$Matches[2]] }
return $null
}
$numRx = '\b(?:\d+|one hundred|(?:twenty|thirty|forty|fifty|sixty|seventy|eighty|ninety)(?:-(?:one|two|three|four|five|six|seven|eight|nine))?|naught|zero|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|one|two|three|four|five|six|seven|eight|nine|ten)\b'
# Plain arithmetic in a question part -> its value, or $null when the part isn't plain arithmetic.
# Reads left to right, the way the book works them ("2 and 5 are 7; 7 less 3 are 4"); every x comes first in the book.
function Calc([string]$t) {
$s = ' ' + $t.ToLower() + ' '
$s = $s -replace '[?:]', ' ' -replace '\s*=\s*', ' ' -replace ',', ' '
# "Twelve are how many times 3?" -> 12 / 3
# "What are 2/3 of 9?" -> 6
if ($s -match '^\s*(?:what (?:are|is)\s+)?(\d+)/(\d+) of (\d+)\s*$') { $v = [int]$Matches[3] * [int]$Matches[1]; if ($v % [int]$Matches[2]) { return $null }; return [int]($v / [int]$Matches[2]) }
if ($s -match "^\s*($numRx)\s+(?:are|is) how many times\s+($numRx)\s*$") { $a = WordNum $Matches[1]; $b = WordNum $Matches[2]; if ($a % $b) { return $null }; return [int]($a / $b) }
$s = $s -replace '\bare how many\b', ' ' -replace '\bhow many (are|is)\b', ' ' -replace '\bhow many\b', ' '
# "N from M leaves how many" / "N from M" / "N taken away from M"
if ($s -match "^\s*($numRx)\s+(?:taken\s+)?(?:away\s+)?from\s+($numRx)\s*(?:leaves)?\s*$") { return (WordNum $Matches[2]) - (WordNum $Matches[1]) }
# "N and how many make M"
if ($s -match "^\s*($numRx)\s+and\s+make\s+($numRx)\s*$") { return (WordNum $Matches[2]) - (WordNum $Matches[1]) }
# "how many twos in 8"
if ($s -match "^\s*(ones|twos|threes|fours|fives|sixes|sevens|eights|nines|tens)\s+in\s+($numRx)\s*$") { return [int]((WordNum $Matches[2]) / $plural[$Matches[1]]) }
# "times is 2 contained in 4" / "2 in 4"
if ($s -match "^\s*(?:times is\s+)?($numRx)\s+(?:contained\s+)?in\s+($numRx)\s*$") { return [int]((WordNum $Matches[2]) / (WordNum $Matches[1])) }
$s = $s -replace '\bmultiplied by\b', ' x ' -replace '\bdivided by\b', ' / ' -replace '\btimes\b', ' x ' -replace '\btime\b', ' x ' -replace '\bplus\b', ' + ' -replace '\bminus\b', ' - ' -replace '\bless\b', ' - ' -replace '\band\b', ' + '
$tok = @([regex]::Matches($s, "$numRx|[-+x/]") | ForEach-Object { $_.Value })
$rest = ([regex]::Replace($s, "$numRx|[-+x/]", ' ')).Trim()
if ($rest -or $tok.Count -lt 3 -or $tok.Count % 2 -eq 0) { return $null }
$v = WordNum $tok[0]; if ($null -eq $v) { return $null }
for ($i = 1; $i -lt $tok.Count; $i += 2) {
$b = WordNum $tok[$i + 1]; if ($null -eq $b) { return $null }
switch ($tok[$i]) { '+' { $v += $b } '-' { $v -= $b } 'x' { $v *= $b } '/' { if ($v % $b) { return $null }; $v = $v / $b } default { return $null } }
}
return [long]$v
}
# ---------- exact fractions ----------
# {~ 1/2 + 1/4} works the answer out exactly: whole numbers, a/b, mixed numbers written 1_3/4, + - * / and ( ).
# A fraction is written without spaces (3/4); division between numbers needs spaces (12 / 3).
# The answer is written the book's way: 3/4, 2 1/3, 5.
function Gcd([long]$a, [long]$b) { $a = [Math]::Abs($a); $b = [Math]::Abs($b); while ($b) { $t = $a % $b; $a = $b; $b = $t }; [long][Math]::Max($a, 1) }
function Rat([long]$n, [long]$d) { if ($d -lt 0) { $n = -$n; $d = -$d }; $g = Gcd $n $d; ,@([long]($n / $g), [long]($d / $g)) }
function RatStr($r) {
$n = $r[0]; $d = $r[1]
if ($d -eq 1) { return "$n" }
$w = [long][Math]::Truncate($n / $d); $f = $n - $w * $d
if ($w) { "$w $([Math]::Abs($f))/$d" } else { "$n/$d" }
}
function EvalFrac([string]$e) {
$script:tk = @([regex]::Matches(($e -replace '(?<=\d),(?=\d{3})', ''), '\d*\.\d*\(\d+\)|\d+_\d+/\d+|\d+/\d+|\d*\.\d+|\d+|[-+*/()]') | ForEach-Object { $_.Value }); $script:ti = 0
function Atom {
$x = $script:tk[$script:ti]; $script:ti++
if ($x -eq '(') { $v = Sum; $script:ti++; return ,$v }
# a circulate: .45(3) = .4533..., 104.(14) = 104.1414...; the figures in ( ) repeat
if ($x -match '^(\d*)\.(\d*)\((\d+)\)$') {
$w = [long]('0' + $Matches[1]); $a = $Matches[2]; $rp = $Matches[3]
$num = [long]('0' + $a + $rp) - [long]('0' + $a); $den = [long](('9' * $rp.Length) + ('0' * $a.Length))
return ,(Rat ($w * $den + $num) $den)
}
if ($x -match '^(\d+)_(\d+)/(\d+)$') { return ,(Rat ([long]$Matches[1] * [long]$Matches[3] + [long]$Matches[2]) ([long]$Matches[3])) }
if ($x -match '^(\d+)/(\d+)$') { return ,(Rat ([long]$Matches[1]) ([long]$Matches[2])) }
if ($x -match '^\d+$') { return ,(Rat ([long]$x) 1) }
if ($x -match '^(\d*)\.(\d+)$') { return ,(Rat ([long]($Matches[1] + $Matches[2])) ([long][Math]::Pow(10, $Matches[2].Length))) }
throw "bad token '$x' in $e"
}
function Prod {
$v = Atom
while ($script:ti -lt $script:tk.Count -and $script:tk[$script:ti] -match '^[*/]$') {
$op = $script:tk[$script:ti]; $script:ti++; $b = Atom
if ($op -eq '*') { $v = Rat ($v[0] * $b[0]) ($v[1] * $b[1]) } else { $v = Rat ($v[0] * $b[1]) ($v[1] * $b[0]) }
}
,$v
}
function Sum {
$v = Prod
while ($script:ti -lt $script:tk.Count -and $script:tk[$script:ti] -match '^[-+]$') {
$op = $script:tk[$script:ti]; $script:ti++; $b = Prod
$n = $(if ($op -eq '+') { $v[0] * $b[1] + $b[0] * $v[1] } else { $v[0] * $b[1] - $b[0] * $v[1] })
$v = Rat $n ($v[1] * $b[1])
}
,$v
}
$r = Sum
if ($script:ti -ne $script:tk.Count) { throw "couldn't read all of: $e" }
$script:lastRat = $r
RatStr $r
}
# a value as a circulate, the repeating figures in ( ): 77/111 -> ".(693)", 5/36 -> ".13(8)"
function AsRep($r) {
$n = [long]$r[0]; $d = [long]$r[1]; $w = [long][Math]::Floor($n / $d); $rem = $n - $w * $d
$digits = New-Object Text.StringBuilder; $seen = @{}
while ($rem -and -not $seen.ContainsKey($rem)) { $seen[$rem] = $digits.Length; $rem *= 10; [void]$digits.Append([long][Math]::Floor($rem / $d)); $rem = $rem % $d }
$s = $digits.ToString(); $lead = $(if ($w) { "$w" } else { '' })
if (-not $rem) { if ($s) { return "$lead.$s" } else { return "$w" } }
$k = $seen[$rem]; "$lead.$($s.Substring(0, $k))($($s.Substring($k)))"
}
# a value as the book's complex decimal, carried to $p places: 41 1391/1875 -> "41.7422 2/3"; exact decimals stay pure
function AsCplx($r, [int]$p) {
$n = [long]$r[0]; $d = [long]$r[1]; $scale = [long][Math]::Pow(10, $p)
$N = $n * $scale; $q = [long][Math]::Floor($N / $d); $rem = $N - $q * $d
$ip = [long][Math]::Floor($q / $scale); $dec = ($q % $scale).ToString().PadLeft($p, '0')
if (-not $rem) { $dec = $dec.TrimEnd('0'); if (-not $dec) { return "$ip" } }
$s = $(if ($ip) { "$ip" } else { '' }) + '.' + $dec
if ($rem) { $g = Gcd $rem $d; $s += " $($rem / $g)/$($d / $g)" }
$s
}
# the same value written as a decimal when it ends (denominator only 2s and 5s): "2 39/50" -> "2.78"; else unchanged
function AsDec([string]$v) {
if ($v -notmatch '^(-?\d+)( (\d+)/(\d+)|/(\d+))?$') { return $v }
if (-not $Matches[2]) { return $v }
if ($Matches[3]) { $w = [long]$Matches[1]; $n = [long]$Matches[3]; $d = [long]$Matches[4] } else { $w = 0; $n = [long]$Matches[1]; $d = [long]$Matches[5] }
$t = $d; while ($t % 2 -eq 0) { $t /= 2 }; while ($t % 5 -eq 0) { $t /= 5 }; if ($t -ne 1) { return $v }
$s = ([decimal]$w + [decimal]$n / [decimal]$d).ToString('0.##########################')
if ($s.StartsWith('0.')) { $s.Substring(1) } else { $s }
}
# ---------- the book's tables ----------
function Table([string]$op, [int]$n) {
$f = New-Object System.Collections.ArrayList
# t = the book's line, q = the same fact asked as a question (the app's drill and the voice use both)
function F($t, $a, $b, $r) {
$q = switch ($op) { 'add' { "How many are $a and $b?" } 'sub' { "$a from $b leaves how many?" } 'mul' { if ($a -eq 1) { "How many is 1 time $b?" } else { "How many are $a times $b?" } } 'div' { "How many times is $a contained in $b?" } }
[void]$f.Add([ordered]@{ t = $t; q = $q; a = $a; b = $b; r = $r })
}
switch ($op) {
'add' { foreach ($k in 1..10) { F "$n and $k are $($n + $k)" $n $k ($n + $k); if ($k -ne $n) { F "$k and $n are $($n + $k)" $k $n ($n + $k) } } }
'sub' { F "$n from $n leaves 0" $n $n 0
foreach ($k in 1..9) { $m = $n + $k; F "$n from $m leaves $k" $n $m $k; if ($k -ne $n) { F "$k from $m leaves $n" $k $m $n } } }
'mul' { if ($n -eq 1) { foreach ($k in 2..10) { F "1 time $k is $k" 1 $k $k; F "$k times 1 are $k" $k 1 $k } }
else { F "$n times 1 are $n" $n 1 $n; foreach ($k in 2..10) { F "$k times $n are $($k * $n)" $k $n ($k * $n); if ($k -ne $n) { F "$n times $k are $($k * $n)" $n $k ($k * $n) } } } }
'div' { F "$n in $n, 1 time" $n $n 1
foreach ($k in 2..10) { $m = $n * $k; F "$n in $m, $k times" $n $m $k; if ($k -ne $n) { F "$k in $m, $n times" $k $m $n } } }
}
return ,$f.ToArray()
}
# ---------- algebra (Book 6) ----------
# Math in a text is written between backticks in plain ASCII: `3a^2b - 4(x+y)/2`. It is shown the book's way
# (3a²b − 4(x+y)/2) and said for the voice ("3 A squared B minus 4 times the quantity X plus Y, over 2").
# An answer {$ expr} is typed on the algebra pad; {$ expr @ same} checks it has the value of `same`, {$~ (a+b)(c+d)} multiplies it out itself,
# {$ 12 @x: 6x+2x = 3x+60} checks it solves the equation for x, {15 @= 5^2-2*5} checks a plain number.
# chk: x=5, y=4 | x+y=9 | x-y=1 checks a pair of answers against the equations.
Add-Type -Path "$root\tools\alg.cs"
function MathSplit([string]$t, [scriptblock]$plain, [scriptblock]$math) {
$bits = $t -split '`'; $o = ''
for ($i = 0; $i -lt $bits.Count; $i++) { $o += $(if ($i % 2) { & $math $bits[$i] } elseif ($bits[$i]) { & $plain $bits[$i] } else { '' }) }
$o
}
$SUPS = @{ '0' = [char]0x2070; '1' = [char]0x00B9; '2' = [char]0x00B2; '3' = [char]0x00B3; '4' = [char]0x2074; '5' = [char]0x2075; '6' = [char]0x2076; '7' = [char]0x2077; '8' = [char]0x2078; '9' = [char]0x2079; '-' = [char]0x207B }
function AlgPretty([string]$m) {
$m = [regex]::Replace($m, '\^(-?\d+)', { param($x) -join ($x.Groups[1].Value.ToCharArray() | ForEach-Object { $SUPS[[string]$_] }) })
$m.Replace('-', [string][char]0x2212).Replace('*', [string][char]0x00D7)
}
function AlgSay([string]$m) {
$tk = @([regex]::Matches(($m -replace [char]0x2212, '-'), '\d+\.?\d*|\.\d+|[A-Za-z]|\^-?\d+|[-+*/()=<>,;:.]|\S') | ForEach-Object { $_.Value })
$w = New-Object System.Collections.ArrayList; $prev = ''
for ($i = 0; $i -lt $tk.Count; $i++) {
$t = $tk[$i]; $nx = $(if ($i + 1 -lt $tk.Count) { $tk[$i + 1] } else { '' })
if ($t -match '^\^(-?\d+)$') { $n = [int]$Matches[1]; [void]$w.Add($(switch ($n) { 0 { 'to the zero power' } 2 { 'squared' } 3 { 'cubed' } default { "to the $(if ($n -lt 0) { 'minus ' })$(OrdWord ([Math]::Abs($n))) power" } })) }
elseif ($t -match '^[a-z]$') { [void]$w.Add($t.ToUpper()) }
elseif ($t -match '^[\d.]+$') {
# a plain number fraction 3/4 (not 3/4x) is said "3 fourths"
if ($nx -eq '/' -and $i + 2 -lt $tk.Count -and $tk[$i + 2] -match '^\d+$' -and [int]$tk[$i + 2] -gt 1 -and ($i + 3 -ge $tk.Count -or $tk[$i + 3] -notmatch '^([a-z(]|\^)') -and $prev -notmatch '^[a-z)]$') { [void]$w.Add((FracWords $t $tk[$i + 2])); $i += 2; $t = 'frac' }
else { if ($prev -match '^[a-z)]$') { [void]$w.Add('times') }; [void]$w.Add($t) }
}
elseif ($t -eq '(') { [void]$w.Add($(if ($prev -match '^([\d.]+|[a-z)]|\^-?\d+)$') { 'times the quantity' } else { 'the quantity' })) }
elseif ($t -eq ')') { [void]$w.Add(',') }
else { [void]$w.Add($(switch ($t) { '+' { 'plus' } '-' { 'minus' } '*' { 'times' } '/' { 'over' } '=' { 'equals' } '^' { 'to the power' } '<' { 'is less than' } '>' { 'is greater than' } ([string][char]0x221A) { $(if ($prev -match '^([\d.]+|[a-z)]|\^-?\d+)$') { 'times the square root of' } else { 'the square root of' }) } ([string][char]0x00F7) { 'divided by' } default { $t } })) }
$prev = $t
}
(($w -join ' ') -replace ' ,', ',' -replace ',(\s*,)+', ',' -replace ',\s*$', '').Trim()
}
# the pad's extra keys: the letters used, and a root sign when there is one
function AlgLetters([string]$s) { (-join (@([regex]::Matches(($s -replace '\^-?\d+', ''), '[a-z]') | ForEach-Object { $_.Value }) | Sort-Object -Unique)) + $(if ($s.Contains([string][char]0x221A)) { [string][char]0x221A } else { '' }) }
# ---------- questions ----------
# display: the book's x and / become real signs; spoken: signs become words for the voice
$TIMES = " $([char]0x00D7) "; $DIV = " $([char]0x00F7) "; $MINUS = " $([char]0x2212) " # plain-ASCII script: no BOM needed
function Display([string]$t) { if ($t.Contains('`')) { return MathSplit $t { param($x) Display $x } { param($x) AlgPretty $x } }; ($t -replace '(?<=[\d)]) x (?=[\d.(])', $TIMES -replace '(?<=[\d)]) / (?=[\d.(])', $DIV -replace '(?<=[\d)]) - (?=[\d.(])', $MINUS) }
# fractions said the book's way: "3/4" -> "3 fourths", "2 1/2" -> "2 and 1 half"
$FRN = @{ 2 = 'half'; 3 = 'third'; 4 = 'fourth'; 5 = 'fifth'; 6 = 'sixth'; 7 = 'seventh'; 8 = 'eighth'; 9 = 'ninth'; 10 = 'tenth'; 11 = 'eleventh'; 12 = 'twelfth'; 13 = 'thirteenth'; 14 = 'fourteenth'; 15 = 'fifteenth'; 16 = 'sixteenth'; 17 = 'seventeenth'; 18 = 'eighteenth'; 19 = 'nineteenth'; 20 = 'twentieth'; 100 = 'hundredth' }
# any other denominator as an ordinal word: 23 -> twenty-third, 115 -> one hundred and fifteenth
function OrdWord([int]$d) {
$o = 'zero one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen' -split ' '
$t = ',,twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety' -split ','
$oo = @{ one = 'first'; two = 'second'; three = 'third'; five = 'fifth'; eight = 'eighth'; nine = 'ninth'; twelve = 'twelfth' }
function Card([int]$n) { if ($n -lt 20) { return $o[$n] }; $w = $t[[Math]::Floor($n / 10)]; if ($n % 10) { $w += '-' + $o[$n % 10] }; $w }
$words = @()
if ($d -ge 1000) { $words += (Card ([Math]::Floor($d / 1000))) + ' thousand'; $d = $d % 1000 }
if ($d -ge 100) { $words += (Card ([Math]::Floor($d / 100))) + ' hundred'; $d = $d % 100 }
if ($d) { if ($words.Count) { $words += 'and' }; $words += (Card $d) }
$s = $words -join ' '
if ($s -match '^(.*?)(\w+)$') { $head = $Matches[1]; $last = $Matches[2] }
$last = $(if ($oo[$last]) { $oo[$last] } elseif ($last -match 'y$') { $last -replace 'y$', 'ieth' } else { $last + 'th' })
$head + $last
}
function FracWords([int]$n, [int]$d) {
$name = $FRN[$d]; if (-not $name) { $name = OrdWord $d }
if ($n -gt 1) { $name = $(if ($name -eq 'half') { 'halves' } else { $name + 's' }) }
"$n $name"
}
function SayFractions([string]$t) {
$t = [regex]::Replace($t, '(?<![\d/])(\d+) (\d+)/(\d+)(?![\d/])', { param($m) "$($m.Groups[1].Value) and $(FracWords $m.Groups[2].Value $m.Groups[3].Value)" })
[regex]::Replace($t, '(?<![\d/])(\d+)/(\d+)(?![\d/])', { param($m) FracWords $m.Groups[1].Value $m.Groups[2].Value })
}
function SayRep([string]$t) { [regex]::Replace($t, '(\d*)\.(\d*)\((\d+)\)', { param($m) $w = $m.Groups[1].Value; $a = ($m.Groups[2].Value.ToCharArray() -join ' '); $r = ($m.Groups[3].Value.ToCharArray() -join ' '); (($(if ($w) { "$w " } else { '' }) + 'point ' + $(if ($a) { "$a, " } else { '' }) + "$r repeating")) }) }
function Spoken([string]$t) { if ($t.Contains('`')) { return MathSplit $t { param($x) Spoken $x } { param($x) AlgSay $x } }; $t =($t -replace '(?<=[\d)]) x (?=[\d.])', ' times ' -replace '(?<=[\d)]) / (?=[\d.])', ' divided by ' -replace '(?<=[\d)]) - (?=[\d.])', ' minus ' -replace '(?<=[\d)]) \+ (?=[\d.])', ' plus ' -replace '= \?', 'equals what?'); SayFractions (SayRep $t) }
function Question([string]$q, [string]$where) {
$parts = New-Object System.Collections.ArrayList; $script:reps = New-Object System.Collections.ArrayList
$pos = 0
foreach ($m in [regex]::Matches($q, '\{([^}]*)\}')) {
$seg = $q.Substring($pos, $m.Index - $pos).Trim(); $pos = $m.Index + $m.Length
$ans = $m.Groups[1].Value.Trim(); if ($ans -notmatch '^~p\s') { $ans = $ans -replace '(?<=\d),(?=\d{3})', '' } # 1,234 -> 1234 (not in a compound chain: 9,144)
$algE = $null; if ($ans -match '^\$\s*(.+)$') { $algE = $Matches[1].Trim(); $ans = '$' } # algebra answer, below
# {15 @= 5^2-2*5}: a plain number checked with the algebra reader (powers, letters' values written in)
# {12 @x: 6x+2x = 3x+60}: a plain number that must solve the equation(s) for x (several split by ;)
if ($ans -match '^([^@]+?)\s*@([a-z]):\s*(.+)$') { $ans = $Matches[1].Trim(); $r = [RaysAlgCheck]::Holds("$($Matches[2])=" + ($ans -replace '^(\d+) (\d+)/(\d+)$', '($1+$2/$3)'), @($Matches[3] -split '\s*;\s*')); if ($r) { [void]$script:errors.Add("$where : $r") } }
if ($ans -match '^([^@]+?)\s*@=\s*(.+)$') { $ans = $Matches[1].Trim(); $r = [RaysAlgCheck]::Same(($ans -replace '^(\d+) (\d+)/(\d+)$', '($1+$2/$3)'), $Matches[2]); if ($r) { [void]$script:errors.Add("$where : $r") } }
# {1234 @ 567 + 667}: the book's printed answer, checked against the sum worked out from the question (catches misread digits)
if ($ans -match '^([^@]+?)\s*@\s*(.+)$') {
$ans = $Matches[1].Trim(); $chk = $Matches[2]
try { $want = EvalFrac $chk; $got = EvalFrac (($ans -replace '^(\d+) (\d+/\d+)$', '$1_$2') -replace '\|.*$', '')
if ($want -ne $got) { [void]$script:errors.Add("$where : printed answer $ans, but $chk = $want") } } catch { [void]$script:errors.Add("$where : $_") }
}
# [[+ 184 216 135]] / [[- 5000 1234]] / [[x 345 27]]: a sum written in a column, the book's way; its result checks the answer
$cv = $null; $colSay = $null
if ($seg -match '\[\[([-+x])\s+([\d,. ]+)\]\]') {
$op = $Matches[1]; $ns = @($Matches[2].Trim() -split '\s+'); $seg = $seg.Replace($Matches[0], '').Trim()
$expr = ($ns | ForEach-Object { $_ -replace ',', '' }) -join $(switch ($op) { '+' { ' + ' } '-' { ' - ' } 'x' { ' * ' } })
try { $cv = EvalFrac $expr } catch { [void]$script:errors.Add("$where : $_") }
$colSay = switch ($op) { '+' { 'Add ' + (($ns | Select-Object -SkipLast 1) -join ', ') + ', and ' + $ns[-1] + '.' } '-' { "From $($ns[0]) take $($ns[1])." } 'x' { "Multiply $($ns[0]) by $($ns[1])." } }
if ($ans -eq '?') { $ans = "$cv" } elseif ($ans -match '^[\d.]+( \d+/\d+)?$' -and $ans -ne $cv -and (EvalFrac ($ans -replace ' ', '_')) -ne $cv) { [void]$script:errors.Add("$where : the column comes to $cv, not $ans") }
}
$p = [ordered]@{ t = (Display $seg) }
if ($null -ne $cv) { $p.col = [ordered]@{ op = $op; n = $ns } }
if ($ans -match '^(-?\d+)\.\.(-?\d+) by (-?\d+)$') {
$a = [int]$Matches[1]; $b = [int]$Matches[2]; $st = [int]$Matches[3]
$seq = @(); for ($v = $a; ($st -gt 0 -and $v -le $b) -or ($st -lt 0 -and $v -ge $b); $v += $st) { $seq += $v }
if ($seq[-1] -ne $b) { [void]$script:errors.Add("$where : count by $st from $a never lands on $b") }
$p.seq = $seq
} elseif ($ans -match '^\d+(\|\d+)+$') { # more than one right answer, e.g. {100|1} = 100 cents or 1 dollar
$all = @($ans -split '\|' | ForEach-Object { [int]$_ }); $p.a = $all[0]; $p.alt = @($all | Select-Object -Skip 1)
} elseif ($ans -match '^[\d./ ]+(\|[\d./ ]+)+$') { # either form, e.g. money to mills or exact: {23.062|23.0625}
$all = @($ans -split '\|' | ForEach-Object { $_.Trim() }); $p.f = $all[0]; $p.falt = @($all | Select-Object -Skip 1)
} elseif ($ans -match '^~\s*(.+)$') { # worked out exactly: {~ 1/2 + 1/4} -> 3/4
# {~d expr} or an expression with a decimal in it: show a decimal answer when it ends (2.78, not 2 39/50)
# {~c4 expr}: the answer as a complex decimal carried to 4 places (.0154 1/4), the book's way with complex decimals
# {~r3 expr}: rounded to 3 decimal places ("preserving three places"); the cut-off value is taken too
$ex = $Matches[1]
# {~m expr}: money to the cent; the book works interest by aliquot parts carried to mills, so a cent either way is right too
if ($ex -match '^m\s+(.+)$') {
try { [void](EvalFrac $Matches[1]); $r = $script:lastRat; $x = [decimal]$r[0] / [decimal]$r[1]
$c = [Math]::Round($x * 100, [MidpointRounding]::AwayFromZero)
$p.f = ($c / 100).ToString('0.00'); $p.falt = @((($c - 1) / 100).ToString('0.00'), (($c + 1) / 100).ToString('0.00')) } catch { [void]$script:errors.Add("$where : $_") }
$ex = $null
}
elseif ($ex -match '^r(\d+)\s+(.+)$') {
$rp = [int]$Matches[1]; $rex = $Matches[2]
try { [void](EvalFrac $rex); $r = $script:lastRat; $sc = [decimal][Math]::Pow(10, $rp); $x = [decimal]$r[0] / [decimal]$r[1]
$rnd = [Math]::Round($x * $sc, [MidpointRounding]::AwayFromZero) / $sc; $cut = [Math]::Truncate($x * $sc) / $sc
$fmt = { param($v) $s = $v.ToString('0.' + ('0' * $rp)); if ($rp -eq 0) { $s = $v.ToString('0') }; if ($s.StartsWith('0.')) { $s.Substring(1) } else { $s } }
$p.f = & $fmt $rnd; if ($cut -ne $rnd) { $p.falt = @(& $fmt $cut) } } catch { [void]$script:errors.Add("$where : $_") }
$ex = $null
}
# {~p 320,16_1/2,12 # 2 # expr}: a compound number. expr is the whole quantity in the lowest unit (inches);
# the chain gives how many of each unit make one of the unit above (mi.>rd.>ft.>in.); # 2 asks for the 3rd unit (ft.).
# Every unit but the last is a whole number; the last takes the remainder (decimal when it ends, else a fraction).
if ($null -ne $ex -and $ex -match '^p\s+([^#]*)#\s*(\d+)\s*#\s*(.+)$') {
$chain = @($Matches[1].Trim() -split '\s*,\s*'); $idx = [int]$Matches[2]; $pex = $Matches[3].Trim()
if ($pex -eq '$') { $pex = $script:lastPex; $chain = $script:lastChain } else { $script:lastPex = $pex; $script:lastChain = $chain } # {~p # 1 # $}: same quantity, next unit
try {
[void](EvalFrac $pex); $rem = $script:lastRat
for ($k = 0; $k -le $chain.Count; $k++) {
$sz = $(if ($k -lt $chain.Count) { [void](EvalFrac (($chain[$k..($chain.Count - 1)]) -join ' * ')); $script:lastRat } else { ,@([long]1, [long]1) })
if ($k -eq $chain.Count) { $part = $rem } else {
$qq = [long][Math]::Floor(([decimal]$rem[0] * $sz[1]) / ([decimal]$rem[1] * $sz[0]))
$part = Rat $qq 1; $rem = Rat ($rem[0] * $sz[1] - $qq * $sz[0] * $rem[1]) ($rem[1] * $sz[1]) }
if ($k -eq $idx) { $ps = RatStr $part; if ($ps -match '^\d+$') { $p.a = [long]$ps } else { $p.f = $(if ($pex -match '\d\.\d') { AsDec $ps } else { $ps })
# the book often gives the last unit "nearly": accept it rounded or cut to 0-4 places too
$x = ([decimal]($part[0])) / ([decimal]($part[1])); $alts = @()
foreach ($dp in 0..4) { $sc = [decimal][Math]::Pow(10, $dp); foreach ($v in @(([Math]::Round($x * $sc, [MidpointRounding]::AwayFromZero) / $sc), ([Math]::Truncate($x * $sc) / $sc))) { $vs = $v.ToString('0.####'); if ($vs.StartsWith('0.')) { $vs = $vs.Substring(1) }; if ($alts -notcontains $vs) { $alts += $vs } } }
if ($pex -match '\d\.\d' -or $part[1] -gt 100) { $p.falt = $alts } }; break }
}
} catch { [void]$script:errors.Add("$where : $_") }
$ex = $null
}
if ($null -ne $ex) {
# {~q expr}: as a common fraction, with the circulate shown after the question (.45(3))
$wantRep = $ex -match '^q\s'; $ex = $ex -replace '^q\s+', ''
$cp = $(if ($ex -match '^c(\d+)\s') { [int]$Matches[1] } else { -1 }); $ex = $ex -replace '^c\d+\s+', ''
$wantDec = $ex -match '^d\s' -or $ex -match '\d*\.\d'; $ex = $ex -replace '^d\s+', ''
try { $v = EvalFrac $ex; if ($wantRep) { [void]$script:reps.Add((AsRep $script:lastRat)) }
if ($cp -ge 0) { $c = AsCplx $script:lastRat $cp; if ($c -match '^\d+$') { $p.a = [long]$c } else { $p.f = $c } }
elseif ($v -match '^\d+$') { $p.a = [long]$v } else { $p.f = $(if ($wantDec) { AsDec $v } else { $v }) } } catch { [void]$script:errors.Add("$where : $_") }
}
} elseif ($ans -match '^=(.+)$') { # exact written form, e.g. {=1/2} for "reduce to lowest terms"; {=3/6|1/2} more than one
$ex = @($Matches[1] -split '\|' | ForEach-Object { $_.Trim() }); $p.f = $ex[0]; $p.ex = $ex
} elseif ($ans -eq '$') { # algebra: typed on the algebra pad, checked by alg.js (same value, written as simply)
$e = $algE; $chk = $null
# {$~ (a+b)(c+d)}: multiplied out exactly, written the book's way
$expand = { param($x) try { [RaysAlgCheck]::Expand($x) } catch { [void]$script:errors.Add("$where : $($_.Exception.InnerException.Message) in $x"); '0' } }
if ($e -match '^~\s*(.+)$') { $e = & $expand $Matches[1] }
else {
if ($e -match '^(.+?)\s+@\s*(.+)$') { $e = $Matches[1].Trim(); $chk = $Matches[2].Trim() }
# {$ x^2(x+a) | ~x^2(x+a)}: other ways that count too (~ = multiplied out)
$alts = @($e -split '\s*\|\s*'); $e = $alts[0]
if ($alts.Count -gt 1) { $p.ealt = @($alts[1..($alts.Count - 1)] | ForEach-Object { if ($_ -match '^~\s*(.+)$') { & $expand $Matches[1] } else { $_ } }) }
}
# @gcd: A; B = the answer divides each evenly; @lcm: A; B = each divides the answer evenly
if ($chk -match '^(gcd|lcm):\s*(.+)$') {
$mode = $Matches[1]
foreach ($qq in @($Matches[2] -split '\s*;\s*')) {
try { [void][RaysAlgCheck]::Expand($(if ($mode -eq 'gcd') { "($qq)/($e)" } else { "($e)/($qq)" })) } catch { [void]$script:errors.Add("$where : $e is not a $(if ($mode -eq 'gcd') { 'divisor' } else { 'multiple' }) of $qq") }
}
$chk = $null
}
foreach ($x in @($p.ealt)) { if ($x) { $r = [RaysAlgCheck]::Same($x, $e); if ($r) { [void]$script:errors.Add("$where : alternative $r") } } }
$p.e = $e; $p.es = AlgSay $e
# pad letters: the answer's and the question's (so they don't give the answer away); none for a plain number
$p.v = $(if ($e -match "[a-z$([char]0x221A)]") { AlgLetters ($e + ' ' + (@([regex]::Matches($seg, '`([^`]*)`') | ForEach-Object { $_.Groups[1].Value }) -join ' ')) } else { '' })
if ($chk) {
# @sq: radicand = the answer squared gives it (a square root)
$r = $(if ($chk -match '^sq:\s*(.+)$') { [RaysAlgCheck]::Same("($e)^2", $Matches[1]) } elseif ($chk -match '^([a-z]):\s*(.+)$') { [RaysAlgCheck]::Holds("$($Matches[1])=$e", @($Matches[2] -split '\s*;\s*')) } else { [RaysAlgCheck]::Same($e, $chk) })
if ($r) { [void]$script:errors.Add("$where : $r") }
} else { $r = [RaysAlgCheck]::Same($e, $e); if ($r) { [void]$script:errors.Add("$where : can't read answer: $r") } }
} elseif ($ans -eq 'open') { # answered out loud to a grown-up (e.g. "Give two numbers which make 10")
$p.open = $true
} elseif ($ans -match '^(\d+ )?\d+/\d+$' -or $ans -match '^\d*\.\d+$' -or $ans -match '^\d*\.\d+ \d+/\d+$') { # fraction, mixed number, decimal, or complex decimal (.0154 1/4)
$p.f = $ans
} elseif ($ans -eq '?') {
$v = Calc $seg
if ($null -eq $v) { [void]$script:errors.Add("$where : can't work out {?} for '$seg'") } else { $p.a = $v }
} elseif ($ans -match '^\d+$') {
$p.a = [long]$ans
$v = Calc $seg
if ($null -ne $v -and $v -ne $p.a) { [void]$script:errors.Add("$where : '$seg' is $v, not $ans") }
} else { [void]$script:errors.Add("$where : bad answer {$ans}") }
if ($colSay) { $p.s = ((Spoken $seg) + ' ' + $colSay).Trim() } elseif ((Spoken $seg) -ne $seg) { $p.s = Spoken $seg }
[void]$parts.Add($p)
}
# "x = {A} or {B}": either order (the two roots of a quadratic); app.js swaps them when B comes first
for ($k = 1; $k -lt $parts.Count; $k++) { if ($parts[$k].t -match '^or\b') { $parts[$k - 1].pr = 1 } }
$tail = $q.Substring($pos).Trim()
if ($tail) { if ($parts.Count) { $parts[$parts.Count - 1].t += ' ' + $tail } else { [void]$script:errors.Add("$where : question has no {answer}") } }
$res = [ordered]@{ parts = $parts.ToArray() }
if ($script:reps.Count) { $res.sol = 'As a circulate: ' + ($script:reps -join '; ') + '.' }
return $res
}
# ---------- lessons ----------
$lessons = New-Object System.Collections.ArrayList
$L = $null; $lastQ = $null; $qn = 0
foreach ($line in $src) {
if ($line -match '^\s*(#|$)' -or $line -match '^@book: ') { continue }
if ($line -match '^== (\d+) \| ([^|]+) \| (.+)$') {
$L = [ordered]@{ n = [int]$Matches[1]; part = $Matches[2].Trim(); title = $Matches[3].Trim(); kind = 'problems' }
$L.review = $L.part -eq 'Review'
[void]$lessons.Add($L); $lastQ = $null; $lastArt = $null; $qn = 0; continue
}
if (-not $L) { continue }
$where = "Lesson $($L.n)"
if ($line -match '^kind: (count|numbers) (\d+) (\d+)$') { $L.kind = $Matches[1]; $L.from = [int]$Matches[2]; $L.to = [int]$Matches[3] }
elseif ($line -match '^kind: (read|write)$') { $L.kind = $Matches[1] }
elseif ($line -match '^list: (.+)$') { $L.list = @($Matches[1] -split '\s+' | ForEach-Object { [int]$_ }) }
elseif ($line -match '^note: (.+)$') { $L.note = $Matches[1] }
elseif ($line -match '^table: (add|sub|mul|div) (\d+)$') { $L.op = $Matches[1]; $L.table = Table $Matches[1] ([int]$Matches[2]) }
elseif ($line -match '^table: \+(add|sub|mul|div) (\d+) (\d+)( from 0)?$') { # Book Two style "2 + 1 = 3" ... "2 + 12 = 14"; several add up
$L.op = $Matches[1]; $op = $Matches[1]; $n = [int]$Matches[2]; $max = [int]$Matches[3]; $k0 = $(if ($Matches[4]) { 0 } else { 1 }) # Book Three: "2 + 0 = 2"
$rows = New-Object System.Collections.ArrayList; if ($L.table) { [void]$rows.AddRange(@($L.table)) }
foreach ($k in $k0..$max) {
switch ($op) {
'add' { $r = $n + $k; [void]$rows.Add([ordered]@{ t = "$n + $k = $r"; q = "How many are $n and $k?"; a = $n; b = $k; r = $r }) }
'sub' { $m = $n + $k - 1; $r = $k - 1; [void]$rows.Add([ordered]@{ t = "$m - $n = $r"; q = "$n from $m leaves how many?"; a = $n; b = $m; r = $r }) }
'mul' { $r = $n * $k; [void]$rows.Add([ordered]@{ t = "$k x $n = $r"; q = "How many are $k times $n?"; a = $k; b = $n; r = $r }) } # the book's columns: 1 x 4, 2 x 4 ... 12 x 4
'div' { $m = $n * $k; [void]$rows.Add([ordered]@{ t = "$m / $n = $k"; q = "How many times is $n contained in $m?"; a = $n; b = $m; r = $k }) }
}
}
foreach ($f in $rows) { $f.t = Display $f.t }
$L.table = $rows.ToArray()
}
elseif ($line -match '^rule: (\d+) (.+) make 1 (.+)$') {
if (-not $L.rules) { $L.rules = New-Object System.Collections.ArrayList }
$r = [ordered]@{ t = "$($Matches[1]) $($Matches[2]) make 1 $($Matches[3])"; q = "How many $($Matches[2]) make 1 $($Matches[3])?"; n = [int]$Matches[1]; a = $Matches[2]; b = $Matches[3] }
if ($r.a -match '\d|^and ') { $r.quiz = $false } # "365 days and 6 hours": show it, don't quiz it
[void]$L.rules.Add($r)
}
elseif ($line -match '^q: (.+)$') {
$qn++; if (-not $L.qs) { $L.qs = New-Object System.Collections.ArrayList }
$lastQ = Question $Matches[1] "$where q$qn"; [void]$L.qs.Add($lastQ)
}
elseif ($line -match '^sol: (.+)$') { if ($lastQ) { $lastQ.sol = $Matches[1] } else { [void]$script:errors.Add("$where : sol without a question") } }
# Book Five (Geometry): the book's articles to study, each with its figure cut from the scan, then a quiz
elseif ($line -match '^art: (\d+) \| ([^|]*) \| (.+)$') {
if (-not $L.arts) { $L.arts = New-Object System.Collections.ArrayList }
$lastArt = [ordered]@{ n = [int]$Matches[1]; h = $Matches[2].Trim(); t = $Matches[3].Trim() }; [void]$L.arts.Add($lastArt)
if ("$($lastArt.h)$($lastArt.t)".Contains('`')) { $lastArt.s = "$($lastArt.n). $(if ($lastArt.h) { "$(Spoken $lastArt.h). " })$(Spoken $lastArt.t)"; $lastArt.h = Display $lastArt.h; $lastArt.t = Display $lastArt.t }
}
elseif ($line -match '^chk: ([^|]+)\|(.+)$') { # chk: x=5, y=4 | x+y=9 | x-y=1
$r = [RaysAlgCheck]::Holds($Matches[1].Trim(), @($Matches[2] -split '\s*\|\s*' | ForEach-Object { $_.Trim() }))
if ($r) { [void]$script:errors.Add("$where : $r") }
}
elseif ($line -match '^fig: (\d+) ([\d.]+) ([\d.]+)( [\d.]+ [\d.]+)?$') { # page top bottom [left right], fractions of the page
if (-not $lastArt) { [void]$script:errors.Add("$where : fig without an art"); continue }
$fk = "p$($Matches[1])-" + [int]([double]$Matches[2] * 1000)
$lastArt.figs = @($lastArt.figs | Where-Object { $_ }) + "fig/$($bk[0])/$fk.png" # an article may have several
}
elseif ($line -match '^mc: (.+)$') {
$parts = @($Matches[1] -split '\s*\|\s*'); $ch = @($parts[1..($parts.Count - 1)])
$right = @(for ($i = 0; $i -lt $ch.Count; $i++) { if ($ch[$i] -like '[*]*') { $i } })
if ($ch.Count -lt 2 -or $right.Count -ne 1) { [void]$script:errors.Add("$where : mc needs 2+ choices and one *right one: '$line'"); continue }
if (-not $L.quiz) { $L.quiz = New-Object System.Collections.ArrayList }
$cs = @($ch | ForEach-Object { $_ -replace '^\*', '' }); $item = [ordered]@{ q = $parts[0]; c = $cs; a = $right[0] }
if ($line.Contains('`')) { $item.q = Display $parts[0]; $item.c = @($cs | ForEach-Object { Display $_ }); $item.qs = Spoken $parts[0]; $item.cs = @($cs | ForEach-Object { Spoken $_ }) } # algebra: shown the book's way, and what the voice says
[void]$L.quiz.Add($item)
}
elseif ($line -match '^tf: (.+) \{([TF])\}$') {
if (-not $L.quiz) { $L.quiz = New-Object System.Collections.ArrayList }
$tq = $Matches[1]; $item = [ordered]@{ q = $tq; c = @('True', 'False'); a = $(if ($Matches[2] -eq 'T') { 0 } else { 1 }); tf = $true }
if ($tq.Contains('`')) { $item.q = Display $tq; $item.qs = Spoken $tq }
[void]$L.quiz.Add($item)
}
else { [void]$script:errors.Add("$where : can't read line '$line'") }
}
foreach ($L in $lessons) {
if ($L.rules) { $L.rules = $L.rules.ToArray() }
if ($L.qs) { $L.qs = $L.qs.ToArray() }
if ($L.arts) { $L.arts = $L.arts.ToArray() }
if ($L.quiz) { $L.quiz = $L.quiz.ToArray() }
if ($L.kind -eq 'problems' -and -not $L.qs -and -not $L.rules -and -not $L.table -and -not $L.arts) { [void]$script:errors.Add("Lesson $($L.n) : no questions") }
}
$nums = @($lessons | ForEach-Object { $_.n })
for ($i = 0; $i -lt $nums.Count; $i++) { if ($nums[$i] -ne $i + 1) { [void]$script:errors.Add("lesson numbers out of order at $($nums[$i])"); break } }
if ($script:errors.Count) { "PROBLEMS:"; $script:errors; exit 1 }
$out = [ordered]@{ id = $bk[0]; title = $bk[1]; sub = $bk[2]; color = $bk[3]; lessons = $lessons.ToArray() }
New-Item -ItemType Directory -Force "$root\public\books" | Out-Null
[IO.File]::WriteAllText("$root\public\books\$($bk[0]).json", ($out | ConvertTo-Json -Depth 10 -Compress), (New-Object Text.UTF8Encoding $false))
$q = ($lessons | ForEach-Object { @($_.qs).Count } | Measure-Object -Sum).Sum
$a = ($lessons | ForEach-Object { foreach ($x in @($_.qs)) { if ($x) { $x.parts.Count } } } | Measure-Object -Sum).Sum
"$($lessons.Count) lessons, $q questions, $a answers -> public\books\$($bk[0]).json"
EOF
alg.cs: the algebra checker make-book.ps1 loads (same value at random numbers, solving equations, multiplying out).
cat > /root/rays-rebuild/alg.cs <<'EOF'
// Algebra checks for make-book.ps1 (Book 6): reads expressions the way public/alg.js does (2ab = 2*a*b, a/bc = a/(bc),
// x^2) and tests that two expressions have the same value, or that values make an equation true, at random numbers.
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
public static class RaysAlgCheck {
class P {
List<string> tk; int i;
public P(string s) {
tk = new List<string>();
foreach (Match m in Regex.Matches(s.Replace("−", "-"), @"\d+\.?\d*|\.\d+|[a-z]|[-+*/^()]|\S")) tk.Add(m.Value);
}
string Peek() { return i < tk.Count ? tk[i] : null; }
string Take() { if (i >= tk.Count) throw new Exception("unexpected end"); return tk[i++]; }
bool StartsAtom(string t) { return t != null && (char.IsDigit(t[0]) || t[0] == '.' || (t[0] >= 'a' && t[0] <= 'z') || t == "(" || t == "√"); }
public Func<Dictionary<string, double>, double> All() { var f = Sum(); if (i != tk.Count) throw new Exception("couldn't read '" + tk[i] + "'"); return f; }
Func<Dictionary<string, double>, double> Atom() {
string t = Take();
if (t == "(") { var a = Sum(); if (Take() != ")") throw new Exception("missing )"); return a; }
if (t == "√") { var r = Pow(); return e => Math.Sqrt(r(e)); }
if (t.Length == 1 && t[0] >= 'a' && t[0] <= 'z') { string n = t; return e => { double v; if (!e.TryGetValue(n, out v)) throw new Exception("no value for " + n); return v; }; }
double num; if (double.TryParse(t, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out num)) return e => num;
throw new Exception("bad token '" + t + "'");
}
Func<Dictionary<string, double>, double> Pow() {
var b = Atom();
if (Peek() == "^") { Take(); int sg = 1; if (Peek() == "-") { Take(); sg = -1; } int ex = int.Parse(Take()) * sg; return e => Math.Pow(b(e), ex); }
return b;
}
Func<Dictionary<string, double>, double> Imp() {
var f = Pow();
while (StartsAtom(Peek())) { var a = f; var b = Pow(); f = e => a(e) * b(e); }
return f;
}
Func<Dictionary<string, double>, double> Term() {
var f = Imp();
while (Peek() == "*" || Peek() == "/") { string op = Take(); var a = f; var b = Imp(); if (op == "*") f = e => a(e) * b(e); else f = e => a(e) / b(e); }
return f;
}
Func<Dictionary<string, double>, double> Sum() {
Func<Dictionary<string, double>, double> f;
if (Peek() == "-") { Take(); var t = Term(); f = e => -t(e); } else { if (Peek() == "+") Take(); f = Term(); }
while (Peek() == "+" || Peek() == "-") { string op = Take(); var a = f; var b = Term(); if (op == "+") f = e => a(e) + b(e); else f = e => a(e) - b(e); }
return f;
}
}
// ---------- exact polynomials: {$~ (a+b)(c+d)} -> "ac+ad+bc+bd" ----------
// A term's key is its letters with exponents in alphabet order ("a2b1"); coefficients are exact fractions.
class Q { public long n, d; public Q(long n, long d) { if (d < 0) { n = -n; d = -d; } long g = G(Math.Abs(n), d); this.n = n / g; this.d = d / g; }
static long G(long a, long b) { while (b != 0) { long t = a % b; a = b; b = t; } return a == 0 ? 1 : a; }
public static Q operator +(Q a, Q b) { return new Q(a.n * b.d + b.n * a.d, a.d * b.d); }
public static Q operator *(Q a, Q b) { return new Q(a.n * b.n, a.d * b.d); } }
class Poly : Dictionary<string, Q> {
public static Poly C(Q q) { var p = new Poly(); if (q.n != 0) p[""] = q; return p; }
public static Poly V(string v) { var p = new Poly(); p[v + "1"] = new Q(1, 1); return p; }
static SortedDictionary<string, int> Split(string k) { var m = new SortedDictionary<string, int>(StringComparer.Ordinal); foreach (Match x in Regex.Matches(k, "([a-z])(\\d+)")) m[x.Groups[1].Value] = int.Parse(x.Groups[2].Value); return m; }
static string Join(SortedDictionary<string, int> m) { var s = ""; foreach (var kv in m) if (kv.Value != 0) s += kv.Key + kv.Value; return s; }
public Poly Add(Poly o, int sg) { var r = new Poly(); foreach (var kv in this) r[kv.Key] = kv.Value; foreach (var kv in o) { Q c = kv.Value * new Q(sg, 1); Q old; r[kv.Key] = r.TryGetValue(kv.Key, out old) ? old + c : c; if (r[kv.Key].n == 0) r.Remove(kv.Key); } return r; }
public Poly Mul(Poly o) { var r = new Poly(); foreach (var a in this) foreach (var b in o) { var m = Split(a.Key); foreach (var kv in Split(b.Key)) { int e; m[kv.Key] = (m.TryGetValue(kv.Key, out e) ? e : 0) + kv.Value; } var k = Join(m); Q c = a.Value * b.Value; Q old; r[k] = r.TryGetValue(k, out old) ? old + c : c; if (r[k].n == 0) r.Remove(k); } return r; }
// exact division: by a number or a monomial term by term, else long division (must come out even)
public Poly Div(Poly b) {
if (b.Count == 0) throw new Exception("division by 0");
var lead = b.Lead(); var r = new Poly(); var rem = this; int guard = 0;
while (rem.Count > 0) {
if (++guard > 500) throw new Exception("division doesn't end");
var t = rem.Lead(); var qk = DivKey(t, lead);
if (qk == null) throw new Exception("doesn't divide evenly");
Q c = rem[t] * new Q(b[lead].d, b[lead].n); var term = new Poly(); term[qk] = c;
r = r.Add(term, 1); rem = rem.Add(term.Mul(b), -1);
}
return r;
}
static string DivKey(string a, string b) { var m = Split(a); foreach (var kv in Split(b)) { int e; if (!m.TryGetValue(kv.Key, out e) || e < kv.Value) return null; m[kv.Key] = e - kv.Value; } return Join(m); }
static string LexKey(string k) { var s = ""; foreach (char c in "abcdefghijklmnopqrstuvwxyz") { int e; s += (char)('z' - (Split(k).TryGetValue(c.ToString(), out e) ? e : 0)); } return s; }
public string Lead() { string best = null; foreach (var k in Keys) if (best == null || string.CompareOrdinal(LexKey(k), LexKey(best)) < 0) best = k; return best; }
public Poly Pow(int e) { if (e < 0) throw new Exception("negative power"); var r = C(new Q(1, 1)); for (int i = 0; i < e; i++) r = r.Mul(this); return r; }
// the book's order: alphabetical, higher powers first (a^3b^2+a^2bcd^2+abcd+c^2d^3), numbers last
public string Str() {
var keys = new List<string>(Keys);
Func<string, string> lex = k => { var s = ""; foreach (char c in "abcdefghijklmnopqrstuvwxyz") { int e; s += (char)('z' - (Split(k).TryGetValue(c.ToString(), out e) ? e : 0)); } return s; };
keys.Sort((x, y) => string.CompareOrdinal(lex(x), lex(y)));
var o = "";
foreach (var k in keys) {
Q q = this[k]; long n = Math.Abs(q.n); var lets = "";
foreach (var kv in Split(k)) lets += kv.Key + (kv.Value > 1 ? "^" + kv.Value : "");
string t = (n == 1 && lets != "" ? "" : n.ToString()) + lets + (q.d != 1 ? "/" + q.d : "");
o += (q.n < 0 ? "-" : (o == "" ? "" : "+")) + t;
}
return o == "" ? "0" : o;
}
}
class PP {
List<string> tk; int i;
public PP(string s) { tk = new List<string>(); foreach (Match m in Regex.Matches(s.Replace("−", "-"), @"\d+|[a-z]|[-+*/^()]|\S")) tk.Add(m.Value); }
string Peek() { return i < tk.Count ? tk[i] : null; }
string Take() { if (i >= tk.Count) throw new Exception("unexpected end"); return tk[i++]; }
bool StartsAtom(string t) { return t != null && (char.IsDigit(t[0]) || (t[0] >= 'a' && t[0] <= 'z') || t == "("); }
public Poly All() { var p = Sum(); if (i != tk.Count) throw new Exception("couldn't read '" + tk[i] + "'"); return p; }
Poly Atom() { string t = Take(); if (t == "(") { var a = Sum(); if (Take() != ")") throw new Exception("missing )"); return a; }
if (t.Length == 1 && t[0] >= 'a' && t[0] <= 'z') return Poly.V(t);
long n; if (long.TryParse(t, out n)) return Poly.C(new Q(n, 1)); throw new Exception("can't expand '" + t + "'"); }
Poly Pow() { var b = Atom(); if (Peek() == "^") { Take(); return b.Pow(int.Parse(Take())); } return b; }
Poly Imp() { var f = Pow(); while (StartsAtom(Peek())) f = f.Mul(Pow()); return f; }
Poly Term() { var f = Imp(); while (Peek() == "*" || Peek() == "/") { string op = Take(); var b = Imp(); if (op == "*") f = f.Mul(b); else f = f.Div(b); } return f; }
Poly Sum() { Poly f; if (Peek() == "-") { Take(); f = Poly.C(new Q(0, 1)).Add(Term(), -1); } else { if (Peek() == "+") Take(); f = Term(); }
while (Peek() == "+" || Peek() == "-") { int sg = Take() == "+" ? 1 : -1; f = f.Add(Term(), sg); } return f; }
}
public static string Expand(string e) { return new PP(e).All().Str(); }
static Random rnd = new Random(7);
static List<string> Letters(string s) { var l = new List<string>(); foreach (Match m in Regex.Matches(s, "[a-z]")) if (!l.Contains(m.Value)) l.Add(m.Value); return l; }
static bool Close(double x, double y) { return Math.Abs(x - y) <= 1e-7 * Math.Max(1, Math.Abs(y)); }
// "" when a and b have the same value, else why not
public static string Same(string a, string b) {
try {
var fa = new P(a).All(); var fb = new P(b).All(); var vs = Letters(a + " " + b); int ok = 0;
bool pos = (a + b).Contains("√"); // with roots, letters stand for positive numbers
for (int k = 0; k < 60 && ok < 8; k++) {
var env = new Dictionary<string, double>(); foreach (var v in vs) env[v] = (0.6 + rnd.NextDouble() * 2.7) * (!pos && rnd.NextDouble() < 0.3 ? -1 : 1);
double x = fa(env), y = fb(env); if (double.IsNaN(x) || double.IsInfinity(x) || double.IsNaN(y) || double.IsInfinity(y)) continue;
if (!Close(x, y)) return a + " is not " + b;
ok++;
}
return ok >= 3 ? "" : "couldn't try " + a + " = " + b;
} catch (Exception e) { return e.Message + " in " + a + " / " + b; }
}
// "x=5, y=4" makes every "lhs = rhs" in eqs true (other letters random; a value may use them: "x=(b-d)/2")
public static string Holds(string assigns, string[] eqs) {
try {
var vals = new List<KeyValuePair<string, Func<Dictionary<string, double>, double>>>();
string all = "";
foreach (var part in assigns.Split(',')) { var kv = part.Split('='); vals.Add(new KeyValuePair<string, Func<Dictionary<string, double>, double>>(kv[0].Trim(), new P(kv[1]).All())); all += kv[1] + " "; }
var sides = new List<Func<Dictionary<string, double>, double>[]>();
foreach (var q in eqs) { var lr = q.Split('='); if (lr.Length != 2) return "not an equation: " + q; sides.Add(new[] { new P(lr[0]).All(), new P(lr[1]).All() }); all += q + " "; }
var free = Letters(all); foreach (var kv in vals) free.Remove(kv.Key);
int ok = 0; bool pos = all.Contains("√");
for (int k = 0; k < 60 && ok < 8; k++) {
var env = new Dictionary<string, double>(); foreach (var v in free) env[v] = (0.6 + rnd.NextDouble() * 2.7) * (!pos && rnd.NextDouble() < 0.3 ? -1 : 1);
foreach (var kv in vals) env[kv.Key] = kv.Value(env);
bool skip = false;
for (int j = 0; j < sides.Count; j++) {
double x = sides[j][0](env), y = sides[j][1](env);
if (double.IsNaN(x) || double.IsInfinity(x) || double.IsNaN(y) || double.IsInfinity(y)) { skip = true; break; }
if (!Close(x, y)) return assigns + " doesn't make " + eqs[j] + " true (" + x + " vs " + y + ")";
}
if (!skip) ok++;
}
return ok >= 3 ? "" : "couldn't try " + assigns;
} catch (Exception e) { return e.Message + " in " + assigns; }
}
}
EOF
make-audio.ps1: records every line of a book with Eloquence: -Id algebra1.
cat > /root/rays-rebuild/make-audio.ps1 <<'EOF'
# Records everything Ray's Arithmetic says with the PC's ETI-Eloquence (Reed, the same voice as ABC Books) at each
# speed, then writes public/audio/<id>.json (what the app asks for -> clip id). WAVs land in tools/out/s<speed>/,
# shared by every book (a line two books both say is recorded once).
# Usage: powershell -ExecutionPolicy Bypass -File RaysArithmetic\tools\make-audio.ps1 [-Id primary1877|intellectual|...]
# The keys must match app.js: prompts, "lesson:N", "n:N", "find:N", "ans:N", and the book's own texts.
param([string]$Id = 'primary1877', [int[]]$Speeds = @(60, 75))
$root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
$book = Get-Content "$root\public\books\$Id.json" -Raw -Encoding UTF8 | ConvertFrom-Json
$P = Get-Content "$root\public\prompts.json" -Raw -Encoding UTF8 | ConvertFrom-Json
$kids = 'Layla', 'Lavon', 'Lilly'
$say = New-Object System.Collections.Specialized.OrderedDictionary ([StringComparer]::Ordinal)
function Add($key, $spoken) { if ($key -and -not $say.Contains([string]$key)) { $say[[string]$key] = $(if ($spoken) { $spoken } else { [string]$key }) } }
foreach ($pr in $P.PSObject.Properties) { if ($pr.Value -like '*{kid}*') { foreach ($k in $kids) { Add ($pr.Value -replace '\{kid\}', $k) } } else { Add $pr.Value } }
foreach ($k in $kids) { Add "Great job, $k!" }
foreach ($n in 0..100) { Add "n:$n" "$n."; Add "find:$n" "Find $n." }
# "2 1/2" -> "2 and 1 half", "3/4" -> "3 fourths": how the book says fractions
# any denominator as an ordinal word: 23 -> twenty-third, 115 -> one hundred and fifteenth
function OrdWord([int]$d) {
$o = 'zero one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen' -split ' '
$t = ',,twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety' -split ','
$oo = @{ one = 'first'; two = 'second'; three = 'third'; five = 'fifth'; eight = 'eighth'; nine = 'ninth'; twelve = 'twelfth' }
function Card([int]$n) { if ($n -lt 20) { return $o[$n] }; $w = $t[[Math]::Floor($n / 10)]; if ($n % 10) { $w += '-' + $o[$n % 10] }; $w }
$words = @()
if ($d -ge 1000) { $words += (Card ([Math]::Floor($d / 1000))) + ' thousand'; $d = $d % 1000 }
if ($d -ge 100) { $words += (Card ([Math]::Floor($d / 100))) + ' hundred'; $d = $d % 100 }
if ($d) { if ($words.Count) { $words += 'and' }; $words += (Card $d) }
$s = $words -join ' '
if ($s -match '^(.*?)(\w+)$') { $head = $Matches[1]; $last = $Matches[2] }
$last = $(if ($oo[$last]) { $oo[$last] } elseif ($last -match 'y$') { $last -replace 'y$', 'ieth' } else { $last + 'th' })
$head + $last
}
function Frac([string]$f) {
$den = @{ 2 = 'half'; 3 = 'third'; 4 = 'fourth'; 5 = 'fifth'; 6 = 'sixth'; 7 = 'seventh'; 8 = 'eighth'; 9 = 'ninth'; 10 = 'tenth'; 11 = 'eleventh'; 12 = 'twelfth'; 20 = 'twentieth'; 100 = 'hundredth' }
if ($f -match '^\d*\.\d+$' -or $f -match '^\d+$') { return $f } # decimals, and whole numbers too long for a number ({=digits})
if ($f -match '^(\d*\.\d+) (\d+/\d+)$') { return "$($Matches[1]) and $(Frac $Matches[2])" } # complex decimal: .0154 1/4
$w = ''; if ($f -match '^(\d+) (.+)$') { $w = "$($Matches[1]) and "; $f = $Matches[2] }
$n, $d = $f -split '/'; $name = $den[[int]$d]; if (-not $name) { $name = OrdWord ([int]$d) }
if ($name -eq 'half' -and [int]$n -gt 1) { $name = 'halve' }
return "$w$n $name$(if ([int]$n -gt 1) { 's' })"
}
function GeoSay([string]$s) {
$s = $s -replace '\s*\(\d+(, ?\d+)*\)', ''
[regex]::Replace($s, '\b[A-Z]{2,6}\b', { param($m) ($m.Value.ToCharArray() -join ' ') })
}
# must match artKey() in app.js
function ArtKey($a) { "$($a.n). $(if ($a.h) { "$($a.h). " })$($a.t)" }
$answers = New-Object 'System.Collections.Generic.SortedSet[long]'
foreach ($L in $book.lessons) {
Add "lesson:$($L.n)" "Lesson $($L.n). $($L.title)."
foreach ($v in @($L.list)) { if ($null -ne $v) { [void]$answers.Add([long]$v); if ([long]$v -gt 100) { Add "n:$v" "$v." } } }
foreach ($f in @($L.table)) { if ($f) { Add $f.t; Add $f.q; [void]$answers.Add([long]$f.r) } }
foreach ($r in @($L.rules)) { if ($r) { Add $r.t; Add $r.q } }
foreach ($q in @($L.qs)) {
if (-not $q) { continue }
foreach ($p in $q.parts) {
$s = if ($p.s) { $p.s } else { $p.t }; Add $s
if ($null -ne $p.a) { [void]$answers.Add([long]$p.a) }
if ($p.f) { Add "ans:$($p.f)" "The answer is $(Frac $p.f)." }
if ($null -ne $p.e) { Add "ans:$($p.e)" "The answer is $($p.es)." } # algebra: es = the answer in words
foreach ($v in @($p.seq)) { if ($null -ne $v) { [void]$answers.Add([long]$v); if ($v -gt 100) { Add "n:$v" "$v." } } }
}
if ($q.sol) { Add $q.sol }
}
# Geometry: figure letters are said one by one ("AOE" -> "A O E"), article references "(103)" are not read
# Algebra: arts and quiz with math carry what to say (s, qs, cs) since "3a²" can't be read off the screen text
foreach ($a in @($L.arts)) { if ($a) { $k = ArtKey $a; Add $k $(if ($a.s) { $a.s } else { GeoSay $k }) } }
foreach ($x in @($L.quiz)) {
if (-not $x) { continue }
$qs = $(if ($x.qs) { $x.qs } else { GeoSay $x.q })
if ($x.tf) { Add $x.q "True or false? $qs" } else { Add $x.q $qs }
for ($i = 0; $i -lt @($x.c).Count; $i++) { $c = @($x.c)[$i]; Add "ansc:$c" $(if ($x.cs) { "The answer is: $(@($x.cs)[$i])." } else { GeoSay "The answer is: $c." }) }
}
}
foreach ($a in $answers) { Add "ans:$a" "The answer is $a." }
Add "Answer out loud, then tap Next."
"$($say.Count) clips per speed"
$sha = [Security.Cryptography.SHA1]::Create()
function Id($s) { (($sha.ComputeHash([Text.Encoding]::UTF8.GetBytes($s)) | Select-Object -First 6 | ForEach-Object { $_.ToString('x2') }) -join '') }
$items = New-Object System.Collections.Specialized.OrderedDictionary ([StringComparer]::Ordinal)
foreach ($k in $say.Keys) { $items[$k] = Id $say[$k] }
$ps32 = 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe'
foreach ($sp in $Speeds) {
$dir = "$root\tools\out\s$sp"; New-Item -ItemType Directory -Force $dir | Out-Null
$jobs = @(); $seen = @{}
foreach ($k in $say.Keys) { $cid = $items[$k]; if (-not $seen[$cid] -and -not (Test-Path "$dir\$cid.wav")) { $seen[$cid] = 1; $jobs += [ordered]@{ text = $say[$k]; out = "$dir\$cid.wav" } } }
"speed $sp : $($jobs.Count) to record"
for ($i = 0; $i -lt $jobs.Count; $i += 400) { # batches, so a long run shows progress
$jf = "$dir\jobs.json"; ConvertTo-Json @($jobs[$i..([Math]::Min($i + 399, $jobs.Count - 1))]) | Set-Content -Encoding utf8 $jf
& $ps32 -NoProfile -ExecutionPolicy Bypass -File "$root\tools\eloq-render.ps1" -Jobs $jf -Speed $sp | Out-Null
" $([Math]::Min($i + 400, $jobs.Count)) / $($jobs.Count)"
}
Remove-Item "$dir\*.wav.json" -ErrorAction SilentlyContinue # word times aren't used here
}
$out = [ordered]@{ speeds = $Speeds; items = $items }
New-Item -ItemType Directory -Force "$root\public\audio" | Out-Null
[IO.File]::WriteAllText("$root\public\audio\$Id.json", ($out | ConvertTo-Json -Depth 4 -Compress), (New-Object Text.UTF8Encoding $false))
"manifest: $root\public\audio\$Id.json"
EOF
alg.js: the algebra pad's reader and checker in the app.
cat > /root/rays-rebuild/alg.js <<'EOF'
// Algebra answers (Book 6, Ray's New Elementary Algebra): reads what the kid typed on the algebra pad (3a+2b, x^2-4,
// (a+3)(a+4), (b-d)/2, -5), shows it the book's way (x², −) and checks it against the book's answer.
// An answer is right when it has the same value (tried at several random numbers for the letters) AND is written as
// simply as the book's: a sum of unlike terms when the book's is one (copying the question back doesn't count), in
// factors when the book's answer is factored (any order), a fraction no bigger than the book's when it is a fraction.
window.RaysAlg = (() => {
const SUP = { 0: '⁰', 1: '¹', 2: '²', 3: '³', 4: '⁴', 5: '⁵', 6: '⁶', 7: '⁷', 8: '⁸', 9: '⁹' };
// the book's way: x^2 -> x², - -> −, * -> ×
const pretty = s => String(s).replace(/\^(-?\d+)/g, (m, d) => [...d].map(c => c === '-' ? '⁻' : SUP[c]).join('')).replace(/-/g, '−').replace(/\*/g, '×');
function tokens(s) {
const out = [], rx = /\s*(\d+\.?\d*|\.\d+|[a-z]|[-+*/^()√])/gy; let m, i = 0;
s = String(s).replace(/−/g, '-').replace(/[·×]/g, '*').trim();
while (i < s.length) { rx.lastIndex = i; m = rx.exec(s); if (!m) return null; out.push(m[1]); i = rx.lastIndex; while (s[i] === ' ') i++; }
return out;
}
// sum := [+-] term ([+-] term)* ; term := imp ([*/] imp)* ; imp := pow pow* (2ab: implicit times binds tighter than /,
// so a/bc = a/(bc) and 2x/3 = (2x)/3) ; pow := atom [^ int] ; atom := number | letter | ( sum )
function parse(s) {
const tk = tokens(s); if (!tk || !tk.length) return null; let i = 0;
const peek = () => tk[i], take = () => tk[i++];
const startsAtom = t => t !== undefined && (/^[\d.a-z√]/.test(t) || t === '(');
function atom() {
const t = take();
if (t === undefined) throw 0;
if (t === '√') return { t: 'sqrt', a: pow() }; // √a, √(a-x), 2√3
if (t === '(') { const a = sum(); if (take() !== ')') throw 0; return { t: 'par', a }; }
if (/^[a-z]$/.test(t)) return { t: 'var', n: t };
if (/^[\d.]/.test(t)) return { t: 'num', v: parseFloat(t), s: t };
throw 0;
}
function pow() {
const b = atom();
if (peek() === '^') { take(); let neg = false; if (peek() === '-') { take(); neg = true; } const e = take(); if (!/^\d+$/.test(e || '')) throw 0; return { t: 'pow', b, e: neg ? -e : +e }; }
return b;
}
function imp() { const f = [pow()]; while (startsAtom(peek())) f.push(pow()); return f.length === 1 ? f[0] : { t: 'mul', f }; }
function term() {
let a = imp();
while (peek() === '*' || peek() === '/') { const op = take(), b = imp(); a = op === '*' ? { t: 'mul', f: [a, b], x: 1 } : { t: 'div', a, b }; }
return a;
}
function sum() {
const terms = []; let sg = 1;
if (peek() === '-' || peek() === '+') sg = take() === '-' ? -1 : 1;
terms.push({ sg, a: term() });
while (peek() === '+' || peek() === '-') { const s2 = take() === '-' ? -1 : 1; terms.push({ sg: s2, a: term() }); }
return terms.length === 1 && terms[0].sg === 1 ? terms[0].a : { t: 'add', terms };
}
try { const r = sum(); return i === tk.length ? r : null; } catch (e) { return null; }
}
function ev(n, env) {
switch (n.t) {
case 'num': return n.v;
case 'var': return env[n.n];
case 'par': return ev(n.a, env);
case 'sqrt': return Math.sqrt(ev(n.a, env));
case 'pow': return Math.pow(ev(n.b, env), n.e);
case 'mul': return n.f.reduce((p, x) => p * ev(x, env), 1);
case 'div': return ev(n.a, env) / ev(n.b, env);
case 'add': return n.terms.reduce((p, x) => p + x.sg * ev(x.a, env), 0);
}
return NaN;
}
// a node written out again (for telling radicals apart: √a and √b are unlike terms)
const ser = n => n.t === 'num' ? n.s : n.t === 'var' ? n.n : n.t === 'par' ? `(${ser(n.a)})` : n.t === 'sqrt' ? `√${ser(n.a)}` : n.t === 'pow' ? `${ser(n.b)}^${n.e}` : n.t === 'mul' ? n.f.map(ser).join('*') : n.t === 'div' ? `${ser(n.a)}/${ser(n.b)}` : n.terms.map(x => (x.sg < 0 ? '-' : '+') + ser(x.a)).join('');
const letters = n => { const s = new Set(); (function w(x) { if (!x) return; if (x.t === 'var') s.add(x.n); ['a', 'b'].forEach(k => x[k] && typeof x[k] === 'object' && w(x[k])); (x.f || []).forEach(w); (x.terms || []).forEach(y => w(y.a)); })(n); return s; };
// same value: tried at 8 sets of random numbers (points where either side blows up are skipped)
function same(a, b) {
const vs = [...new Set([...letters(a), ...letters(b)])]; let tried = 0;
const pos = /√/.test(ser(a) + ser(b)); // with roots, letters stand for positive numbers (√(a^2) = a)
for (let k = 0; k < 40 && tried < 8; k++) {
const env = {}; vs.forEach(v => { env[v] = (0.6 + Math.random() * 2.7) * (!pos && Math.random() < 0.3 ? -1 : 1); });
const x = ev(a, env), y = ev(b, env);
if (!isFinite(x) || !isFinite(y) || Math.abs(y) > 1e12) continue;
if (Math.abs(x - y) > 1e-7 * Math.max(1, Math.abs(y))) return false;
tried++;
}
return tried >= 3;
}
// what is under a root is in simplest form: no square factor left in its number, no letter squared, no fraction
// (√(8a^2) is not simplest; 2a√2 is). A sum under the root (√(a-x)) is left alone.
function surd(r) {
if (r.t === 'par') r = r.a;
if (r.t === 'add') return true;
let ok = true;
(function w(x) {
if (x.t === 'num') { const n = x.v; if (!Number.isInteger(n)) ok = false; else for (let d = 2; d * d <= n; d++) if (n % (d * d) === 0) ok = false; }
else if (x.t === 'pow') ok = false;
else if (x.t === 'mul') x.f.forEach(w);
else if (x.t !== 'var') ok = false;
})(r);
return ok;
}
// a single term written simply: number(s) and letters, each letter once (a²b, not aab), one number at most, divided
// only by a number (x/3). Returns its letter signature ("a2b1") or null.
function termSig(n) {
let nums = 0; const pw = {};
function f(x) {
if (x.t === 'num') { nums++; return true; }
if (x.t === 'par' && x.a.t === 'div' && x.a.a.t === 'num' && x.a.b.t === 'num') { nums++; return true; } // (2/5)√3
if (x.t === 'var') { if (pw[x.n]) return false; pw[x.n] = 1; return true; }
if (x.t === 'pow' && x.b.t === 'var') { if (pw[x.b.n] || x.e < 1) return false; pw[x.b.n] = x.e; return true; }
if (x.t === 'sqrt') { if (!surd(x.a)) return false; const k = ser(x); if (pw[k]) return false; pw[k] = 1; return true; }
if (x.t === 'mul' && !x.x) return x.f.every((y, i) => (y.t !== 'num' || i === 0) && f(y)); // the number comes first: 3a, not a3
if (x.t === 'div' && x.b.t === 'num') return f(x.a.t === 'par' && x.a.a.t !== 'add' ? x.a.a : x.a); // (3y^2z)/2 = 3y^2z/2
return false;
}
if (!f(n) || nums > 1) return null;
return Object.keys(pw).sort().map(k => k + pw[k]).join('') || '1';
}
// a sum of unlike terms (no brackets): the simplified form of a polynomial
function flat(n) {
const ts = n.t === 'add' ? n.terms.map(x => x.a) : [n], seen = new Set();
for (const t of ts) { const s = termSig(t); if (s === null || seen.has(s)) return false; seen.add(s); }
return true;
}
// a bracket with nothing left to take out: its whole numbers have no common divisor and no letter is in every term
// (so 2(2x^2+3xy) is not the factors of 4x^2+6xy; 2x(2x+3y) is)
function primitive(n) {
const ts = n.t === 'add' ? n.terms.map(x => x.a) : [n]; if (ts.length < 2) return true;
const gcd = (a, b) => b ? gcd(b, a % b) : a; let g = 0, common = null;
for (const t of ts) {
let c = 1; const ls = new Set();
(function w(x) { if (x.t === 'num') c *= x.v; else if (x.t === 'var') ls.add(x.n); else if (x.t === 'pow' && x.b.t === 'var') ls.add(x.b.n); else if (x.t === 'mul') x.f.forEach(w); else if (x.t === 'div') { w(x.a); c = NaN; } else c = NaN; })(t);
if (Number.isInteger(c)) g = gcd(g, Math.abs(c)); else g = 1;
common = common ? new Set([...common].filter(v => ls.has(v))) : ls;
}
return g <= 1 && common.size === 0;
}
const deg = n => { let d = 0; if (n.t === 'add') return Math.max(...n.terms.map(x => deg(x.a))); if (n.t === 'var') return 1; if (n.t === 'pow') return deg(n.b) * Math.max(0, n.e); if (n.t === 'par') return deg(n.a); if (n.t === 'mul') { n.f.forEach(x => d += deg(x)); return d; } if (n.t === 'div') return deg(n.a); return 0; };
const unneg = n => (n.t === 'add' && n.terms.length === 1) ? n.terms[0].a : n; // -(a+b)(a-b) -> the product
// factors: (a+3)(a+4), 2(x-1)², a(b+c). Counts the bracketed factors (a square counts twice), each must be simplified.
function factors(n) {
n = unneg(n); const fs = []; (function fl(x) { if (x.t === 'mul') x.f.forEach(fl); else fs.push(x); })(n); let k = 0;
for (const f of fs) {
const g = f.t === 'pow' && f.b.t === 'par' ? f.b : f;
if (g.t === 'par') { if (!flat(g.a) || !primitive(g.a)) return -1; k += f.t === 'pow' ? f.e : 1; }
else if (termSig(g) === null) return -1;
}
return k;
}
// the book's answer decides what "written simply" means
function kind(a) {
const u = unneg(a);
if (flat(a)) return { k: 'p' };
if (u.t === 'div' && letters(u.b).size) return { k: 'r', d: deg(u.a) + deg(u.b) };
const f = factors(a); if (f > 0) return { k: 'f', n: f };
return { k: 'a' };
}
function ok(typed, answer) {
const a = parse(answer), t = parse(typed); if (!a || !t) return false;
if (!same(t, a)) return false;
const K = kind(a);
if (K.k === 'p') return flat(t);
if (K.k === 'f') return factors(t) >= K.n;
if (K.k === 'r') { const u = unneg(t); if (flat(t)) return true; if (u.t !== 'div') return false; const side = x => { const y = x.t === 'par' ? x.a : x; return flat(y) || factors(y) >= 0; }; return side(u.a) && side(u.b) && deg(u.a) + deg(u.b) <= K.d; }
return tokens(typed).length <= tokens(answer).length + 2;
}
return { parse, pretty, ok, same, kind, flat, factors };
})();
EOF
app.js: the game, for the whole shelf (new: the algebra pad).
cat > /root/rays-rebuild/app.js <<'EOF'
// Ray's Arithmetic: gamified Ray's New Primary Arithmetic (1877). Progress is saved per kid in localStorage ('rays').
// Same look and voice as ABC Books; the kid picked in ABC Books (same site) is picked here too.
const Rays = (() => {
const $ = id => document.getElementById(id);
// Readers come from ABC Books on this site ('abcbooks'.readers: names a grown-up added there). Same rule as ABC
// Books: no 'abcbooks' (or no kid and no progress) = no readers yet; an old device without .readers = the three
// original kids plus any names in its progress.
const NAME_OK = n => typeof n === 'string' && /^\p{L}[\p{L}' .-]{0,15}$/u.test(n.trim());
function readers() {
let c = null; try { c = JSON.parse(localStorage.getItem('abcbooks')); } catch (e) {}
let r = [];
if (c && Array.isArray(c.readers)) r = c.readers.filter(NAME_OK);
else if (c && (c.kid || (c.progress && Object.keys(c.progress).length))) r = ['Layla', 'Lavon', 'Lilly'].concat(Object.keys(c.progress || {}).filter(n => NAME_OK(n) && !['Layla', 'Lavon', 'Lilly'].includes(n)));
if (S && S.kid && r.length && !r.includes(S.kid)) r = r.concat(S.kid);
return r;
}
// Ray's series in order (raysarithmetic.wordpress.com/rays-free-arithmetic). A book is playable once books/<id>.json exists.
const SHELF = [
{ id: 'primary1877', title: "Ray's New Primary Arithmetic", sub: 'Book 1 · Grades 1-2', color: '#2f6f8f' },
{ id: 'intellectual', title: "Ray's New Intellectual Arithmetic", sub: 'Book 2 · Grades 3-4', color: '#6a4c93' },
{ id: 'practical', title: "Ray's New Practical Arithmetic", sub: 'Book 3 · Grades 5-6', color: '#2e7d4f' },
{ id: 'higher', title: "Ray's New Higher Arithmetic", sub: 'Book 4 · Grades 7-8', color: '#a0522d' },
{ id: 'geometry', title: "Ray's Geometry and Trigonometry", sub: 'Book 5 · Grades 9-10', color: '#7a6a1f' },
{ id: 'algebra1', title: "Ray's New Elementary Algebra", sub: 'Book 6 · Grades 9-10', color: '#8f2f4f' },
{ id: 'algebra2', title: "Ray's New Higher Algebra", sub: 'Book 7 · Grade 11', color: '#3b4a8f', soon: true }
];
const BOOKS = {};
let P = {};
const STICKERS = ['🦊', '🐢', '🦉', '🐝', '🦋', '🐞', '🐸', '🐧', '🦄', '🐬', '🦁', '🐼', '🐨', '🐙', '🦀', '🐳', '🦒', '🦓', '🐘', '🦔', '🐿️', '🦜', '🐠', '🐤', '🐰', '🐻', '🐯', '🐮', '🐷', '🐵', '🌻', '🌈', '⭐', '🚂', '🚀', '⛵', '🎈', '🍎', '🍓', '🍩'];
const STEPS = {
count: { name: 'Count', icon: '●' }, numbers: { name: 'Numbers', icon: '#' }, find: { name: 'Find the number', icon: '👂' },
say: { name: 'Read the numbers', icon: '💬' }, write: { name: 'Write the numbers', icon: '✎' }, trace: { name: 'Trace the numbers', icon: '1' },
learn: { name: 'Learn the table', icon: '📖' }, rules: { name: 'Learn the table', icon: '📖' }, drill: { name: 'Practice', icon: '⚡' },
problems: { name: 'Story problems', icon: '?' }, study: { name: 'Study', icon: '📐' }, quiz: { name: 'Quiz', icon: '✔' }
};
// ---------- storage ----------
let S = load();
function load() {
let s = null; try { s = JSON.parse(localStorage.getItem('rays')); } catch (e) {}
s = s || {};
s.progress = s.progress || {}; s.pos = s.pos || {}; s.best = s.best || {}; s.stickers = s.stickers || {};
if (!s.speed) s.speed = 60;
if (!s.kid) { // the kid picked in ABC Books or BlockCraft on this site
for (const k of ['abcbooks', 'blockcraft_cfg']) { try { const c = JSON.parse(localStorage.getItem(k)); const n = c && (k === 'abcbooks' ? c.kid : c.name); if (NAME_OK(n)) { s.kid = n.trim(); break; } } catch (e) {} }
}
return s;
}
function save() { try { localStorage.setItem('rays', JSON.stringify(S)); } catch (e) {} }
const kidMap = obj => (obj[S.kid] = obj[S.kid] || {});
const prog = b => (kidMap(S.progress)[b] = kidMap(S.progress)[b] || {});
// ---------- sound + voice (recorded Eloquence clips, else the device voice) ----------
let AC;
function beep(good) {
try {
AC = AC || new (window.AudioContext || window.webkitAudioContext)();
const o = AC.createOscillator(), g = AC.createGain(), t = AC.currentTime;
o.type = 'triangle'; o.connect(g); g.connect(AC.destination);
const notes = good ? [523, 659, 784] : [220, 180];
notes.forEach((f, i) => o.frequency.setValueAtTime(f, t + i * 0.1));
g.gain.setValueAtTime(0.25, t); g.gain.exponentialRampToValueAtTime(0.001, t + notes.length * 0.1 + 0.2);
o.start(t); o.stop(t + notes.length * 0.1 + 0.25);
} catch (e) {}
}
const hasTTS = 'speechSynthesis' in window;
let voice = null;
function pickVoice() { if (!hasTTS) return; const v = speechSynthesis.getVoices().filter(v => /^en/i.test(v.lang)); voice = v.find(v => /female|samantha|zira|aria|jenny|google us/i.test(v.name)) || v[0] || null; }
if (hasTTS) { pickVoice(); speechSynthesis.onvoiceschanged = pickVoice; }
let AUDIO = null; // audio/primary1877.json: spoken text -> clip id (tools/make-audio.ps1)
const clip = new Audio(); clip.preload = 'auto';
let clipDone = null, tok = 0, unlocked = false;
const blobs = new Map();
function clipURL(url) { // fetched whole and played from memory: works offline and on Safari
if (!blobs.has(url)) blobs.set(url, fetch(url).then(r => { if (!r.ok) throw new Error(r.status); return r.blob(); }).then(b => URL.createObjectURL(b)));
const p = blobs.get(url); p.catch(() => blobs.delete(url)); return p;
}
const speedOf = () => AUDIO.speeds.includes(S.speed) ? S.speed : AUDIO.speeds[0];
const urlFor = key => { const c = AUDIO && AUDIO.items[key]; return c ? `audio/s${speedOf()}/${c}.mp3` : null; };
function stopAll() { tok++; clip.pause(); if (clipDone) { const d = clipDone; clipDone = null; d(); } if (hasTTS) speechSynthesis.cancel(); }
function playURL(u, my) {
return new Promise(res => {
clipURL(u).then(b => {
if (my !== tok) return res();
clipDone = res; clip.muted = false; clip.src = b;
clip.onended = clip.onerror = () => { if (clipDone) { const d = clipDone; clipDone = null; d(); } };
clip.play().catch(() => clip.onended());
}).catch(() => res());
});
}
// speak(...keys): one clip per key, played one after the other; a key with no clip uses the device voice
async function speak(...keys) {
stopAll(); const my = tok;
for (const k of keys) {
if (my !== tok || k == null || k === '') continue;
const u = urlFor(String(k));
if (u) await playURL(u, my); else await tts(String(k).replace(/^(n|find|ans|lesson):/, ''));
}
}
function tts(text) {
return new Promise(res => {
if (!hasTTS) return setTimeout(res, 300);
const u = new SpeechSynthesisUtterance(text); if (voice) u.voice = voice; u.rate = 0.85;
u.onend = u.onerror = res; speechSynthesis.speak(u);
});
}
const sayNum = n => speak('n:' + n);
window.addEventListener('pointerdown', () => { // iOS: unlock audio inside the first tap
if (AC && AC.state === 'suspended') AC.resume();
const u = urlFor(P.yes); if (unlocked || !u) return; unlocked = true;
clipURL(u).then(b => { if (!clip.src) { clip.muted = true; clip.src = b; clip.play().then(() => { clip.pause(); clip.muted = false; }).catch(() => { clip.muted = false; }); } }).catch(() => {});
}, { passive: true });
// ---------- helpers ----------
function toast(t, ms) { const e = $('toast'); e.textContent = t; e.style.display = 'block'; clearTimeout(toast.t); toast.t = setTimeout(() => e.style.display = 'none', ms || 1100); }
function el(tag, cls, html) { const e = document.createElement(tag); if (cls) e.className = cls; if (html != null) e.innerHTML = html; return e; }
function btn(label, fn, cls) { const b = el('button', cls, label); b.onclick = fn; return b; }
const shuffle = a => { a = a.slice(); for (let i = a.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [a[i], a[j]] = [a[j], a[i]]; } return a; };
const range = (a, b) => Array.from({ length: b - a + 1 }, (_, i) => a + i);
const starStr = n => '★'.repeat(n) + '☆'.repeat(3 - n);
const starsFor = (miss, n) => miss === 0 ? 3 : miss <= Math.max(2, Math.round(n * 0.15)) ? 2 : 1;
const wait = ms => new Promise(r => setTimeout(r, ms));
function go(id) { document.querySelectorAll('.screen').forEach(s => s.classList.toggle('on', s.id === id)); if (id === 'home') home(); if (id === 'stickers') stickers(); }
const ONES = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'];
const TENS = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'];
const words = n => n < 20 ? ONES[n] : n === 100 ? 'one hundred' : TENS[Math.floor(n / 10)] + (n % 10 ? '-' + ONES[n % 10] : '');
// pictures: dots for a fact (a and b in two colors, crossed out when taken away, rows for times, groups for division)
function dotsFor(op, a, b) {
const box = el('div', 'dots');
const grp = (n, cls, boxed) => { const g = el('div', 'grp' + (boxed ? ' box' : '')); for (let i = 0; i < n; i++) g.appendChild(el('i', 'dot ' + (cls || ''))); return g; };
if (op === 'add') { box.append(grp(a), el('span', 'op', '+'), grp(b, 'b')); }
else if (op === 'sub') { const g = el('div', 'grp'); for (let i = 0; i < b; i++) g.appendChild(el('i', 'dot ' + (i >= b - a ? 'x' : ''))); box.appendChild(g); }
else if (op === 'mul') { if (a * b > 100) return box; for (let i = 0; i < a; i++) box.appendChild(grp(b, i % 2 ? 'b' : '', true)); }
else if (op === 'div') { if (b > 100) return box; for (let i = 0; i < b / a; i++) box.appendChild(grp(a, i % 2 ? 'b' : '', true)); }
return box;
}
const SIGN = { add: '+', sub: '−', mul: '×', div: '÷' };
const expr = (op, f) => op === 'sub' ? `${f.b} − ${f.a}` : op === 'div' ? `${f.b} ÷ ${f.a}` : `${f.a} ${SIGN[op]} ${f.b}`;
// a picture for a story problem, from the first thing it counts
const PICS = [['cent|dime|money', '💰'], ['dollar', '💵'], ['apple', '🍎'], ['pear', '🍐'], ['peach', '🍑'], ['orange', '🍊'], ['lemon', '🍋'], ['cherr', '🍒'], ['plum|raisin|fig', '🍇'], ['melon', '🍈'], ['pine-apple', '🍍'], ['strawberr|berr', '🍓'], ['nut|chestnut|pecan|walnut', '🌰'],
['marble', '🔵'], ['top', '🎯'], ['kite', '🎏'], ['ball', '⚽'], ['doll', '🧸'], ['bird|swallow|crow|pigeon', '🐦'], ['owl', '🦉'], ['bat', '🦇'], ['duck', '🦆'], ['geese|goose', '🦢'], ['chicken|hen', '🐔'], ['fish', '🐟'], ['horse', '🐴'], ['cow|calf|calves', '🐄'], ['sheep', '🐑'], ['pig|hog', '🐖'], ['rabbit', '🐇'], ['cat|kitten', '🐈'], ['mice|mouse', '🐭'],
['egg', '🥚'], ['cake|candy', '🍬'], ['milk', '🥛'], ['book|primer|reader|geograph', '📚'], ['pen|pencil|slate', '✏️'], ['ribbon|tape|cloth|calico|muslin|silk', '🎀'], ['tree|orchard', '🌳'], ['flower|rose', '🌹'], ['leaves|leaf', '🍃'], ['ship|boat', '⛵'], ['car', '🚃'], ['mile|travel', '🛤️'], ['hour|minute', '⏰'], ['day|week|month|year', '📅'], ['wood|cord', '🌲'], ['flour|wheat|corn|oats|seed', '🌾'],
['boy|girl|pupil|scholar|men|man|persons', '🧒'], ['window|pane', '🏠'], ['chair|bench', '💺'], ['foot|feet|inch|yard|rod', '📏'], ['pound|ounce|ton', '⚖️'], ['quart|pint|gallon|gill|peck|bushel', '🍶']];
function picFor(text) { const t = text.toLowerCase(); let best = null, at = 1e9; for (const [rx, e] of PICS) { const m = t.match(new RegExp('\\b(' + rx + ')')); if (m && m.index < at) { at = m.index; best = e; } } return best || '🧮'; }
// ---------- spoken answers ----------
// The kid can say the answer. First choice: our own Vosk server (CT 307, /api/recognize, shared with ABC Books),
// told to listen only for number words. Fallback: the browser's own recognizer. No mic at all: the button hides.
const NUM_WORDS = 'zero oh one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty thirty forty fifty sixty seventy eighty ninety hundred thousand and a';
const SR = window.SpeechRecognition || window.webkitSpeechRecognition;
const GUM = !!(window.isSecureContext && navigator.mediaDevices && navigator.mediaDevices.getUserMedia);
let micOK = GUM || !!SR, useServer = GUM;
const W1 = { zero: 0, oh: 0, one: 1, two: 2, three: 3, four: 4, for: 4, five: 5, six: 6, seven: 7, eight: 8, ate: 8, nine: 9, ten: 10, eleven: 11, twelve: 12, thirteen: 13, fourteen: 14, fifteen: 15, sixteen: 16, seventeen: 17, eighteen: 18, nineteen: 19 };
const W10 = { twenty: 20, thirty: 30, forty: 40, fifty: 50, sixty: 60, seventy: 70, eighty: 80, ninety: 90 };
// "nine thousand six hundred" -> 9600; "four two" (digits one at a time) -> 42; "7" -> 7
function wordsToNumber(words) {
// "a hundred" = one hundred; a stray "a" (Vosk often hears it for "one"/"and" in fast speech) alone is one
const w = words.join(' ').toLowerCase().replace(/-/g, ' ').split(/\s+/).filter(x => x && x !== 'and').map((x, i, all) => x === 'a' ? (all.length === 1 || /^(hundred|thousand)$/.test(all[i + 1] || '') ? 'one' : '') : x).filter(Boolean);
if (!w.length) return null;
if (w.every(x => /^\d+$/.test(x))) return parseInt(w.join(''), 10);
if (w.length > 1 && w.every(x => x in W1 && W1[x] < 10)) return parseInt(w.map(x => W1[x]).join(''), 10);
let total = 0, cur = 0, any = false;
for (const x of w) {
if (/^\d+$/.test(x)) { cur += parseInt(x, 10); any = true; }
else if (x in W1 || x in W10) { // "nineteen twenty" (said like a year) -> 1920; "twenty four" -> 24
const v = x in W1 ? W1[x] : W10[x];
cur = v >= 10 && cur % 100 ? cur * 100 + v : cur + v; any = true;
}
else if (x === 'hundred') { cur = (cur || 1) * 100; any = true; }
else if (x === 'thousand') { total += (cur || 1) * 1000; cur = 0; any = true; }
else return null; // a word that isn't a number: didn't understand
}
return any ? total + cur : null;
}
let stopListening = () => {};
async function hearNumber() {
if (useServer) {
try { const w = await listenServer(7000); return w ? wordsToNumber(w) : null; }
catch (e) { useServer = false; if (!SR) { micOK = false; return null; } }
}
const alts = await listenBrowser(7000);
for (const a of alts) { const n = wordsToNumber(a); if (n != null) return n; }
return null;
}
// records until the kid stops talking (1.2 s quiet) or the time runs out (same as ABC Books)
async function listenServer(timeoutMs) {
let stream;
try { stream = await navigator.mediaDevices.getUserMedia({ audio: { echoCancellation: true, noiseSuppression: true } }); }
catch (e) { micOK = false; return null; }
const ctx = new (window.AudioContext || window.webkitAudioContext)();
try { await ctx.resume(); } catch (e) {}
const src = ctx.createMediaStreamSource(stream), proc = ctx.createScriptProcessor(4096, 1, 1);
const chunks = []; let spoke = false, quiet = 0; const t0 = performance.now();
await new Promise(res => {
let done = false; const fin = () => { if (!done) { done = true; res(); } };
stopListening = fin;
proc.onaudioprocess = e => {
const d = e.inputBuffer.getChannelData(0); chunks.push(new Float32Array(d));
let s = 0; for (let i = 0; i < d.length; i++) s += d[i] * d[i];
if (Math.sqrt(s / d.length) > 0.015) { spoke = true; quiet = 0; } else if (spoke) quiet += d.length / ctx.sampleRate * 1000;
if ((spoke && quiet > 1200) || performance.now() - t0 > timeoutMs) fin();
};
src.connect(proc); proc.connect(ctx.destination);
});
stopListening = () => {};
proc.disconnect(); src.disconnect(); stream.getTracks().forEach(t => t.stop());
const rate = ctx.sampleRate; ctx.close();
if (!spoke) return null;
const r = await fetch('/api/recognize?near=0&words=' + encodeURIComponent(NUM_WORDS), { method: 'POST', headers: { 'Content-Type': 'application/octet-stream' }, body: to16k(chunks, rate) });
if (!r.ok) throw new Error('speech ' + r.status);
const j = await r.json();
return j.words || [];
}
function to16k(chunks, rate) { // Float32 at the device rate -> 16 kHz 16-bit PCM (what Vosk wants)
const n = chunks.reduce((a, c) => a + c.length, 0), all = new Float32Array(n); let o = 0;
for (const c of chunks) { all.set(c, o); o += c.length; }
const ratio = rate / 16000, m = Math.floor(n / ratio), out = new Int16Array(m);
for (let i = 0; i < m; i++) {
const a = Math.floor(i * ratio), b = Math.min(n, Math.max(a + 1, Math.floor((i + 1) * ratio))); let s = 0;
for (let k = a; k < b; k++) s += all[k];
out[i] = Math.max(-1, Math.min(1, s / (b - a))) * 32767;
}
return out.buffer;
}
function listenBrowser(timeoutMs) {
return new Promise(res => {
if (!SR) return res([]);
const r = new SR(); r.lang = 'en-US'; r.interimResults = false; r.maxAlternatives = 5;
let best = [], done = false;
const fin = () => { if (done) return; done = true; try { r.stop(); } catch (e) {} res(best); };
stopListening = fin;
r.onresult = e => { best = [...e.results[0]].map(a => a.transcript.split(/\s+/)); fin(); };
r.onerror = e => { if (/not-allowed|service-not-allowed/.test(e.error || '')) micOK = false; fin(); };
r.onend = fin;
try { r.start(); } catch (e) { micOK = false; return fin(); }
setTimeout(fin, timeoutMs);
});
}
// number pad (big buttons; a computer keyboard works too; 🎤 to say the answer)
function numPad(onOK) {
const wrap = el('div', 'col'); wrap.style.height = 'auto'; wrap.style.gap = '1vmin';
const entry = el('div', 'entry', ' '); let val = '';
// long whole numbers are shown with commas, the book's way (4,576,791)
const show = () => { entry.textContent = (algMode ? RaysAlg.pretty(val) : /^\d{5,}$/.test(val) ? val.replace(/\B(?=(\d{3})+$)/g, ',') : val) || ' '; entry.classList.toggle('long', val.length > 9); entry.classList.remove('no', 'ok'); };
const pad = el('div', 'pad');
let fracMode = false; // answers like 3/4 or 2 1/2: extra keys, and OK hands back the text
let algMode = false; // Algebra: + − ( ) / power and the question's letters; OK hands back the text (alg.js checks it)
const press = k => {
if (k === '⌫') val = val.slice(0, -1);
else if (k === 'OK') { if (val.trim()) onOK(fracMode || algMode ? val.trim() : parseInt(val, 10)); return; }
else if (algMode) { if (val.length < 200 && !(k === '^' && !/[\da-z)]$/.test(val))) val += k === '−' ? '-' : k; }
// "and" after a decimal makes a complex decimal (.0154 1/4); the fraction after it may then have a /
else if (k === 'and') { if (fracMode && val && !/[ /]/.test(val) && !val.endsWith('.')) val += ' '; }
else if (k === '/') { if (fracMode && val && !val.endsWith(' ') && !val.includes('/') && (!val.includes('.') || /\.\d+ \d+$/.test(val))) val += '/'; }
else if (k === '.') { if (fracMode && !/[ /.]/.test(val)) val += '.'; }
else if (val.length < 40) val += k; // the book's long numbers (up to 36 figures) are checked as written
show();
};
['1', '2', '3', '4', '5', '6', '7', '8', '9', '⌫', '0', 'OK'].forEach(k => pad.appendChild(btn(k, () => press(k), k === 'OK' ? 'okb' : '')));
const fracRow = el('div', 'pad'); fracRow.style.display = 'none';
fracRow.append(btn('/', () => press('/')), btn('and', () => press('and')), btn('.', () => press('.')));
const algRow = el('div', 'pad alg'), letRow = el('div', 'pad alg'); algRow.style.display = letRow.style.display = 'none';
['+', '−', '(', ')', '/', '^'].forEach(k => algRow.appendChild(btn(k === '^' ? 'xⁿ' : k, () => press(k))));
const onKey = e => { if (algMode && /^[a-z+\-()/^*]$/.test(e.key)) press(e.key); else if (/^[0-9]$/.test(e.key)) press(e.key); else if (e.key === '/' || e.key === '.') press(e.key); else if (e.key === ' ' && fracMode) { e.preventDefault(); press('and'); } else if (e.key === 'Backspace') press('⌫'); else if (e.key === 'Enter') press('OK'); };
window.addEventListener('keydown', onKey);
const mic = btn('🎤 Say it', async () => {
if (mic.classList.contains('live')) return stopListening();
stopAll(); mic.classList.add('live'); mic.textContent = '🎤 Listening…';
const n = await hearNumber();
mic.classList.remove('live'); mic.textContent = '🎤 Say it';
if (!micOK) { mic.style.display = 'none'; return toast('This device cannot listen. Type the answer.', 2000); }
if (n == null) return toast('I did not catch that. Say it again!', 1500);
val = String(n); show(); onOK(n);
}, 'micb');
if (!micOK) mic.style.display = 'none';
wrap.append(entry, pad, fracRow, algRow, letRow, mic);
return { el: wrap, entry, frac(on) { fracMode = !!on; fracRow.style.display = on ? '' : 'none'; mic.style.display = on || !micOK ? 'none' : ''; },
alg(keys) { // keys = the question's letters ("abx"); null turns the algebra keys off
algMode = keys != null; wrap.classList.toggle('algmode', algMode); algRow.style.display = letRow.style.display = algMode ? '' : 'none'; letRow.innerHTML = '';
[...(keys || '')].forEach(c => letRow.appendChild(btn(c, () => press(c), 'let')));
letRow.style.display = algMode && keys ? '' : 'none';
if (algMode) { fracMode = false; fracRow.style.display = 'none'; mic.style.display = 'none'; }
}, show(on) { wrap.style.display = on ? '' : 'none'; }, clear() { val = ''; show(); }, set(v, cls) { val = String(v); show(); if (cls) entry.classList.add(cls); }, bad() { entry.classList.remove('no'); void entry.offsetWidth; entry.classList.add('no'); }, stop() { stopListening(); window.removeEventListener('keydown', onKey); } };
}
// fractions compare by value: 5/2 = 2 1/2 = 2.5
function fracVal(s) {
s = String(s).trim(); let m;
if ((m = s.match(/^(\d+) (\d+)\/(\d+)$/))) return +m[1] + m[2] / m[3];
if ((m = s.match(/^(\d+)\/(\d+)$/))) return m[1] / m[2];
if ((m = s.match(/^(\d*)\.(\d+) (\d+)\/(\d+)$/))) return parseFloat((m[1] || '0') + '.' + m[2]) + m[3] / m[4] / Math.pow(10, m[2].length); // complex decimal
return /^\d*\.?\d+$/.test(s) ? parseFloat(s) : NaN;
}
// relative check, so tiny decimals (.00000002) and large ones (2900.000029) both compare exactly
const sameVal = (a, b) => { const x = fracVal(a), y = fracVal(b); return Math.abs(x - y) <= 1e-13 + 1e-10 * Math.abs(y); };
// counters tray: tap beads to count with
function initTray() {
const f = $('frame'); f.innerHTML = '';
for (let i = 0; i < 30; i++) f.appendChild(btn('', e => { e.currentTarget.classList.toggle('on'); count(); }));
const count = () => { $('trayN').textContent = f.querySelectorAll('.on').length; };
$('trayClear').onclick = () => { f.querySelectorAll('.on').forEach(b => b.classList.remove('on')); count(); };
$('trayClose').onclick = () => $('tray').classList.remove('on');
}
// "Show your work": a pencil button that opens scratch paper beside the question (scratch.js). The paper comes
// back open on the next question and the next lesson if the kid left it open.
function workPad() {
const w = RaysWork.Pad($('stage'), S.kid, bookId, toast);
const b = btn('', () => { label(w.toggle()); });
const label = on => { b.textContent = on ? '✏️ Put paper away' : '✏️ Show work'; b.classList.toggle('on', on); };
label(w.start());
return { btn: b, page: w.page, result: w.result, stop: w.stop };
}
// grown-ups: every page of work one kid has in one book, newest first, grouped by lesson
// With a family account, the pages saved there from other devices are added (fetched after the first draw).
let workBack = 'map';
const gone = new Set(); // deleted in this visit: the account may not have heard yet
function showWork(from, fromAcct) {
workBack = from; const id = bookId || 'primary1877', B = BOOKS[id], kid = S.kid;
const pages = RaysWork.list(kid, id), box = $('workList'); box.innerHTML = '';
if (fromAcct) {
const at = new Map(pages.map((pg, i) => [pg.key, i]));
fromAcct.filter(pg => !gone.has(id + '|' + pg.key) && !gone.has(id + '|*')).forEach(pg => {
if (!at.has(pg.key)) pages.push(pg); else if ((pg.t || 0) > (pages[at.get(pg.key)].t || 0)) pages[at.get(pg.key)] = pg;
});
} else RaysWork.remote(kid, id).then(r => { if (r.length && $('work').classList.contains('on') && S.kid === kid && (bookId || 'primary1877') === id) showWork(from, r); });
// lessons with the newest work first; inside a lesson, the pages in question order
const newest = {}; pages.forEach(pg => { newest[pg.l] = Math.max(newest[pg.l] || 0, pg.t || 0); });
pages.sort((a, b) => newest[b.l] - newest[a.l] || a.key.localeCompare(b.key, undefined, { numeric: true }));
$('workTitle').textContent = `${S.kid}: work in ${B ? B.title : ''} (${pages.length} page${pages.length === 1 ? '' : 's'})`;
$('workDel').style.display = pages.length ? '' : 'none';
$('workDel').onclick = () => { if (confirm(`Delete all of ${S.kid}'s work in this book?`)) { RaysWork.remove(S.kid, id); gone.add(id + '|*'); showWork(from); } };
if (!pages.length) box.appendChild(el('p', 'note', 'No work saved yet. In Story problems and Practice, the ✏️ Show work button opens scratch paper; each page is kept here with its question.'));
const tw = Math.min(300, Math.floor((window.innerWidth - 60) / 2));
let shown = 0, lastL = null;
function more() {
pages.slice(shown, shown + 40).forEach(pg => {
if (pg.l !== lastL) { lastL = pg.l; const Ls = B && B.lessons.find(x => x.n === pg.l); box.appendChild(el('h3', 'wles', '')).textContent = `Lesson ${pg.l}${Ls ? ': ' + Ls.title : ''}`; }
const card = el('button', 'wpage'); card.appendChild(RaysWork.picture(pg, tw));
const cap = el('div', 'wcap'); cap.textContent = pg.q;
const res = el('div', 'wres' + (pg.r === 'miss' ? ' miss' : pg.r === 'ok' ? ' ok' : ''));
res.textContent = (pg.a != null ? `Answer: ${pg.a} ` + (pg.r === 'ok' ? '✓' : pg.r === 'miss' ? '(missed a try)' : '') : 'Not answered') + ' · ' + new Date(pg.t).toLocaleString([], { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' });
card.append(cap, res); card.onclick = () => bigPage(pg, id, from); box.appendChild(card);
});
shown += 40; const m = box.querySelector('.wmore'); if (m) m.remove();
if (shown < pages.length) box.appendChild(btn('Show more', more, 'wmore'));
}
more(); go('work');
}
function bigPage(pg, id, from) {
const v = $('workBig'); v.innerHTML = ''; v.classList.add('on');
const q = el('div', 'wcap'); q.textContent = `Lesson ${pg.l}: ${pg.q}`;
const w = Math.min(window.innerWidth - 40, 1000), h = window.innerHeight - 190;
v.append(q, RaysWork.picture(pg, Math.round(Math.min(w, h / (pg.h || 0.75)))),
el('div', 'row'));
v.lastChild.append(btn('Close', () => v.classList.remove('on'), 'big'),
btn('Delete this page', () => { if (confirm('Delete this page?')) { RaysWork.remove(S.kid, id, pg.key); gone.add(id + '|' + pg.key); v.classList.remove('on'); showWork(from); } }, 'ghost parent'));
}
$('mapWork').onclick = () => showWork('map');
$('stkWork').onclick = () => { if (S.kid) showWork('stickers'); };
$('workBack').onclick =() => { $('workBig').classList.remove('on'); go(workBack); };
// ---------- home, map, stickers ----------
let addingReader = false;
function home() {
const k = $('kids'); k.innerHTML = '';
// names go in as text (never innerHTML); a name with no recorded greeting gets the line without a name
const rs = readers();
const signed = window.ABCAccount && window.ABCAccount.signedIn;
if (!rs.length && S.kid) { S.kid = null; save(); }
$('whoHint').textContent = rs.length ? '' : 'Grown-ups: add each learner (a first name or nickname).';
rs.forEach(n => { const b = btn('', () => { S.kid = n; save(); home(); const g = P.greet.replace('{kid}', n); speak(urlFor(g) ? g : P.hello); }, S.kid === n ? 'sel' : ''); b.textContent = n; k.appendChild(b); });
if (signed) { // a family account: names are added and removed on the account page
if (!rs.length) $('whoHint').innerHTML = 'Grown-ups: add your learners on the <a href="/account/">account page</a>.';
else { const a = el('a', 'parent'); a.href = '/account/'; a.textContent = 'Add or remove learners'; k.appendChild(a); }
} else if (addingReader || !rs.length) {
// the names live in 'abcbooks'.readers, shared with ABC Books, so a learner added here is in both
const inp = el('input'); inp.maxLength = 16; inp.placeholder = 'Name'; inp.autocomplete = 'off';
const add = () => {
const n = inp.value.trim().replace(/\s+/g, ' ');
if (!NAME_OK(n)) return toast('Letters only, please');
if (rs.some(x => x.toLowerCase() === n.toLowerCase())) return toast(`${n} is already here`);
let c = null; try { c = JSON.parse(localStorage.getItem('abcbooks')); } catch (e) {}
c = c || { kid: null, progress: {}, boards: {} };
c.readers = rs.concat(n); if (!c.kid) c.kid = n;
try { localStorage.setItem('abcbooks', JSON.stringify(c)); } catch (e) {}
S.kid = n; addingReader = false; save(); home();
};
inp.onkeydown = e => { if (e.key === 'Enter') add(); };
k.append(inp, btn('Add', add, 'big'));
if (rs.length) k.appendChild(btn('Cancel', () => { addingReader = false; home(); }, 'ghost parent'));
setTimeout(() => inp.focus(), 50);
} else if (rs.length < 8) k.appendChild(btn('+', () => { addingReader = true; home(); }, 'add'));
const sb = $('speedBtn'); sb.textContent = 'Voice: ' + (S.speed === 75 ? 'faster' : 'normal');
sb.onclick = () => { S.speed = S.speed === 75 ? 60 : 75; save(); home(); speak(P.yes); };
const sh = $('shelf'); sh.innerHTML = '';
// the kid's current book glows: the first open book they haven't finished
const doneIn = id => S.kid && BOOKS[id] ? Object.values(prog(id)).filter(x => x && x.stars).length : 0;
const cur = S.kid && SHELF.find(b => BOOKS[b.id] && doneIn(b.id) < BOOKS[b.id].lessons.length);
SHELF.forEach(b => {
const B = BOOKS[b.id], n = B ? B.lessons.length : 0, d = doneIn(b.id);
const pr = !B ? 'Coming soon' : S.kid ? (d >= n ? '★ Finished!' : d ? `Lesson ${d + 1} of ${n}` : `Lessons: ${n}`) : '';
const e = btn(`<b>${b.title}</b><span class="bp">${pr}</span><small>${b.sub}</small>`, () => {
if (!B) return toast('Coming soon!');
if (!S.kid) return toast('Pick your name first!');
openBook(b.id);
}, 'book' + (!B ? ' soon' : '') + (cur && cur.id === b.id ? ' cur' : ''));
e.style.background = b.color; sh.appendChild(e);
});
}
let book, bookId;
let skipArm = null; // a locked tile tapped once: a 2nd tap within 4 s skips ahead to it
function openBook(id) {
bookId = id; book = BOOKS[id]; $('mapTitle').textContent = `${S.kid}: ${book.title}`;
const t = $('tiles'); t.innerHTML = ''; const p = prog(id);
// Lessons are open up to one past the furthest one finished, so after a skip the kid carries on from there.
let far = -1; book.lessons.forEach((L, i) => { if ((p[L.n] || {}).stars) far = i; });
const paidAt = i => window.ABCAccount && window.ABCAccount.locked('math', i);
book.lessons.forEach((L, i) => {
const st = (p[L.n] || {}).stars || 0, open = i <= far + 1, isNext = i === far + 1;
// past the free lessons without a subscription (/account/sync.js; only when the paywall is switched on)
const paid = paidAt(i);
const tile = btn(`${L.n}<small>${L.part}</small><span class="st">${st ? starStr(st) : paid ? '🔒' : ''}</span>`, () => {
if (paid) return window.ABCAccount.unlockScreen('math');
if (!open && !st && !(skipArm && skipArm.i === i && Date.now() - skipArm.at < 4000)) {
skipArm = { i, at: Date.now() };
return toast(`Lesson ${L.n} is ahead. Tap it again to skip to it.`, 3500);
}
skipArm = null; startLesson(L);
}, 'tile' + (isNext ? ' next' : '') + (!open && !st ? ' locked' : '') + (L.review ? ' rev' : ''));
tile.title = `Lesson ${L.n}: ${L.title}` + (st ? ', done' : !open ? ', ahead' : '');
tile.setAttribute('aria-label', tile.title); t.appendChild(tile);
});
// "Go to lesson": every lesson by title, grouped by part, starting on the next one; Go starts it.
const sel = $('jumpSel'); sel.innerHTML = ''; let grp = null;
book.lessons.forEach((L, i) => {
if (!grp || grp.label !== L.part) { grp = document.createElement('optgroup'); grp.label = L.part || ''; sel.appendChild(grp); }
const o = el('option'); o.textContent = `Lesson ${L.n}: ${L.title}` + ((p[L.n] || {}).stars ? ' ★' : '');
o.value = i; if (i === Math.min(far + 1, book.lessons.length - 1)) o.selected = true; grp.appendChild(o);
});
$('jumpGo').onclick = () => { const i = +sel.value; paidAt(i) ? window.ABCAccount.unlockScreen('math') : startLesson(book.lessons[i]); };
go('map'); speak(P.map);
const nx = t.querySelector('.next'); if (nx) nx.scrollIntoView({ block: 'center' });
}
const stkKey = (b, n) => b === 'primary1877' ? n : `${b}:${n}`; // Book One keeps its first keys
function stickers() { // the sticker book for the book the kid is in (Book One when none is open yet)
const g = $('stkList'); g.innerHTML = ''; const got = kidMap(S.stickers), id = bookId || 'primary1877', B = BOOKS[id];
const n = B ? B.lessons.filter(L => got[stkKey(id, L.n)]).length : 0;
$('stkTitle').textContent = `${S.kid || ''} sticker book: ${B ? B.title : ''}, ${n} of ${B ? B.lessons.length : 0}`;
(B ? B.lessons : []).forEach(L => { const v = got[stkKey(id, L.n)]; const s = el('span', v ? 'got' : '', v || ''); s.title = 'Lesson ' + L.n; g.appendChild(s); });
}
$('toStickers').onclick = () => { if (!S.kid) return toast('Pick your name first!'); go('stickers'); };
// ---------- lesson flow ----------
let L, steps, stepIdx, scores, cleanup = null, sayAgain = null, stepTok = 0;
function stepsFor(L) {
switch (L.kind) {
case 'count': return ['count', 'find', 'trace'];
case 'numbers': return ['numbers', 'find', 'trace'];
case 'read': return ['say', 'find'];
case 'write': return ['write', 'trace'];
}
const s = [];
if (L.arts) s.push('study'); if (L.quiz) s.push('quiz');
if (L.table) s.push('learn', 'drill');
if (L.rules) s.push('rules'); if (L.rules && L.rules.some(r => r.quiz !== false) && !L.table) s.push('drill');
if (L.qs) s.push('problems');
return s;
}
function startLesson(lesson) {
L = lesson; steps = stepsFor(L); scores = {}; stepIdx = 0;
$('lesTitle').textContent = `Lesson ${L.n}: ${L.title}`;
go('lesson'); runStep(true);
}
function leave() { stopStep(); openBook(bookId); }
function stopStep() { stopAll(); $('tray').classList.remove('on'); if (cleanup) { cleanup(); cleanup = null; } }
function runStep(first) {
stopStep();
const id = steps[stepIdx];
const dots = $('steps'); dots.innerHTML = '';
steps.forEach((x, i) => dots.appendChild(el('i', i < stepIdx ? 'done' : i === stepIdx ? 'cur' : '', STEPS[x].icon)));
if (!id) return finish();
$('stepTitle').textContent = STEPS[id].name; $('stage').innerHTML = ''; $('controls').innerHTML = ''; $('hint').textContent = P[id] || '';
sayAgain = null; const my = ++stepTok;
const intro = (first ? speak('lesson:' + L.n, P[id]) : speak(P[id]));
$('sayBtn').onclick = () => sayAgain ? sayAgain() : speak(P[id]);
({ count: stepCount, numbers: stepNumbers, find: stepFind, say: stepSay, write: stepWrite, trace: stepTrace, learn: stepLearn, rules: stepRules, drill: stepDrill, problems: stepProblems, study: stepStudy, quiz: stepQuiz })[id](intro.then(() => my === stepTok));
}
function next(stars) { scores[steps[stepIdx]] = stars; stepIdx++; runStep(); }
const afterIntro = (intro, fn) => intro.then(ok => { if (ok) fn(); });
// Lesson 1: count the balls, one tap per ball
function stepCount(intro) {
let n = L.from;
const st = $('stage'); const col = el('div', 'col'); st.appendChild(col);
function show() {
col.innerHTML = ''; let c = 0;
const balls = el('div', 'balls'); const big = el('div', 'big-n', ' '); const w = el('div', 'word', ' ');
for (let i = 0; i < n; i++) balls.appendChild(btn('', e => {
const b = e.currentTarget; if (b.classList.contains('on')) return;
b.classList.add('on'); b.textContent = ++c; sayNum(c);
if (c === n) { big.textContent = n; w.textContent = words(n); setTimeout(() => { beep(true); speak('n:' + n).then(() => wait(700)).then(() => { if (++n > L.to) next(3); else show(); }); }, 650); }
}, 'ball'));
col.append(balls, big, w);
$('hint').textContent = `Tap each ball and count. (${n - L.from + 1} of ${L.to - L.from + 1})`;
}
sayAgain = () => speak(P.count);
show();
}
// Lessons 2-4: each number with its tens and ones
function stepNumbers(intro) {
let n = L.from; const st = $('stage'); const col = el('div', 'col'); st.appendChild(col);
let auto = false;
function show() {
col.innerHTML = '';
col.append(el('div', 'big-n', n), el('div', 'word', words(n)));
const rods = el('div', 'rods');
for (let t = 0; t < Math.floor(n / 10); t++) { const r = el('div', 'rod'); for (let i = 0; i < 10; i++) r.appendChild(el('i')); rods.appendChild(r); }
const ones = el('div', 'grp'); for (let i = 0; i < n % 10; i++) ones.appendChild(el('i', 'dot')); rods.appendChild(ones);
col.appendChild(rods);
col.appendChild(el('div', 'note', `${Math.floor(n / 10)} tens and ${n % 10} ones`));
$('hint').textContent = `${n - L.from + 1} of ${L.to - L.from + 1}`;
return sayNum(n);
}
async function playAll() { auto = true; playB.disabled = true; while (auto && n <= L.to) { await show(); await wait(700); if (!auto) break; if (n < L.to) n++; else break; } auto = false; playB.disabled = false; nextB.disabled = false; }
const prevB = btn('◀', () => { auto = false; if (n > L.from) { n--; show(); } });
const fwdB = btn('▶', () => { auto = false; if (n < L.to) { n++; show(); } else nextB.disabled = false; });
const playB = btn('▶ Play all', playAll, 'big'), nextB = btn('Next step ▶', () => next(3));
nextB.disabled = true; $('controls').append(prevB, playB, fwdB, nextB);
sayAgain = show; cleanup = () => { auto = false; };
col.append(el('div', 'big-n', n), el('div', 'word', words(n)));
afterIntro(intro, playAll);
}
// hear a number, tap it
function stepFind(intro) {
const pool = L.list || range(L.from, L.to);
const rounds = shuffle(pool).slice(0, 8); let r = 0, miss = 0, busy = false, target;
const st = $('stage'); const col = el('div', 'col'); st.appendChild(col);
const grid = el('div', 'choices'); col.appendChild(grid);
function round() {
if (r >= rounds.length) { toast('Great job! ⭐'); return setTimeout(() => next(starsFor(miss, rounds.length)), 900); }
target = rounds[r++]; grid.innerHTML = '';
const opts = shuffle([target, ...shuffle(pool.filter(x => x !== target)).slice(0, 3)]);
opts.forEach(v => grid.appendChild(btn(v, e => {
if (busy) return; const b = e.currentTarget;
if (v === target) { busy = true; beep(true); b.classList.add('ok'); setTimeout(() => { busy = false; round(); }, 800); }
else { miss++; beep(false); b.classList.remove('no'); void b.offsetWidth; b.classList.add('no'); }
})));
$('hint').textContent = `Find the number you hear (${r} of ${rounds.length})`;
sayAgain = () => speak('find:' + target); sayAgain();
}
afterIntro(intro, round);
}
// Lesson 5: numbers to be read, out loud to a grown-up
function stepSay(intro) {
const g = el('div', 'grid'); $('stage').appendChild(g);
L.list.forEach(v => g.appendChild(btn(v, e => { e.currentTarget.classList.add('seen'); sayNum(v); })));
$('controls').appendChild(btn('Done ✓', () => next(3), 'big'));
}
// Lesson 6: numbers to be written: hear it, type it
function stepWrite(intro) {
const items = shuffle(L.list).slice(0, 12); let i = 0, miss = 0, tries = 0;
const col = el('div', 'col'); $('stage').appendChild(col);
const pad = numPad(v => {
if (v === items[i]) { beep(true); pad.set(v, 'ok'); tries = 0; setTimeout(() => { i++; ask(); }, 700); }
else if (++tries < 2) { miss++; beep(false); pad.bad(); speak(P.tryAgain, 'n:' + items[i]); }
else { miss++; pad.set(items[i], 'ok'); speak('ans:' + items[i]); tries = 0; setTimeout(() => { i++; ask(); }, 1800); }
});
col.appendChild(pad.el);
function ask() {
if (i >= items.length) return next(starsFor(miss, items.length));
pad.clear(); $('hint').textContent = `Write the number you hear (${i + 1} of ${items.length})`;
sayAgain = () => sayNum(items[i]); sayAgain();
}
cleanup = () => pad.stop();
afterIntro(intro, ask);
}
// trace the figures (same engine as ABC Books)
function stepTrace(intro) {
const nums = L.kind === 'count' ? ['1 2 3', '4 5 6', '7 8 9', '10'] : L.kind === 'write' ? ['0 1 2 3 4', '5 6 7 8 9', '10 20 30'] : (() => { const r = range(L.from, L.to), out = []; for (let i = 0; i < r.length && out.length < 4; i += 4) out.push(r.slice(i, i + 4).join(' ')); return out; })();
let i = 0, misses = 0, tracer;
const box = el('div', 'grow paper'); box.style.height = '100%'; $('stage').appendChild(box);
const cv = el('canvas'); box.appendChild(cv);
ABCTrace.Tracer.onMiss = why => { misses++; beep(false); $('hint').textContent = why === 'start' ? 'Start at the green dot!' : 'Follow the arrow all the way.'; };
function page() {
if (tracer) tracer.stop();
$('hint').textContent = `Page ${i + 1} of ${nums.length}: start at the green dot and follow the arrow.`;
tracer = ABCTrace.Tracer(cv, nums[i], 'print', () => { beep(true); toast('⭐', 700); setTimeout(() => { if (++i < nums.length) page(); else next(misses < 3 ? 3 : misses < 8 ? 2 : 1); }, 800); });
}
$('controls').appendChild(btn('Skip page', () => { if (++i < nums.length) page(); else next(1); }, 'ghost parent'));
setTimeout(page, 50);
const onRes = () => page(); window.addEventListener('resize', onRes);
cleanup = () => { tracer && tracer.stop(); window.removeEventListener('resize', onRes); };
}
// the book's table, one line at a time with its picture
function stepLearn(intro) { learnList(L.table.map(f => ({ t: f.t, pic: () => dotsFor(L.op, f.a, f.b), ex: `${expr(L.op, f)} = ${f.r}` })), intro); }
function stepRules(intro) { learnList(L.rules.map(r => ({ t: r.t, pic: () => el('div', 'pic', picFor(r.t)) })), intro); }
function learnList(items, intro) {
const col = el('div', 'col'); $('stage').appendChild(col);
const face = el('div', 'col'); face.style.height = 'auto'; const chips = el('div', 'chips'); col.append(face, chips);
let i = 0, auto = false; const seen = new Set();
const chipEls = items.map((it, k) => { const c = btn(it.t, () => { auto = false; i = k; show(); }, 'chip'); chips.appendChild(c); return c; });
function show() {
face.innerHTML = ''; const it = items[i];
const f = el('div', 'fact', it.t); if (it.ex) f.appendChild(el('span', 'sm', it.ex));
face.append(f, it.pic());
chipEls.forEach((c, k) => c.classList.toggle('cur', k === i)); chipEls[i].classList.add('seen'); seen.add(i);
chipEls[i].scrollIntoView({ block: 'nearest' });
if (seen.size === items.length) nextB.disabled = false;
return speak(it.t);
}
async function playAll() { auto = true; playB.disabled = true; for (i = 0; i < items.length && auto; i++) { await show(); await wait(600); } i = Math.min(i, items.length - 1); auto = false; playB.disabled = false; nextB.disabled = false; }
const playB = btn('▶ Read to me', playAll, 'big'), nextB = btn('Next ▶', () => next(3));
nextB.disabled = true; $('controls').append(playB, nextB);
sayAgain = show; cleanup = () => { auto = false; };
face.appendChild(el('div', 'fact', items[0].t));
$('hint').textContent = 'Tap ▶ Read to me, or tap each line.';
afterIntro(intro, playAll);
}
// practice: every fact in the table (or every rule), timed; a missed one comes back later
function stepDrill(intro) {
const items = L.table ? L.table.map(f => ({ q: f.q, ex: expr(L.op, f) + ' = ?', a: f.r, say: f.t, pic: () => dotsFor(L.op, f.a, f.b) }))
: L.rules.filter(r => r.quiz !== false).map(r => ({ q: r.q, ex: `? ${r.a} = 1 ${r.b}`, a: r.n, say: r.t, pic: () => el('div', 'pic', picFor(r.t)) }));
let queue = shuffle(items), done = 0, miss = 0, tries = 0, streak = 0, t0 = 0, cur;
const key = `${bookId}:${L.n}`, best = kidMap(S.best);
const col = el('div', 'qa'); $('stage').appendChild(col);
const top = el('div', 'row'); const timer = el('div', 'timer'); const fire = el('div', 'timer'); top.append(timer, fire);
const ex = el('div', 'expr'); const qd = el('div', 'note'); const picBox = el('div', 'picbox'); picBox.style.minHeight = '0';
const pad = numPad(check);
col.append(top, ex, qd, picBox, pad.el);
const showB = btn('👀 Show me', () => { picBox.innerHTML = ''; picBox.appendChild(cur.pic()); }, 'ghost');
const work = workPad();
$('controls').append(showB, work.btn);
const tick = setInterval(() => { if (t0) timer.textContent = `⏱ ${Math.round((Date.now() - t0) / 1000)}s` + (best[key] ? ` (best ${best[key]}s)` : ''); }, 500);
function ask() {
if (!queue.length) {
const secs = Math.round((Date.now() - t0) / 1000);
let msg = `${secs} seconds!`;
if (!best[key] || secs < best[key]) { if (best[key]) msg += ' New best time! 🏆'; best[key] = secs; save(); }
toast(msg, 1800); return setTimeout(() => next(starsFor(miss, items.length)), 1800);
}
cur = queue[0]; tries = 0; pad.clear(); picBox.innerHTML = '';
ex.textContent = cur.ex; ex.className = 'expr' + (cur.ex.length > 12 ? ' long' : ''); qd.textContent = cur.q;
work.page(`${L.n}:d:${cur.ex}`, { q: `${cur.ex} ${cur.q}`, l: L.n });
$('hint').textContent = `${done + 1} of ${items.length}`;
sayAgain = () => speak(cur.q); sayAgain();
if (!t0) t0 = Date.now();
}
function check(v) {
work.result(v, v === cur.a);
if (v === cur.a) {
beep(true); pad.set(v, 'ok'); streak++; fire.textContent = streak >= 3 ? `🔥 ${streak}` : '';
queue.shift(); done++; setTimeout(ask, 600);
} else if (++tries < 2) { beep(false); pad.bad(); miss++; streak = 0; fire.textContent = ''; speak(P.tryAgain); }
else { // show it, say the book's line, and ask it again later
pad.set(cur.a, 'ok'); picBox.innerHTML = ''; picBox.appendChild(cur.pic());
const it = queue.shift(); queue.splice(Math.min(3, queue.length), 0, it);
speak(cur.say).then(() => wait(600)).then(ask);
}
}
cleanup = () => { clearInterval(tick); pad.stop(); work.stop(); };
afterIntro(intro, ask);
}
// story problems: the book's questions, one answer at a time; two misses shows the answer and the book's solution
function stepProblems(intro) {
const qs = L.qs, posKey = `${bookId}:${L.n}`, pos = kidMap(S.pos);
let qi = pos[posKey] || 0, pi = 0, tries = 0, miss = 0, si = 0, busy = false;
if (qi >= qs.length) qi = 0;
const col = el('div', 'qa'); $('stage').appendChild(col);
const pic = el('div', 'pic'); const qd = el('div', 'q'); const seq = el('div', 'seq'); const sol = el('div', 'sol');
const pad = numPad(check);
col.append(pic, qd, seq, sol, pad.el);
initTray();
const work = workPad();
if (!/^algebra/.test(bookId)) $('controls').append(btn('🧮 Counters', () => $('tray').classList.toggle('on'))); // no counting beads in Algebra
$('controls').append(work.btn, btn('Finish later', () => { pos[posKey] = qi; save(); leave(); }, 'ghost parent'));
if (L.note) $('hint').textContent = L.note;
const Q = () => qs[qi], Pt = () => Q().parts[pi];
function render() {
const q = Q(); qd.innerHTML = ''; qd.classList.toggle('has-stack', q.parts.some(p => p.col));
q.parts.forEach((p, k) => {
qd.appendChild(el('span', 'pt' + (k === pi ? ' cur' : k < pi ? '' : ''), p.t + ' '));
if (p.col) { // a sum written in a column, the book's way: numbers right-aligned, the sign on the last line, a rule under
const st = el('div', 'stack'), sign = { '+': '+', '-': '−', x: '×' }[p.col.op];
p.col.n.forEach((v, j) => st.appendChild(el('div', '', (j === p.col.n.length - 1 ? `<b>${sign}</b>` : '') + v)));
if (k < pi) st.appendChild(el('div', 'sum', String(p.f || p.a))); qd.appendChild(st);
}
if (k < pi) qd.appendChild(el('span', 'got' + (p.missed ? ' miss' : ''), p.seq || p.open ? '✓' : p.e != null ? RaysAlg.pretty(p.e) : (p.f || p.a)));
if (k < q.parts.length - 1) qd.append(' ');
});
pic.textContent = picFor(q.parts[0].t);
seq.innerHTML = '';
const p = Pt(); if (p && p.seq) p.seq.forEach((v, k) => seq.appendChild(el('span', k < si ? 'got' : k === si ? 'cur' : '', k < si ? v : '?')));
const cur = seq.querySelector('.cur'); if (cur) cur.scrollIntoView({ block: 'nearest' });
}
function ask(sayIt) {
if (qi >= qs.length) { pos[posKey] = 0; save(); return next(starsFor(miss, qs.reduce((n, q) => n + q.parts.length, 0))); }
tries = 0; pad.clear(); sol.textContent = ''; if (pi === 0) Q().shown = false;
const p = Pt(); if (p.seq && si === 0) si = 1; // the first number of a count is given
pad.frac(p.f); pad.alg(p.e != null ? p.v || '' : null); pad.show(!p.open); openB.style.display = p.open ? '' : 'none';
render();
work.page(`${L.n}:${qi}`, { q: Q().parts.map(x => x.t).join(' '), l: L.n }); // one page for all the parts of a question
$('hint').textContent = `Question ${qi + 1} of ${qs.length}`;
sayAgain = () => speak(p.s || p.t, p.open ? 'Answer out loud, then tap Next.' : null);
if (sayIt !== false) sayAgain();
}
function advance() {
busy = false; const q = Q();
if (++pi < q.parts.length) { si = 0; return ask(); }
if (q.sol && !q.shown) { q.shown = true; sol.textContent = q.sol; }
qi++; pi = 0; si = 0; pos[posKey] = qi; save();
setTimeout(() => ask(), q.sol && sol.textContent ? 600 : 0);
}
function check(v) {
if (busy) return; const p = Pt();
const norm = s => String(s).trim().replace(/\s+/g, ' ');
const isRight = (p, v) => { const want = p.seq ? p.seq[si] : p.e != null ? p.e : p.f || p.a;
return p.e != null ? RaysAlg.ok(v, p.e) || (p.ealt || []).some(x => RaysAlg.ok(v, x)) : p.ex ? p.ex.includes(norm(v)) : p.f ? sameVal(v, p.f) || (p.falt || []).some(x => sameVal(v, x)) : v === want || (!p.seq && p.alt && p.alt.includes(v)); };
let right = isRight(p, v);
// "x = {A} or {B}" (the two roots of a quadratic): B typed first counts too; the next box then wants A
const nx = Q().parts[pi + 1];
if (!right && p.pr && nx && isRight(nx, v)) {
for (const k of ['e', 'es', 'ealt', 'a', 'alt', 'f', 'falt', 'v']) { const t = p[k]; if (nx[k] === undefined) delete p[k]; else p[k] = nx[k]; if (t === undefined) delete nx[k]; else nx[k] = t; }
right = true;
}
const want = p.seq ? p.seq[si] : p.e != null ? p.e : p.f || p.a;
if (!p.seq || !right) work.result(v, right);
if (right) {
beep(true); pad.set(v, 'ok'); tries = 0;
if (p.seq) { if (++si >= p.seq.length) { busy = true; render(); return setTimeout(() => { si = 0; advance(); }, 700); } setTimeout(() => { pad.clear(); render(); }, 350); return; }
busy = true; speak(P.yes); setTimeout(advance, 900); return;
}
miss++;
if (++tries < 2) { beep(false); pad.bad(); speak(P.tryAgain); return; }
// second miss: show the answer, say it, and the book's solution when there is one
busy = true; pad.set(want, 'ok'); tries = 0;
const q = Q(), last = !p.seq && pi === q.parts.length - 1;
if (last && q.sol) { sol.textContent = q.sol; q.shown = true; }
if (p.seq) { si++; if (si >= p.seq.length) { si = 0; p.missed = true; return speak('ans:' + want).then(() => advance()); } return speak('n:' + want).then(() => { busy = false; pad.clear(); render(); }); }
p.missed = true;
speak('ans:' + want, last && q.sol ? q.sol : null).then(() => wait(800)).then(advance);
}
// a question answered out loud to a grown-up: no typing, just Next. When the book gives the answer (sol:), the first
// Next shows and says it (e.g. "57 is written LVII."), the second moves on.
const openB = btn('Next ▶', () => {
if (busy) return; const q = Q();
if (pi === q.parts.length - 1 && q.sol && !q.shown) { q.shown = true; sol.textContent = q.sol; speak(q.sol); return; }
busy = true; beep(true); setTimeout(advance, 300);
}, 'big'); openB.style.display = 'none';
col.appendChild(openB);
cleanup = () => { pad.stop(); work.stop(); };
afterIntro(intro, () => ask());
}
// Book Five: the book's articles, each beside its figure cut from the scan (same key as make-audio.ps1 ArtKey)
const artKey = a => `${a.n}. ${a.h ? a.h + '. ' : ''}${a.t}`;
function stepStudy(intro) {
const arts = L.arts; let i = 0, run = 0; const seen = new Set();
const stop = () => { run++; playB.disabled = false; }; // a tap cancels reading-to-me
const col = el('div', 'col study'); $('stage').appendChild(col);
const face = el('div', 'art'); const chips = el('div', 'chips'); col.append(face, chips);
const chipEls = arts.map((a, k) => { const c = btn('§' + a.n, () => { stop(); i = k; show(); }, 'chip'); chips.appendChild(c); return c; });
function draw() {
const a = arts[i]; face.innerHTML = '';
if (a.figs) { const fb = el('div', 'figs'); a.figs.forEach(f => { const im = el('img', 'fig'); im.src = f; im.alt = 'Figure for article ' + a.n; fb.appendChild(im); }); face.appendChild(fb); }
face.appendChild(el('p', '', `<b>${a.n}.</b> ${a.h ? `<b>${a.h}.</b> ` : ''}${a.t}`));
chipEls.forEach((c, k) => c.classList.toggle('cur', k === i));
}
function show() {
const a = arts[i]; draw(); chipEls[i].classList.add('seen'); seen.add(i);
chipEls[i].scrollIntoView({ block: 'nearest' }); face.scrollTop = 0;
$('hint').textContent = `Part ${i + 1} of ${arts.length}`;
if (seen.size === arts.length) nextB.disabled = false;
return speak(artKey(a));
}
async function playAll() { // from the part on screen to the end
const my = ++run; playB.disabled = true;
for (; i < arts.length; i++) { await show(); if (my !== run) return; await wait(700); if (my !== run) return; }
i = arts.length - 1; playB.disabled = false; nextB.disabled = false;
}
const prevB = btn('◀', () => { stop(); if (i > 0) { i--; show(); } });
const fwdB = btn('▶', () => { stop(); if (i < arts.length - 1) { i++; show(); } else nextB.disabled = false; });
const playB = btn('▶ Read to me', playAll, 'big'), nextB = btn('Next step ▶', () => next(3));
nextB.disabled = true; $('controls').append(prevB, playB, fwdB, nextB);
sayAgain = show; cleanup = () => { run++; };
draw(); afterIntro(intro, () => { if (!seen.size) playAll(); });
}
// pick the answer (or True / False); a miss comes back at the end, two misses show the answer
function stepQuiz(intro) {
let queue = shuffle(L.quiz.map(x => ({ ...x }))), done = 0, miss = 0, tries = 0, busy = false, cur;
const total = queue.length;
const col = el('div', 'qa'); $('stage').appendChild(col);
const qd = el('div', 'q'); const grid = el('div', 'mc'); col.append(qd, grid);
function ask() {
if (!queue.length) { toast('Great job! ⭐'); return setTimeout(() => next(starsFor(miss, total)), 900); }
cur = queue[0]; tries = 0; busy = false; grid.innerHTML = '';
qd.textContent = (cur.tf ? 'True or false? ' : '') + cur.q;
const order = cur.tf ? [0, 1] : shuffle(cur.c.map((_, k) => k));
order.forEach(k => grid.appendChild(btn(cur.c[k], e => pick(k, e.currentTarget))));
$('hint').textContent = `${done + 1} of ${total}`;
sayAgain = () => speak(cur.q); sayAgain();
}
function pick(k, b) {
if (busy) return;
if (k === cur.a) { busy = true; beep(true); b.classList.add('ok'); queue.shift(); done++; speak(P.yes); return setTimeout(ask, 900); }
miss++; beep(false); b.classList.remove('no'); void b.offsetWidth; b.classList.add('no'); b.disabled = true;
if (++tries < 2 && !cur.tf) return speak(P.tryAgain);
busy = true; [...grid.children].forEach(x => { if (x.textContent === cur.c[cur.a]) x.classList.add('ok'); });
const it = queue.shift(); it.again = true; queue.push(it); // asked again at the end
speak('ansc:' + cur.c[cur.a]).then(() => wait(700)).then(ask);
}
afterIntro(intro, ask);
}
function finish() {
const vals = Object.values(scores), stars = Math.max(1, Math.round(vals.reduce((a, b) => a + b, 0) / Math.max(1, vals.length)));
const p = prog(bookId), old = (p[L.n] || {}).stars || 0;
p[L.n] = { stars: Math.max(old, stars), at: Date.now() };
const got = kidMap(S.stickers), sk = stkKey(bookId, L.n); const sticker = got[sk] || STICKERS[(L.n * 7 + SHELF.findIndex(b => b.id === bookId) * 3) % STICKERS.length]; got[sk] = sticker;
save();
$('stepTitle').textContent = `${S.kid}, you finished Lesson ${L.n}!`;
$('stage').innerHTML = `<div class="col"><div class="stars">${starStr(stars)}</div><div class="stk">${sticker}</div><div class="note">A new sticker for your sticker book!</div></div>`;
$('hint').textContent = ''; $('controls').innerHTML = '';
$('controls').append(btn('Lessons', () => openBook(bookId), 'big'), btn('Sticker book', () => go('stickers')));
const gj = `Great job, ${S.kid}!`; beep(true); speak(urlFor(gj) ? gj : P.greatJob, P.done);
}
// ?preview opens the "Coming soon" books that already have a book file (testing a book before it goes live)
const ready = b => !b.soon || /[?&]preview\b/.test(location.search);
Promise.all([
fetch('prompts.json').then(r => r.json()).then(j => { P = j; }),
...SHELF.filter(ready).map(b => fetch(`books/${b.id}.json`).then(r => r.ok ? r.json() : null).then(j => { if (j) BOOKS[b.id] = j; })),
...SHELF.filter(ready).map(b => fetch(`audio/${b.id}.json`).then(r => r.ok ? r.json() : null).then(j => {
if (!j) return; if (!AUDIO) AUDIO = { speeds: j.speeds, items: {} }; Object.assign(AUDIO.items, j.items);
}).catch(() => {}))
]).then(home, () => toast('Could not load the book. Check the internet.', 4000));
// the account answer can arrive after the first draw: redraw the home screen
if (window.ABCAccount) window.ABCAccount.ready.then(() => { if ($('home').classList.contains('on') && Object.keys(BOOKS).length) home(); });
return { go, leave, debug: () => ({ S, L, steps, stepIdx, scores }), toStep: id => { const i = steps.indexOf(id); if (i >= 0) { stepIdx = i; runStep(); } }, wordsToNumber };
})();
EOF
index.html: the page and its styles (new: the pad's extra rows).
cat > /root/rays-rebuild/index.html <<'EOF'
<!doctype html>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="theme-color" content="#121212">
<title>Ray's Arithmetic</title>
<link rel="icon" type="image/png" sizes="192x192" href="icon-192.png">
<link rel="manifest" href="manifest.webmanifest">
<link rel="apple-touch-icon" href="icon-192.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Ray's Math">
<style>
:root{color-scheme:dark;--paper:#121212;--ink:#ececec;--soft:#a8a8a8;--accent:#2f8fbf;--warm:#d9733f;--good:#3fae6e;--bad:#ff6b5e;--board:#1d3527;--card:#1e1e1e;--line:#6a6a6a;--hi:#1f3340;--a:#f0a03c;--b:#5ab4f0}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--paper);color:var(--ink);font-family:Georgia,"Times New Roman",serif;overflow:hidden;user-select:none;-webkit-user-select:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
.screen{position:absolute;inset:0;display:none;flex-direction:column;padding:10px 16px}
.screen.on{display:flex}
h1{margin:4px 0 10px;font-size:clamp(26px,6vmin,44px);text-align:center;letter-spacing:.04em}
h2{margin:4px 0;font-size:clamp(19px,4.2vmin,30px);text-align:center}
button{font:inherit;font-size:clamp(18px,4vmin,26px);border:3px solid var(--line);background:var(--card);color:var(--ink);border-radius:14px;padding:8px 16px;min-height:50px;cursor:pointer}
button:active{transform:scale(.96)}
button.big{background:var(--accent);color:#fff;border-color:#164a63;font-size:clamp(21px,4.6vmin,30px);padding:12px 26px}
button.ghost{border-color:transparent;background:transparent}
button:disabled{opacity:.35}
.row{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;align-items:center}
.grow{flex:1;min-height:0;position:relative}
.kids button{min-width:30vmin;font-size:clamp(24px,6vmin,40px)}
.kids button.sel{background:var(--accent);border-color:var(--accent);color:#fff}
.kids button.add,.kids button.ghost,.kids button.big{min-width:0}
.kids input{font:inherit;font-size:clamp(22px,5vmin,34px);width:min(60vw,320px);padding:8px 14px;border-radius:14px;border:3px solid var(--line);background:var(--card);color:var(--ink)}
#home{overflow-y:auto}
.shelf{display:flex;gap:3vmin;justify-content:center;flex-wrap:wrap;margin-top:3vmin;padding:8px}
.book{width:min(34vmin,210px);aspect-ratio:3/4;border-radius:6px 14px 14px 6px;color:#fff;padding:14px;display:flex;flex-direction:column;justify-content:space-between;box-shadow:inset 10px 0 0 rgba(0,0,0,.18),0 4px 10px rgba(0,0,0,.25);border:none;text-align:left}
.book b{font-size:clamp(18px,4vmin,26px)}.book small{font-size:clamp(13px,2.6vmin,17px);opacity:.9}
.book .bp{font-size:clamp(14px,3vmin,19px);font-weight:bold;background:rgba(0,0,0,.35);border-radius:8px;padding:4px 8px;align-self:flex-start}
.book.soon{filter:grayscale(.6);opacity:.6}
.book.cur{outline:5px solid #ffd166;outline-offset:3px;animation:pulse 1.6s infinite}
.map{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(22vmin,120px),1fr));grid-auto-rows:min(24vmin,120px);gap:12px;overflow-y:auto;padding:6px;align-content:start}
.tile{height:100%;min-height:0;border-radius:18px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:clamp(22px,6vmin,38px);padding:4px;line-height:1.1}
.tile small{font-size:clamp(11px,2.4vmin,15px);color:var(--soft)}
.tile .st{font-size:clamp(14px,3vmin,20px);color:#e0a000;letter-spacing:2px}
.tile.next{background:var(--hi);border-color:var(--accent);animation:pulse 1.4s infinite}
.tile.locked{opacity:.35}
.jump{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:6px 0;font-size:clamp(16px,3.4vmin,22px)}
.jump select{flex:1;min-width:0;max-width:100%;font:inherit;padding:8px;background:var(--card);color:var(--ink);border:2px solid var(--line);border-radius:12px}
.tile.rev{border-style:dashed}
@keyframes pulse{50%{transform:scale(1.05)}}
.top{display:flex;align-items:center;gap:8px}
.top .t{flex:1;text-align:center;font-size:clamp(17px,3.8vmin,26px)}
.steps{display:flex;gap:6px;justify-content:center;margin:4px 0}
.steps i{width:clamp(18px,4vmin,28px);height:clamp(18px,4vmin,28px);border-radius:50%;border:3px solid var(--soft);font-style:normal;font-size:12px;display:flex;align-items:center;justify-content:center}
.steps i.done{background:var(--good);border-color:var(--good)}.steps i.cur{border-color:var(--accent);background:var(--hi)}
.hint{font-size:clamp(15px,3.2vmin,20px);color:var(--soft);text-align:center;min-height:1.4em}
.toast{position:fixed;left:50%;top:40%;transform:translate(-50%,-50%);background:#2a2a2a;border:3px solid var(--accent);color:#fff;padding:18px 28px;border-radius:18px;font-size:clamp(24px,6vmin,40px);display:none;z-index:9;text-align:center}
.stars{font-size:clamp(40px,12vmin,90px);color:#e0a000;text-align:center;letter-spacing:6px}
.parent{font-size:15px;color:var(--soft)}
.col{display:flex;flex-direction:column;align-items:center;gap:1.2vmin;height:100%;overflow-y:auto;justify-content:center}
.big-n{font-size:clamp(70px,22vmin,170px);line-height:1;font-weight:bold}
.word{font-size:clamp(22px,5vmin,36px);color:var(--soft)}
.fact{font-size:clamp(30px,8vmin,64px);text-align:center;line-height:1.15}
.fact .sm{display:block;font-size:clamp(16px,3.4vmin,22px);color:var(--soft)}
.dots{display:flex;flex-wrap:wrap;gap:1.4vmin;justify-content:center;align-items:center;max-width:94vw}
.grp{display:grid;grid-template-columns:repeat(5,auto);gap:.8vmin;padding:1vmin;border-radius:10px;border:2px dashed transparent}
.grp.box{border-color:var(--line)}
.dot{width:clamp(14px,3.6vmin,26px);height:clamp(14px,3.6vmin,26px);border-radius:50%;background:var(--a)}
.dot.b{background:var(--b)}.dot.x{background:#444;position:relative}.dot.x::after{content:'';position:absolute;left:-2px;right:-2px;top:45%;height:3px;background:var(--bad);transform:rotate(-35deg)}
.op{font-size:clamp(26px,6vmin,44px);color:var(--soft)}
.chips{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;max-height:24vh;overflow-y:auto}
.chip{font-size:clamp(14px,3vmin,19px);min-height:38px;padding:4px 10px;border-radius:10px}
.chip.cur{background:var(--hi);border-color:var(--accent)}.chip.seen{border-color:var(--good)}
.balls{display:flex;flex-wrap:wrap;gap:2vmin;justify-content:center;max-width:90vw}
.ball{width:clamp(44px,11vmin,80px);height:clamp(44px,11vmin,80px);border-radius:50%;border:none;background:radial-gradient(circle at 35% 30%,#ffd9a8,var(--warm) 60%,#7a3412);padding:0;min-height:0;font-size:clamp(18px,4vmin,28px);color:#fff;font-weight:bold}
.ball.on{background:radial-gradient(circle at 35% 30%,#b8f0c8,var(--good) 60%,#1b5a35)}
.rods{display:flex;gap:1vmin;align-items:flex-end;justify-content:center;flex-wrap:wrap}
.rod{display:grid;grid-template-rows:repeat(10,1fr);gap:2px;height:clamp(110px,26vmin,190px);width:clamp(14px,3.4vmin,22px)}
.rod i{background:var(--b);border-radius:3px}
.choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2vmin;width:min(90vw,520px)}
.choices button{font-size:clamp(40px,12vmin,86px);min-height:clamp(80px,18vmin,140px)}
.choices button.ok{background:var(--good);border-color:var(--good);color:#fff}.choices button.no{animation:shake .4s}
@keyframes shake{25%{transform:translateX(-8px)}75%{transform:translateX(8px)}}
.grid{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;overflow-y:auto;max-height:100%;align-content:flex-start;padding:4px}
.grid button{min-width:clamp(56px,14vmin,90px);font-size:clamp(24px,6vmin,40px)}
.grid button.seen{border-color:var(--good)}
/* question + number pad */
.study{gap:1vmin}.study .chips{max-height:15vh;flex-shrink:0}.art{flex:1;min-height:0;overflow-y:auto;width:min(94vw,760px);background:#fffdf6;border-radius:12px;padding:10px 14px;color:#222}
.art{display:flex;flex-direction:column;gap:10px}.art .figs{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center}
.art img.fig{display:block;max-width:100%;max-height:26vh;mix-blend-mode:multiply}
@media (min-aspect-ratio:5/4){.art{flex-direction:row;align-items:flex-start}.art .figs{flex:0 0 38%;flex-direction:column;position:sticky;top:0}.art img.fig{max-height:30vh}.art p{flex:1}}
.art p{margin:0;font-size:clamp(18px,3.8vmin,28px);line-height:1.45}
.mc{display:flex;flex-direction:column;gap:1.4vmin;width:min(92vw,640px)}
.mc button{font-size:clamp(18px,4vmin,28px);min-height:56px;padding:8px 14px;text-align:left;line-height:1.3}
.mc button.ok{background:var(--good);border-color:var(--good);color:#fff}.mc button.no{animation:shake .4s;opacity:.55}
.qa{display:flex;flex-direction:column;align-items:center;gap:1vmin;height:100%;min-height:0}
.q{font-size:clamp(20px,4.6vmin,34px);line-height:1.35;text-align:center;overflow-y:auto;max-height:42%;padding:4px 10px;border-radius:12px}
.q .pt{opacity:.55}.q .pt.cur{opacity:1;background:var(--hi);border-radius:8px;padding:0 4px}
.q .got{display:inline-block;background:var(--good);color:#fff;border-radius:8px;padding:0 8px;margin:0 4px;font-weight:bold}
.q .miss{background:var(--warm)}
.q.has-stack{max-height:60%}.q.has-stack .pt{font-size:.85em}
.stack{display:table;margin:.2em auto;font-family:'Courier New',monospace;font-weight:bold;text-align:right;line-height:1.05;font-size:1.05em;border-bottom:3px solid currentColor;padding:0 .3em}
.stack b{float:left;margin-right:.6em}.stack .sum{color:var(--good);border-top:3px solid currentColor;margin-bottom:-3px}
.pic{font-size:clamp(30px,8vmin,56px);line-height:1}
.expr{font-size:clamp(46px,13vmin,100px);font-weight:bold;line-height:1.05;text-align:center}
.micb{min-width:min(86vw,360px);font-size:clamp(20px,4.6vmin,30px)}.micb.live{background:var(--bad);border-color:var(--bad);color:#fff;animation:pulse 1s infinite}
.expr.long{font-size:clamp(28px,7vmin,52px)}
.entry{min-width:3.4em;min-height:1.3em;font-size:clamp(36px,9vmin,64px);text-align:center;border-bottom:4px solid var(--accent);font-weight:bold;letter-spacing:.05em}
.entry.long{font-size:clamp(24px,6vmin,44px)}.entry.no{animation:shake .4s;border-color:var(--bad)}.entry.ok{color:var(--good)}
.pad{display:grid;grid-template-columns:repeat(3,1fr);gap:1.2vmin;width:min(86vw,360px)}
.pad button{font-size:clamp(24px,6vmin,38px);min-height:clamp(46px,9.5vmin,70px);padding:0}
.pad button.okb{background:var(--good);border-color:var(--good);color:#fff}
.algmode .entry{max-width:92vw;overflow-wrap:anywhere;letter-spacing:0}.algmode .entry.long{font-size:clamp(18px,4.2vmin,32px)}
.pad.alg,.algmode .pad{grid-template-columns:repeat(6,1fr);width:min(92vw,480px)}.pad.alg button,.algmode .pad button{font-size:clamp(20px,5vmin,32px);min-height:clamp(40px,8vmin,60px)}.pad.alg button.let{font-style:italic;font-family:Georgia,serif}
.seq{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;max-height:22vh;overflow-y:auto}
.seq span{min-width:2.2em;text-align:center;border:2px solid var(--line);border-radius:8px;padding:2px 6px;font-size:clamp(18px,4vmin,28px)}
.seq span.got{border-color:var(--good);color:var(--good)}.seq span.cur{border-color:var(--accent);background:var(--hi)}
.sol{font-size:clamp(16px,3.4vmin,22px);color:#ffd166;text-align:center;max-width:90vw}
.tray{position:fixed;left:50%;bottom:2vh;transform:translateX(-50%);background:#1a1a1a;border:3px solid var(--accent);border-radius:16px;padding:10px;z-index:20;display:none;flex-direction:column;align-items:center;gap:8px}
.tray.on{display:flex}
.frame{display:grid;grid-template-columns:repeat(10,1fr);gap:5px}
.frame button{width:clamp(26px,6.5vmin,44px);height:clamp(26px,6.5vmin,44px);min-height:0;border-radius:50%;padding:0;border-width:2px}
.frame button.on{background:var(--a);border-color:var(--a)}
.timer{font-size:clamp(16px,3.4vmin,22px);color:var(--soft)}
.stk{font-size:clamp(40px,10vmin,72px)}
.stickers{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;overflow-y:auto;font-size:clamp(34px,9vmin,60px)}
.stickers span{width:1.5em;height:1.5em;display:flex;align-items:center;justify-content:center;border:2px dashed var(--line);border-radius:12px}
.stickers span.got{border:2px solid #e0a000;background:#2a2410}
canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;border-radius:14px}
.paper{background:#1a1a1a;border:3px solid var(--line);border-radius:14px}
.note{font-size:clamp(13px,2.8vmin,17px);color:var(--soft);text-align:center;max-width:90vw}
/* show your work: scratch paper beside the question (landscape) or under the number pad (portrait), never over them */
#controls button.on{background:var(--hi);border-color:var(--accent)}
#stage.working{display:flex;flex-direction:column;gap:8px}
#stage.working .qa{flex:1 1 auto;height:auto;min-height:0;overflow-y:auto}
#stage.working .qa .pic{display:none}
#stage.working .pad button{min-height:clamp(42px,7vmin,60px)}#stage.working .micb{min-height:44px;padding:4px 16px;font-size:clamp(17px,3.6vmin,24px)}#stage.working .entry{font-size:clamp(28px,6.5vmin,50px)}#stage.working .expr{font-size:clamp(32px,7.5vmin,64px)}#stage.working .expr.long{font-size:clamp(24px,5.5vmin,44px)}#stage.working .qa{gap:.6vmin;overflow:hidden}#stage.working .qa>*{flex-shrink:0}#stage.working .qa>.q{flex:0 1 auto;min-height:2.8em;max-height:24vh}#stage.working .qa>.picbox{flex:0 1 auto;overflow-y:auto}
.scratch{flex:0 0 35%;display:flex;flex-direction:column;gap:6px;min-height:0;min-width:0}
.sarea{flex:1;position:relative;min-height:0;border:3px solid var(--line);border-radius:14px;overflow:hidden;background:#fffdf6}
.sarea canvas{border-radius:0}
.stools{display:flex;gap:6px;justify-content:center;flex-wrap:wrap}
.stools button{font-size:clamp(16px,3.2vmin,22px);min-height:clamp(46px,8vmin,60px);padding:4px 12px;flex:1 1 0;max-width:180px;white-space:nowrap}
.stools button.on{background:var(--accent);border-color:#164a63;color:#fff}
.erz{display:inline-block;width:1.1em;height:.65em;background:linear-gradient(90deg,#f4a3b4 60%,#5a8fd0 60%);border-radius:3px;transform:rotate(-20deg);vertical-align:middle}
@media (min-aspect-ratio:5/4){#stage.working{flex-direction:row}#stage.working .qa{flex:0 0 44%;height:100%}#stage.working .qa .pic{display:block}.scratch{flex:1 1 0}}
.worklist{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;align-content:flex-start;overflow-y:auto;padding:6px}
.wles{flex-basis:100%;margin:10px 0 0;font-size:clamp(17px,3.6vmin,24px)}
.wpage{display:flex;flex-direction:column;gap:4px;padding:6px;text-align:left;font-size:15px;line-height:1.3;max-width:min(316px,46vw);border-width:2px}
.wpage canvas,.workbig canvas{position:static;border-radius:6px}
.wcap{font-size:clamp(14px,2.8vmin,18px);max-height:4.2em;overflow:hidden}
.workbig .wcap{max-height:none;text-align:center;max-width:94vw}
.wres{color:var(--soft);font-size:14px}.wres.ok{color:var(--good)}.wres.miss{color:var(--a)}
.workbig{position:fixed;inset:0;background:var(--paper);z-index:30;display:none;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:12px}
.workbig.on{display:flex}
</style>
</head><body>
<section id="home" class="screen on">
<h1>Ray's Arithmetic</h1>
<h2>Who is doing math today?</h2>
<div class="row kids" id="kids"></div>
<div class="hint" id="whoHint"></div>
<div class="shelf" id="shelf"></div>
<div class="row" style="margin-top:auto"><button class="ghost parent" id="speedBtn">Voice: normal</button><button class="ghost parent" id="toStickers">Sticker book</button><a class="parent" href="/account/">Grown-ups: account</a><a class="parent" href="/readers/">Readers</a><a class="parent" href="/">About</a></div>
</section>
<section id="map" class="screen">
<div class="top"><button onclick="Rays.go('home')">◀</button><div class="t" id="mapTitle"></div></div>
<div class="jump"><label for="jumpSel">Go to lesson</label><select id="jumpSel"></select><button id="jumpGo">Go</button><button id="mapWork" class="parent" title="Grown-ups: the scratch paper saved with each question">✏️ See the work</button></div>
<div class="map grow" id="tiles"></div>
</section>
<section id="lesson" class="screen">
<div class="top"><button onclick="Rays.leave()">◀</button><div class="t" id="lesTitle"></div><button id="sayBtn" title="Say it again">🔊</button></div>
<div class="steps" id="steps"></div>
<h2 id="stepTitle"></h2>
<div class="grow" id="stage"></div>
<div class="hint" id="hint"></div>
<div class="row" id="controls"></div>
</section>
<section id="stickers" class="screen">
<div class="top"><button onclick="Rays.go('home')">◀</button><div class="t" id="stkTitle">Sticker book</div></div>
<div class="stickers grow" id="stkList"></div>
<div class="row"><button id="stkWork" class="parent">✏️ See the work</button></div>
</section>
<section id="work" class="screen">
<div class="top"><button id="workBack">◀</button><div class="t" id="workTitle">Work</div></div>
<div class="worklist grow" id="workList"></div>
<div class="row"><button id="workDel" class="ghost parent">Delete all work in this book</button></div>
<div class="workbig" id="workBig"></div>
</section>
<div class="tray" id="tray"><div class="frame" id="frame"></div><div class="row"><b id="trayN">0</b><button id="trayClear">Clear</button><button id="trayClose">Close</button></div></div>
<div class="toast" id="toast"></div>
<script src="hershey.js"></script>
<script src="trace.js"></script>
<script src="/account/sync.js"></script>
<script src="scratch.js"></script>
<script src="alg.js"></script>
<script src="app.js"></script>
<script>if ('serviceWorker' in navigator) navigator.serviceWorker.register('sw.js').catch(() => {});</script>
</body></html>
EOF
sw.js: offline support (now keeps Book 6 too).
cat > /root/rays-rebuild/sw.js <<'EOF'
// Offline support. App files: network first (so updates show), cached copy when offline.
// Voice clips (audio/*.mp3) never change for a given name: cache first, saved the first time they play.
const SHELL = 'rays-shell-v19', CLIPS = 'rays-clips-v1';
const FILES = ['./', 'index.html', 'app.js', 'prompts.json', 'trace.js', 'scratch.js', 'alg.js', 'hershey.js', 'books/primary1877.json', 'audio/primary1877.json', 'books/intellectual.json', 'audio/intellectual.json', 'books/practical.json', 'audio/practical.json', 'books/higher.json', 'audio/higher.json', 'books/geometry.json', 'audio/geometry.json', 'books/algebra1.json', 'audio/algebra1.json', 'icon-192.png', 'manifest.webmanifest'];
self.addEventListener('install', e => { e.waitUntil(caches.open(SHELL).then(c => Promise.all(FILES.map(f => c.add(f).catch(() => {})))).then(() => self.skipWaiting())); });
self.addEventListener('activate', e => {
e.waitUntil(caches.keys().then(ks => Promise.all(ks.filter(k => k.startsWith('rays-') && k !== SHELL && k !== CLIPS).map(k => caches.delete(k)))).then(() => self.clients.claim()));
});
self.addEventListener('fetch', e => {
const r = e.request; if (r.method !== 'GET' || new URL(r.url).origin !== location.origin) return;
if (r.url.endsWith('.mp3')) {
e.respondWith(caches.open(CLIPS).then(c => c.match(r).then(hit => hit || fetch(r).then(res => { if (res.ok && res.status === 200) c.put(r, res.clone()); return res; }))));
return;
}
e.respondWith(fetch(r).then(res => { if (res.ok) caches.open(SHELL).then(c => c.put(r, res.clone())); return res; }).catch(() => caches.match(r)));
});
EOF
Rebuild, step by step
1. Build the book data
PC (PowerShell). It prints "45 lessons, 1164 questions ...", or a list of problems:
powershell -ExecutionPolicy Bypass -File C:\RaysArithmetic\tools\make-book.ps1 -Book algebra1
2. Record the voice
PC (PowerShell), about 8 minutes:
powershell -ExecutionPolicy Bypass -File C:\RaysArithmetic\tools\make-audio.ps1 -Id algebra1
3. Put it on the server
PC (PowerShell). -Audio sends only the recordings CT 306 (abc-web) doesn't have yet. It ends with "RAYS-DONE":
powershell -ExecutionPolicy Bypass -File C:\RaysArithmetic\deploy.ps1 -Audio
4. Check it
Open https://abcbooks.fyi/math/ , tap a name, and tap the wine-red Book 6. Lesson 1 starts reading article 1 ("In Algebra, quantities are represented by letters of the alphabet."). In Lesson 4's problems the pad shows the extra rows; type 11a for the first question.
Troubleshooting
- Book 6 says "Coming soon":
app.jsstill hassoon: trueon thealgebra1line of the shelf, orbooks/algebra1.jsonis missing on the server. - The pad has no + − keys:
alg.jsis missing, orindex.htmldoesn't load it. Check it is on the server (Proxmox host shell):
pct exec 306 -- ls -l /var/www/abcbooks/rays/alg.js
- Book 6 is silent: check that its voice list exists (Proxmox host shell):
pct exec 306 -- ls -l /var/www/abcbooks/rays/audio/algebra1.json
and count the MP3s (all six books together are about 22,600 at each speed):
pct exec 306 -- ls /var/www/abcbooks/rays/audio/s60 | wc -l
- make-book.ps1 says "x=... doesn't make ... true": the answer doesn't solve that equation; either the answer or the equation was typed wrong. "is not" means an answer doesn't equal its check.
- make-book.ps1 says "doesn't divide evenly": a
{$~ ...}division doesn't come out even, which usually means a misread exponent or sign. - A right answer is marked wrong: it may not be written as simply as the book's (see the pad rules above), or a root needs brackets: √(3a), not √3a.
- An old version shows after an update: change
rays-shell-v19insw.jsto the next number, deploy, and reload the page twice.
Notes
- Stickers are kept per book and per reader, so Book 6 has its own sticker page, and the scratch paper works in its problems too.
- Next on the shelf: Ray's New Higher Algebra (Book 7).