We now have a complete engine: elimination decides
whether
is consistent, rank–nullity counts the free parameters,
and the null space describes the freedom. This section
runs the engine on four problems from outside linear
algebra. In each one the modeling step is where the
thinking happens: which quantities are unknown, why the
constraints are linear, and over which field. Each model
is also honest about what it leaves out.
Polynomial
interpolation
Suppose we know the values of an unknown polynomial
at a few points, and want the polynomial. Through two
points with different -values there is exactly
one line. Through three there is exactly one parabola,
possibly degenerate. The general question: given points
in , is there a
polynomial with and is it unique?
The unknowns are the coefficients. Writing , the condition reads , by Definition 0.8.6. The
and are known numbers, so
this is a linear equation in , even
though itself is
not linear. The conditions form a square system By Theorem 3.4.4, this
has exactly one solution for every
as soon as has only the
trivial solution. And says that the polynomial with coefficients
has the roots . So
everything hinges on a fact about polynomials: a
non-zero polynomial of degree at most cannot have distinct roots.
Chapter 0 proved this only for degree at most , in Exercise (C1: Roots of a quadratic),
so we prove it now in general. It takes two lemmas.
The first is long division by , carried out one
leading term at a time.
Lemma
3.7.1 (Factor Theorem for a Linear
Divisor)
Let
and . Then
there is
such that In particular, if is a root of , then .
Idea. Divide as at school. If has leading term , subtract , which
kills the leading term and leaves a polynomial of
smaller degree. Repeat until only a constant remains. To
turn “repeat” into a proof, use induction on the degree.
The constant left over is found by evaluating at , where the factor vanishes.
Proof. We first show that for some
and some
constant ,
by strong induction on (Theorem 0.2.10),
treating
together with the constants. If or , then is a constant, and
, work.
Let , and
suppose the statement holds for every polynomial of
degree less than ,
and for . Let
with
leading coefficient , and put The coefficient of in is , and all
higher coefficients are , so or . By the
induction hypothesis, with . Hence which is the statement for , with .
Now evaluate at . By Theorem 0.8.5, . So , and if , then . This proves the lemma.
Lemma
3.7.2 (Root bound)
Let ,
and let
be non-zero with . Then has at
most
distinct roots in .
Proof. We use induction on . If , then is a non-zero
constant, and for every , so
has no roots.
Let ,
suppose the statement holds for , and let with . If has no root, we are
done. Otherwise let be a root. By Lemma 3.7.1, for some
. Then
, since
otherwise ,
and by Theorem 0.8.3, , so
.
By the induction hypothesis, has at most distinct roots.
Let be
any root of . By
Theorem 0.8.5, ,
so or
by Theorem 0.7.1. Hence
every root of is
or a root of
, and has at most distinct
roots. This completes the induction.
The field axioms did real work in the last step: a
product of two non-zero elements is non-zero. Over , which is not a
field, has
the four roots , as Exercise (C1: Roots of a quadratic)
showed. And the lemma is sharp: over , the polynomial
of Example (Different polynomials, same function)
has degree and
the two roots and
.
The lemma also settles a question left open in
Chapter 0. If is
infinite and the polynomial function of
is zero, then
every element of
is a root of . If
were non-zero,
this would be more than roots, so . Over an infinite field, a polynomial is
therefore determined by its values: if for every
, then has zero polynomial
function by Theorem 0.8.5, so
.
Theorem
3.7.3 (Polynomial interpolation)
Let be distinct, and let
be arbitrary. Then there is exactly
one polynomial with for .
Proof. A polynomial is the
same thing as its coefficient vector , since two polynomials are equal
exactly when their coefficients agree (Definition 0.8.1). As
computed above, for all if and only if , where has
-entry (rows and columns
numbered from to
).
Let ,
and let . Then for every
, so has the distinct roots
,
while .
By Lemma 3.7.2, cannot be non-zero, so
and . Hence has only the
trivial solution, and is invertible by Theorem 3.4.4. By
Theorem 0.9.7 (7),
has
exactly one solution . The polynomial with these
coefficients is the unique required. This proves
the theorem.
The proof is a model of how this chapter turns
questions into systems. Existence for every right-hand
side and uniqueness are both properties of the square
matrix , and for
a square matrix they come together. So we only had to
prove uniqueness for the zero data, and that was a
statement about roots. Chapter 6 gives an explicit
formula for , the
Lagrange interpolation formula. Here is the computation
by elimination.
Example
(A cubic through four points)
Find the polynomial whose graph passes through , , and .
Solution. The -values are distinct,
so by Theorem 3.7.3 there
is exactly one such . The conditions give the
augmented matrix below. We first swap the rows for and , so that the
simplest row leads: Next clear column 2 below the pivot : Back substitution: , so ; , so ; , so
; and . Hence Check: , , , .
Warning. The -values must be distinct
as elements of . If , the first two
equations of have the same left-hand side, so the system
is inconsistent for any data with . This
depends on the field: over the numbers and are the
same element, so the four points of Example (A cubic through four points)
do not have distinct -values there. Note also
that the theorem promises degree at
most :
the three points are interpolated by , of degree .
Quick check. Find the polynomial
with , and .
Solution. The -values are distinct in
, so there is
exactly one such .
Since and are roots, try ,
which has degree at most and vanishes at and . Then , and gives , since in . Expanding, . Check: , , . By
uniqueness, this is the answer.
What the model leaves out.
Interpolation fits the data exactly.
When the are
measurements with errors, an exact fit of high degree
follows the noise and can swing wildly between the data
points. The honest tool there is a low-degree polynomial
that fits approximately, found by least squares in
Chapter 11.
Interpolation without a matrix
Theorem 3.7.3 came
out of a square system and the Invertible Matrix
Theorem. Rank–Nullity, from Chapter 2, reaches the same
conclusion with no matrix written down, and the two
arguments are worth seeing side by side.
Example
(Interpolation as a Count)
Let be distinct, and define by . Show that
is bijective, and
recover Theorem 3.7.3 from
that alone.
Solution. Linear. For
and , Theorem 0.8.5 gives
in each entry, so ,
and is linear by
Theorem 2.1.3.
Check the kernel. If , then has the distinct roots
while .
A non-zero polynomial of degree at most has at most distinct roots (Lemma 3.7.2), so
. Hence , and is injective (Theorem 2.2.3).
Count. , since is a
basis (Example (Standard Bases)),
and . By Corollary 2.3.2 (e),
is bijective.
Surjectivity of says that for every
some has for all
; injectivity says
there is only one. This is Theorem 3.7.3.
Compare them. Both prove uniqueness for the zero data
from the root bound (Lemma 3.7.2). The
first then invoked the Invertible Matrix Theorem for the
Vandermonde matrix; here the count does the
same job. Neither proof of existence constructs a
polynomial. That is the price and the power of counting:
it tells us a solution exists without saying what it
is.
Balancing
chemical equations
When ammonia burns in oxygen over a catalyst, it
produces nitric oxide and water: The coefficients count
molecules. The model rests on one physical law:
atoms are neither created nor
destroyed, so each element appears equally
often on both sides. For each element this gives one
linear equation: Moving everything to the left gives a
homogeneous system, so the balanced coefficient vectors
form the null space of its coefficient matrix. We want
positive integers, but we compute over . Elimination uses
only the four field operations on integer data, so it
never leaves ,
and a rational solution can be scaled to an integer one
at the end.
Example
(Burning ammonia)
Find all solutions of the system above over , and hence the
balanced equation with the smallest positive integer
coefficients.
Solution. In the order , with rows
N, H, O, the coefficient matrix is reduced as follows:
Scale rows 2 and 3 by and , then clear
column 3 above its pivot: This is the RREF. The pivot columns are 1, 2,
3, and is the
only free variable. By Theorem 3.2.4, with
, the
solutions are So the null space is a line: rank and nullity , as Theorem 3.5.7
predicts. The coefficients are integers exactly when
, and are integers, which
forces to be a
multiple of . The
smallest positive choice gives : Check: N: . H: . O: .
Nullity is
what makes “the balanced equation” meaningful: every
balancing is a multiple of one. Positivity was luck of
the data here. Nothing in the algebra guarantees that
the null space contains a vector with all entries
positive, and when it does not, the proposed reaction
cannot be balanced at all.
Warning. A null space of
dimension or more
does not give one balanced equation. For , the equations (hydrogen)
and
(oxygen) have rank and nullity . Both and balance, and
so does every positive combination of them. The
“reaction” is really two reactions, and , and the proportions depend on
chemistry, not on algebra.
What the model leaves out.
Conservation of atoms is necessary, not sufficient. The
equations cannot tell whether a reaction actually
happens, and reactions involving ions also conserve
electric charge, which adds one more linear
equation.
Flows in a
network
A small town center has four intersections and five
one-way streets. Cars enter and leave the center at some
intersections. We measure the external traffic and want
to know the traffic on each street.
The model has one assumption: at every intersection,
as many cars leave per minute as arrive, since cars do
not pile up or vanish. In electrical circuits the same
rule for currents is Kirchhoff’s current
law. To write it down, number the intersections
(vertices) and the
streets (edges) . Each edge
runs from a
vertex to
a different vertex .
The unknown is
the flow along edge . The data is the net external
supply at : cars
entering the network there per minute, with a negative
sign for cars leaving. Conservation at says
Definition
3.7.1 (Incidence matrix)
The incidence matrix of a network
with vertices and edges , where , is with
Row of is , the
flow out of minus
the flow into . So
conservation at every vertex is the single matrix
equation . Column of has exactly one and one , so its entries sum to
. Adding up all
the conservation equations therefore gives :
total inflow equals total outflow. This
is necessary for a solution. The next result shows that,
for a network in one piece, it is also sufficient.
A network is connected if for any
two vertices
there is a sequence of vertices in which each consecutive pair is joined by
an edge, in either direction.
Proposition
3.7.4 (Rank of an incidence matrix)
Let be the incidence matrix of a
connected network with vertices. Then .
Idea. Rank is easier to see through
the transpose. A vector assigns a number to each vertex, and
records,
for each edge, the difference of the numbers at its two
ends. So says that the numbers agree across every
edge. Along a chain of edges they then agree everywhere,
so the null space of is the line of
constant vectors. Rank–nullity and “row rank equals
column rank” finish.
Proof. Let . For each
edge , entry of is , by Definition 0.9.10 and
Definition 3.7.1.
Hence
if and only if whenever and are joined by an
edge.
Suppose . Given any vertex , connectedness gives a
sequence with consecutive vertices joined
by edges, so . Hence ,
where . Conversely ,
since all differences vanish. So , and since , its
dimension is .
The matrix
has columns, so
Theorem 3.5.7 gives
. By Theorem 3.5.5,
. This proves the proposition.
Corollary
3.7.5 (Solvable flow problems)
Let be the incidence matrix of a connected
network, and let . Then has a
solution if and only if . In that case the solutions
form for any one solution , and .
Proof. Let . It is the solution set of the
homogeneous system with the coefficient
matrix , so it is a
subspace by Theorem 3.1.2. That
matrix has rank ,
since its column space is spanned by the non-zero column
and so equals
. By Theorem 3.5.7,
.
Each column of has entries summing to
, so it lies in
, and since is a subspace, by
Theorem 1.3.1. Also
, by Definition 3.5.4
and Proposition 3.7.4.
Hence
by Theorem 1.6.8. By Theorem 3.1.1,
is consistent if and only if ,
which is the first claim. The description of all
solutions is Theorem 3.1.3, and
by Theorem 3.5.7,
since has columns.
The
free parameters have a clear meaning: they are flows
around loops. Adding the same amount of
traffic all the way around a closed circuit of streets
changes no intersection’s balance.
Example
(Traffic in a town center)
Four intersections are joined by one-way streets
, , , and , carrying unknown
flows (cars per minute) in that order. From
outside, cars
per minute enter at intersection 1 and at intersection 2,
while leave at
intersection 3 and at intersection 4.
Find all flows that satisfy conservation. If street
is closed
for repairs and flows cannot be negative, what is the
largest flow the diagonal street may have to
carry?
Solution. The network is connected,
and sums to , so by Corollary 3.7.5 a
solution exists and the solutions have free
parameters. We row reduce , with rows
for vertices and columns for : This is the RREF, with pivots in columns 1, 2,
3, so , as Proposition 3.7.4
predicts. The free variables are and , and by Theorem 3.2.4,
The two null space vectors are the loops:
sends extra
cars around , and moves cars from the
route
onto the diagonal .
With street closed, and . Non-negativity
requires , and , that is, . So the diagonal may carry up
to cars per
minute, which happens when street is empty. Check,
for : at vertex 1, out minus in is ; at 2, out minus in is ; at 3, out minus in is ; at 4, out minus in is .
What the model leaves out. Linear
algebra finds every flow that conserves cars, including
physically meaningless ones with negative entries, and
it cannot say which of the many valid flows drivers
actually choose. Non-negativity and street capacities
turn the problem into one about inequalities, which is
the subject of linear programming. The matrix of this model,
the graph Laplacian, returns in Chapter 24.
Lights out
over
A puzzle has a grid of lights, each on or off. Pressing a
light toggles it and its horizontal and
vertical neighbors (a corner has two neighbors, an edge
light three, the center four). Starting from some
pattern, the goal is to switch every light off. Can
every starting pattern be solved?
The model rests on two observations about the puzzle,
and together they say that the right field is .
- Encode “on” as and “off” as . Toggling a light is
adding in , because and . The effect of
several presses on a light is the sum of their effects,
and since addition is commutative, the order of
presses does not matter.
- Pressing a button twice toggles each affected light
twice, which is : nothing. So a strategy is just the
set of buttons pressed once, a vector
.
Number the cells , row ,
column , and list
them row by row. Pressing button adds to the
pattern a fixed vector , with
’s at and its neighbors.
Let be the matrix with these columns.
Starting from pattern and pressing the
buttons in , the
final pattern is by Theorem 0.9.3, and we
want it to be .
Since in
, the puzzle
is the linear system By Theorem 3.1.1,
pattern is
solvable exactly when . So “is every pattern solvable?” asks
whether .
Example
(Every pattern of the 3 × 3 puzzle is solvable)
Show that . Deduce that every one of the starting
patterns can be switched off, by exactly one set of
presses.
Solution. We show that has only the
trivial solution. Write the presses as a grid , and suppose : the presses
change no light. The equation for light says that the
presses at
and its neighbors add up to . We solve these
equations row by row, remembering that in . Name the top row
, , .
Lights of row 1 determine the presses of row
2. Light gives , so . Likewise
lights and
give Lights of row 2 determine the presses of
row 3. Light gives , using and . Light gives . Light gives .
Lights of row 3 give three conditions on . The first and third give and , and then the
second gives . So , and the formulas above make every .
Hence the null space of is , and by
Theorem 3.5.7. So
is a
subspace of
of dimension , and
by Theorem 1.6.8. Every
pattern lies in
, so every
pattern is solvable. The solution is unique by Corollary 3.1.4,
since has
only the trivial solution. In particular exactly one of
the press sets
solves each of the patterns.
The same chase finds an actual solution: the
constants from
simply ride along.
Example
(Switching off the center)
Only the center light is on. Which buttons should be
pressed?
Solution. Now has a at only, so the
equation for light has right-hand side and all others . Rows 1 and 2 of lights
give, as before, , , , , , and now The lights of row 3 give , and , that is, Adding the first two gives ; then and . Substituting,
, and . So we press the center and its four
neighbors, a plus sign:
Check, counting how often each light is toggled. The
center is toggled by all five presses: odd, so it goes
from on to off. A corner, say , is toggled by
presses at
and : even,
so it stays off. An edge light, say , is toggled by
presses at
and : even,
so it stays off. By the symmetry of the plus sign the
other corners and edges behave the same way.
Quick check. Starting from all
lights off, which set of presses
produces the pattern with only the center light
on?
Solution. The same plus sign.
Starting from ,
presses produce
the pattern ,
so we need with
the center pattern, which is exactly the system just
solved. Over ,
turning a pattern on and turning it off are the same
problem.
What the model leaves out. Nothing,
which is rare. The puzzle is linear over by its rules, so
the model is exact. It even predicts features that are
not obvious when playing, such as the irrelevance of the
order of presses.
Exercises
A. Check your
understanding
Exercise
(A1)
- (a) State the
polynomial interpolation theorem, including its
hypotheses.
- (b) True or false:
there is a polynomial with and . Which
hypothesis of the theorem fails?
- (c) In balancing a
chemical equation, what does it mean if the null space
of the coefficient matrix has dimension ? Dimension ?
- (d) Why is lights
out modeled over and not over ?
- (e) A connected
network has
vertices and
edges. What is the rank of its incidence matrix, and how
many free parameters does the solution set of a
consistent flow problem have?
Solution.
- (a) See Theorem 3.7.3: for
distinct and
any , there is exactly one with
for
all .
- (b) False: is one number, and
. The
theorem needs distinct -values, and here .
- (c) Dimension : all balancings are
multiples of one vector, so there is one balanced
equation up to scaling (provided a positive multiple
exists). Dimension or more: there are
independent balancings, and the equation is a mixture of
several reactions whose proportions algebra cannot
decide.
- (d) A light has two
states, and toggling twice restores it, so toggling is
adding with , which is
arithmetic in . Over , pressing a button
twice would count as , not .
- (e) By Proposition 3.7.4
the rank is . By Corollary 3.7.5 a
consistent problem has free parameters.
B. Practice
Exercise
(B1: Interpolating four points)
Find the polynomial with , , and . Justify that
there is only one.
Solution. The -values are distinct,
so there is exactly one such , by Theorem 3.7.3. Its
coefficients solve and then turns the last row into . Back
substitution: ; , so ; , so ; . Hence Check: , , , .
Exercise
(B2: Balancing a redox reaction)
Potassium permanganate reacts with hydrochloric acid:
Write the conservation equations for K, Mn, O,
H and Cl, find all rational solutions, and hence the
balanced equation with the smallest positive integer
coefficients.
Solution. Counting atoms of each
element on both sides: In the order , the coefficient matrix has rows
, , , and . The equations are nearly
solved already, so we eliminate by substitution, which
is row reduction written in words. The K, Mn and O
equations give , ,
. The H
equation gives . The Cl equation gives , so . Taking as the free variable, the RREF of the
coefficient matrix is and the solutions are , . The rank is
and the nullity
, so the
balancing is unique up to scaling. All entries are
integers exactly when is a multiple of , and gives Check: K ; Mn ; O ; H ; Cl .
Exercise
(B3: A ring road)
Four intersections lie on a ring of one-way streets
, , , , with flows in
that order. From outside, cars per minute enter
at intersection 1 and at intersection 3,
while leave at
intersection 2 and at intersection 4.
- (a) Write down the
incidence matrix
and the supply vector , and explain without
computation why the system is
consistent.
- (b) Find all
solutions.
- (c) If all flows
must be non-negative, what is the smallest possible flow
on each street?
Solution.
- (a) With rows for
the vertices and columns for the edges, The ring is connected, and , so
the system is consistent by Corollary 3.7.5.
- (b) Row reducing
: gives ;
then
gives ; then gives the zero row. The pivots are in
columns 1, 2, 3, and is free, so There is parameter, the flow around the ring. Check
at : vertex 1,
; vertex
2, ;
vertex 3, ; vertex 4, .
- (c) All flows are
non-negative exactly when , since then too. Each flow increases with , so all are smallest at
: . No
car needs to use street .
C. Going deeper
Exercise
(C1: The 2 × 2 puzzle)
Consider lights out on a grid, where
pressing a light toggles it and its two horizontal and
vertical neighbors. Number the cells , , , .
- (a) Write down the
matrix of the puzzle.
- (b) Show that .
- (c) Deduce that
every pattern is solvable by exactly one set of presses,
and find the presses that switch off the pattern with
only light
on.
Solution.
- (a) Button toggles every light
except the one diagonally opposite. So
- (b) Let be the all-ones
matrix and the
permutation matrix exchanging and
, which has ’s on the anti-diagonal.
Then over . Every entry of
is , so
. Each row
and each column of has a single , so and . And for ,
with , so by Lemma 3.4.7 (a). By
Theorem 0.9.4, because over .
- (c) By (b), is invertible with
. By Theorem 0.9.7 (7),
has
exactly one solution for every . For , : press lights . Check: light 1
is toggled by presses 1, 2, 3, three times, so it goes
off; light 2 by presses 1 and 2; light 3 by presses 1
and 3; light 4 by presses 2 and 3; each of these is
toggled twice and stays off.
Exercise
(C2: Interpolating values and slopes)
For , define its
(formal) derivative .
- (a) Prove that for
every field and all there is
exactly one with
- (b) Find this over for .
Hint: in (a), check that elimination never
divides by an element that could be zero in some
field.
Solution.
- (a) The four
conditions are linear in : , , , . Row reducing the augmented
matrix, using only additions of multiples of rows, Here holds in every field. The coefficient matrix
is now upper triangular with every diagonal entry equal
to , so it is
invertible by Lemma 3.6.2, and
back substitution gives the unique solution without any
division: Row operations preserve the solution set (Theorem 3.2.2), so
the original system also has exactly this one solution,
for every field .
- (b) With : , , , . So . Check: ; , so ; ;
.
Exercise
(C3: Networks in several pieces)
Let be the incidence matrix of a network
with vertices.
Say that vertices
and are
linked if they are joined by a sequence
of vertices in which consecutive ones share an edge, in
either direction (every vertex is linked to itself by
the sequence of length zero).
- (a) Show that
“linked” is an equivalence relation. Its equivalence
classes are called the components of
the network; let
be their number.
- (b) Prove that .
Solution.
- (a)
Reflexive: by the sequence of length zero.
Symmetric: reversing a sequence from to gives one from to , and consecutive
vertices still share an edge. Transitive:
following a sequence from to by one from to gives a sequence from
to . So “linked” is an
equivalence relation (Definition 0.5.2).
- (b) Let be the
components, and let have entry at the vertices of
and elsewhere. As in the
proof of Proposition 3.7.4,
if and
only if
for every edge joining and . Following sequences of
edges, this holds if and only if is constant on each
component, that is, with the common
value on .
(Conversely each is in
the null space, since both ends of an edge lie in the
same component.) So spans . It is
independent: if , then reading
the entry at any vertex of , where only the -th vector is non-zero
because the components are disjoint (Theorem 0.5.2), gives
.
Hence . Since has columns, Theorem 3.5.7 gives
, and Theorem 3.5.5 gives
,
as claimed.