Linear equations and their solutions¶
Level: 101 · for anyone who has opened a linear algebra book and got stuck on the first definition
One line: A linear equation is a test that a list of numbers passes or fails, a system is several tests at once, and a solution of the system is a list that passes every one of them. That is all of Hefferon's Definition 1.1, once the subscripts are read aloud.
The definition¶
Jim Hefferon's Linear Algebra ↗ opens its first section, on Gauss's method, with one boxed definition. It introduces five terms in a row: linear combination, coefficient, linear equation, solution and system of linear equations. Each is simple on its own. Together, in the book's notation, they read like a wall of subscripts, and it is easy to lose track of which letter is a fixed number and which one is unknown.
This page takes them one at a time, on an example you can picture: the two meter-stick balances from the page before the definition, where h and c are two unknown masses in kg and the stick balances when the moments on the two sides are equal.
| Balance | Equation |
|---|---|
| 1 | 40h + 15c = 100 |
| 2 | 25c = 50 + 50h, which is −50h + 25c = 50 with the unknowns moved to the left |
Symbol by symbol¶
| Piece | Say it | What it means |
|---|---|---|
| x₁, …, xₙ | "x one, up to x n" | the variables, or unknowns. The small number is a label, not a power: x₂ is "the second unknown", not x squared and not x times 2. Here x₁ is h and x₂ is c. |
| a₁, …, aₙ ∈ ℝ | "a one, up to a n, all real" | the coefficients: fixed numbers, one standing in front of each variable. ∈ ℝ says each one is a real number. Here a₁ = 40 and a₂ = 15. |
| a₁x₁ + a₂x₂ + ⋯ + aₙxₙ | "a one x one plus … plus a n x n" | a linear combination: multiply each variable by its coefficient and add. The ⋯ means "and so on in the same pattern". Here it is 40h + 15c. |
| … = d | "equals d" | a linear equation: a linear combination set equal to a number. The number d is the constant. Here d = 100. |
| (s₁, …, sₙ) ∈ ℝⁿ | "the n-tuple s one up to s n" | an ordered list of n real numbers, one for each variable, in order. ℝⁿ is the set of all such lists, and ℝ² is the plane of the Cartesian product. Here (1, 4) means h = 1 and c = 4. |
| satisfies | "passes" | a tuple is a solution of an equation when putting s₁ in for x₁, s₂ in for x₂ and so on makes the equation true: a₁s₁ + ⋯ + aₙsₙ = d. |
| aᵢ,ⱼ | "a i j" | in a system, the coefficient in equation i, in front of variable j. The first subscript picks the row, the second the column. Here a₂,₁ = −50. |
| dᵢ | "d i" | the constant of equation i. Here d₁ = 100 and d₂ = 50. |
| m, n | "m equations in n unknowns" | the size of the system. Every equation uses the same n variables, and a solution is one tuple that satisfies all m of them at once. |
Step by step¶
- A linear combination is a recipe. The coefficients are the recipe and stay fixed. The variables are the empty slots. Fill the slots with numbers and the recipe gives one number back: 40h + 15c with h = 1 and c = 4 gives 40 · 1 + 15 · 4 = 100.
- A linear equation is a test. 40h + 15c = 100 does not say what h and c are. It is a question that any pair of numbers can be asked: does the recipe come out to 100? (1, 4) passes. (4, 1) fails, which is why the order inside a tuple matters.
- One equation has many solutions. (5/2, 0), (0, 20/3) and (1/4, 6) pass the same test. Two unknowns and one test leave a whole line of answers.
- A system is several tests over the same variables. The double subscripts are only bookkeeping: a₁,₂ is "equation 1, the number in front of the second variable". Laying the coefficients out as rows and columns is where matrices will come from.
- A solution of the system passes every test. (5/2, 0) passes balance 1 but fails balance 2, so it is not a solution of the system. (1, 4) passes both. The definition says nothing about how to find such a tuple. That is the job of Gauss's method, the rest of the section.
What the program prints¶
The program stores each equation the way the definition writes it, as its coefficients and its constant, and checks every claim above on real tuples. Every number is an exact fraction, so "passes" means the two sides are equal, not equal to fifteen digits.
Verified output of linear_equations.py — regenerated by tools/run_examples.py, never hand-typed.
1. A LINEAR COMBINATION: MULTIPLY EACH VARIABLE BY A FIXED NUMBER, THEN ADD
coefficients a₁ = 40, a₂ = 15; variables x₁ = h, x₂ = c
the combination 40h + 15c, worked out at a few (h, c):
(1, 4) 40·1 + 15·4 = 100
(4, 1) 40·4 + 15·1 = 175
(0, 0) 40·0 + 15·0 = 0
(1/2, 2) 40·1/2 + 15·2 = 50
The coefficients stay fixed. Only the numbers put in for h and c change.
2. A LINEAR EQUATION IS A TEST THAT A TUPLE PASSES OR FAILS
equation: 40h + 15c = 100 (the constant d is 100)
(h, c) left side = 100?
(1, 4) 100 yes
(4, 1) 175 no the same two numbers, in the other order
(5/2, 0) 100 yes
(0, 20/3) 100 yes
(1/4, 6) 100 yes
4 of these 5 tuples pass. One equation in two unknowns has
infinitely many solutions, and together they fill a line.
A tuple is ordered: its first entry is always h and its second is c.
3. THE DOUBLE SUBSCRIPTS: aᵢ,ⱼ IS EQUATION i, VARIABLE j
the system of the two balances:
equation 1: 40h + 15c = 100
equation 2: -50h + 25c = 50
the same numbers, each with its name from the definition:
x₁ = h x₂ = c constant
row 1 a₁,₁ = 40 a₁,₂ = 15 d₁ = 100
row 2 a₂,₁ = -50 a₂,₂ = 25 d₂ = 50
m = 2 equations, n = 2 unknowns.
The first subscript says which equation, the second which variable:
a₂,₁ = -50 is the number in front of x₁ in equation 2.
4. A SOLUTION OF THE SYSTEM PASSES EVERY EQUATION
(h, c) equation 1 equation 2 system
(1, 4) yes yes yes
(5/2, 0) yes no no
(0, 20/3) yes no no
(0, 2) no yes no
(2, 6) no yes no
Each equation alone has infinitely many solutions. The system keeps only
the tuples that pass both, and of these five only (1, 4) does.
Finding it without guessing is the job of Gauss's method.
5. THE SAME DEFINITION FOR ANY m AND n
equation 1: x₁ + x₂ + x₃ = 6
equation 2: x₁ + 0x₂ - x₃ = 0
m = 2 equations, n = 3 unknowns, so a solution is a triple.
a₂,₂ = 0: a zero coefficient is allowed, and x₂ still has its slot.
(x₁, x₂, x₃) equation 1 equation 2 system
(1, 4, 1) yes yes yes
(2, 2, 2) yes yes yes
(1, 2, 3) yes no no
(6, 0, 0) yes no no
Equation 2 says x₃ = x₁. Put that into equation 1 and x₂ = 6 - 2x₁.
So every triple (t, 6 - 2t, t) should pass both. Checking some t:
t = 0 (0, 6, 0) system: yes
t = 1 (1, 4, 1) system: yes
t = 3 (3, 0, 3) system: yes
t = 7/2 (7/2, -1, 7/2) system: yes
t = -5 (-5, 16, -5) system: yes
Fewer equations than unknowns, and a whole line of solutions again.
6. WHY 'LINEAR': THE LEFT SIDE KEEPS SUMS AND MULTIPLES
L(h, c) = 40h + 15c
L(1, 4) = 100, L(5/2, 0) = 100, their sum = 200
L(7/2, 4) = 200 sum kept: yes
3·L(1, 4) = 300, L(3, 12) = 300 multiple kept: yes
L(h, c) = h² + 15c
L(1, 4) = 61, L(5/2, 0) = 25/4, their sum = 269/4
L(7/2, 4) = 289/4 sum kept: no
3·L(1, 4) = 183, L(3, 12) = 189 multiple kept: no
A linear combination keeps both, for every pair of tuples. One squared
variable breaks both, and so does h·c, √h or 1/h.
Any number of equations and unknowns¶
Section 5 shows that nothing in the definition depends on having two of anything. With m = 2 equations in n = 3 unknowns a solution is a triple, and a coefficient may be 0: in x₁ + 0x₂ − x₃ = 0 the variable x₂ still has its slot in every triple, and any value there passes. Two equations are not enough to pin down three unknowns, so again a whole line of triples passes, one for each number t in (t, 6 − 2t, t). The program checks five of them. The algebra in the output is what shows it is all of them.
What is not linear¶
Each variable may appear only multiplied by a fixed number, and the results are added. So these are linear:
- ½x₁ − 3x₂ = 0 — fractions, negatives and a zero constant are all allowed
- 25c = 50 + 50h — the unknowns can start on both sides; moving them to one side gives −50h + 25c = 50
- 0x₁ + x₂ = 7 — a zero coefficient is still a coefficient
And these are not:
- h² + 15c = 100 — a variable squared
- hc = 4 — two variables multiplied together
- √h + c = 3, 1/h = 2, sin h = 0 — a variable inside any other function
Section 6 shows why the name linear fits. A linear combination keeps sums and multiples: plug in the sum of two tuples and you get the sum of the two results, and three times a tuple gives three times the result. With one squared variable both checks fail. Those two checks are the definition of a linear map, the subject of maps that keep the laws. So the left side of every linear equation is a linear map, and that is where the whole subject gets its name.
Where this goes next¶
The theorem right after the definition is what makes solving possible. Three operations never change the set of solutions: swapping two equations, multiplying an equation by a number that is not zero, and adding a multiple of one equation to another. Gauss's method applies them until the answer can be read off. The reading guide's balance example runs it once on the same two equations and finds h = 1 and c = 4.
Auf Deutsch: Stichwörter¶
Eine lineare Gleichung ist ein Test für ein n-Tupel, und eine Lösung des Systems besteht jede Gleichung; keine, eine oder unendlich viele Lösungen.
Stichwörter: lineare Gleichung, Koeffizient, n-Tupel, Lösungsmenge, Gleichungssystem, eindeutig lösbar, unlösbar, unendlich viele Lösungen, Gerade und Ebene als Lösungsmenge.
See also¶
- The Cartesian product — what ℝ² is, and why (1, 4) is not (4, 1)
- A definition is a test — the same move one level up: the vector-space axioms as a test that whole sets pass or fail
- Maps that keep the laws — the two checks of section 6, as the definition of a linear map
- Linear algebra: a reading guide — why the subject is useful, what to know first, and which book to read
- Hefferon, Linear Algebra ↗ — free, with answers to every exercise; this page is Definition 1.1 of Chapter One
- System of linear equations ↗ — Wikipedia