3.7  Applications of Linear Systems

We now have a complete engine: elimination decides whether Ax=b 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.

3.7.1. Polynomial interpolation

Suppose we know the values of an unknown polynomial at a few points, and want the polynomial. Through two points with different x-values there is exactly one line. Through three there is exactly one parabola, possibly degenerate. The general question: given points (x0,y0),…,(xn,yn) in F2, is there a polynomial p∈F[x]≤n with p(x0)=y0,p(x1)=y1,…,p(xn)=yn, and is it unique?

The unknowns are the coefficients. Writing p=c0+c1x+⋯+cnxn, the condition p(xi)=yi reads c0+c1xi+⋯+cnxin=yi, by Definition 0.8.6. The xi and yi are known numbers, so this is a linear equation in c0,…,cn, even though p itself is not linear. The n+1 conditions form a square system Vc=y,V=(1x0x02⋯x0n1x1x12⋯x1n⋮⋮⋮⋮1xnxn2⋯xnn),c=(c0⋮cn),y=(y0⋮yn). By Theorem 3.4.4, this has exactly one solution for every y as soon as Vc=0 has only the trivial solution. And Vc=0 says that the polynomial with coefficients c has the n+1 roots x0,…,xn. So everything hinges on a fact about polynomials: a nonzero polynomial of degree at most n cannot have n+1 distinct roots. Chapter 0 proved this only for degree at most 2, in Exercise (C1: Roots of a quadratic), so we prove it now in general. It takes two lemmas.

The first is long division by x−c, carried out one leading term at a time.

Lemma 3.7.1 (Factor Theorem for a Linear Divisor)

Let p∈F[x] and c∈F. Then there is q∈F[x] such that p=(x−c)q+p(c). In particular, if c is a root of p, then p=(x−c)q.

Idea. Divide as at school. If p has leading term adxd, subtract adxd−1(x−c), 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 c, where the factor x−c vanishes.

Proof. We first show that p=(x−c)q+r for some q∈F[x] and some constant r∈F, by strong induction on deg⁡p (Theorem 0.2.10), treating p=0 together with the constants. If p=0 or deg⁡p=0, then p is a constant, and q=0, r=p work.

Let d≥1, and suppose the statement holds for every polynomial of degree less than d, and for 0. Let deg⁡p=d with leading coefficient ad, and put p1=p−adxd−1(x−c)=p−adxd+cadxd−1. The coefficient of xd in p1 is ad−ad=0, and all higher coefficients are 0, so p1=0 or deg⁡p1<d. By the induction hypothesis, p1=(x−c)q1+r with r∈F. Hence p=(x−c)(adxd−1+q1)+r, which is the statement for p, with q=adxd−1+q1.

Now evaluate at c. By Theorem 0.8.5, p(c)=(c−c)q(c)+r=0⋅q(c)+r=r. So r=p(c), and if p(c)=0, then p=(x−c)q. This proves the lemma.

Lemma 3.7.2 (Root bound)

Let n∈N, and let p∈F[x] be nonzero with deg⁡p≤n. Then p has at most n distinct roots in F.

Proof. We use induction on n. If n=0, then p=a is a nonzero constant, and p(c)=a≠0 for every c∈F, so p has no roots.

Let n≥1, suppose the statement holds for n−1, and let p≠0 with deg⁡p≤n. If p has no root, we are done. Otherwise let c be a root. By Lemma 3.7.1, p=(x−c)q for some q∈F[x]. Then q≠0, since otherwise p=0, and by Theorem 0.8.3, deg⁡p=1+deg⁡q, so deg⁡q≤n−1. By the induction hypothesis, q has at most n−1 distinct roots.

Let s∈F be any root of p. By Theorem 0.8.5, 0=p(s)=(s−c)q(s), so s−c=0 or q(s)=0 by Theorem 0.7.1. Hence every root of p is c or a root of q, and p has at most 1+(n−1)=n distinct roots. This completes the induction.

The field axioms did real work in the last step: a product of two nonzero elements is nonzero. Over Z/8Z, which is not a field, x2−1 has the four roots 1,3,5,7, as Exercise (C1: Roots of a quadratic) showed. And the lemma is sharp: over F2, the polynomial x2+x of Example (Different polynomials, same function) has degree 2 and the two roots 0 and 1.

The lemma also settles a question left open in Chapter 0. If F is infinite and the polynomial function of p is zero, then every element of F is a root of p. If p were nonzero, this would be more than deg⁡p roots, so p=0. Over an infinite field, a polynomial is therefore determined by its values: if p(c)=q(c) for every c∈F, then p−q has zero polynomial function by Theorem 0.8.5, so p−q=0.

Theorem 3.7.3 (Polynomial interpolation)

Let x0,x1,…,xn∈F be distinct, and let y0,y1,…,yn∈F be arbitrary. Then there is exactly one polynomial p∈F[x]≤n with p(xi)=yi for i=0,1,…,n.

Proof. A polynomial p∈F[x]≤n is the same thing as its coefficient vector c=(c0,…,cn)∈Fn+1, since two polynomials are equal exactly when their coefficients agree (Definition 0.8.1). As computed above, p(xi)=yi for all i if and only if Vc=y, where V∈Mn+1(F) has (i,j)-entry xij (rows and columns numbered from 0 to n).

Let Vc=0, and let q=c0+c1x+⋯+cnxn. Then q(xi)=0 for every i, so q has the n+1 distinct roots x0,…,xn, while deg⁡q≤n. By Lemma 3.7.2, q cannot be nonzero, so q=0 and c=0. Hence Vc=0 has only the trivial solution, and V is invertible by Theorem 3.4.4. By Theorem 0.9.7 (7), Vc=y has exactly one solution c=V−1y. The polynomial with these coefficients is the unique p 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 V, 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 p, the Lagrange interpolation formula. Here is the computation by elimination.

Example (A cubic through four points)

Find the polynomial p∈Q[x]≤3 whose graph passes through (−1,2), (0,1), (1,2), and (2,11).

Solution. The x-values −1,0,1,2 are distinct, so by Theorem 3.7.3 there is exactly one such p=c0+c1x+c2x2+c3x3. The conditions p(xi)=yi give the augmented matrix below. We first swap the rows for x=−1 and x=0, so that the simplest row leads: (1−11−121000111112124811)→R1↔R2(100011−11−1211112124811)→R4→R4−R1R2→R2−R1, R3→R3−R1(100010−11−1101111024810). Next clear column 2 below the pivot −1: →R4→R4+2R2R3→R3+R2(100010−11−1100202006612)→R4→R4−3R3(100010−11−110020200066). Back substitution: 6c3=6, so c3=1; 2c2=2, so c2=1; −c1+c2−c3=1, so c1=−1; and c0=1. Hence p=1−x+x2+x3. Check: p(−1)=1+1+1−1=2, p(0)=1, p(1)=1−1+1+1=2, p(2)=1−2+4+8=11.

Warning. The x-values must be distinct as elements of F. If x0=x1, the first two equations of Vc=y have the same left-hand side, so the system is inconsistent for any data with y0≠y1. This depends on the field: over F3 the numbers −1 and 2 are the same element, so the four points of Example (A cubic through four points) do not have distinct x-values there. Note also that the theorem promises degree at most n: the three points (0,0),(1,1),(2,2) are interpolated by p=x, of degree 1.

Quick check. Find the polynomial p∈F3[x]≤2 with p(0)=1, p(1)=0 and p(2)=0.

Solution. The x-values 0,1,2 are distinct in F3, so there is exactly one such p. Since 1 and 2 are roots, try p=a(x−1)(x−2), which has degree at most 2 and vanishes at 1 and 2. Then p(0)=a⋅(−1)(−2)=2a, and 2a=1 gives a=2, since 2⋅2=4=1 in F3. Expanding, p=2(x2−3x+2)=2(x2+2)=2x2+1. Check: p(0)=1, p(1)=3=0, p(2)=9=0. By uniqueness, this is the answer.

What the model leaves out. Interpolation fits the data exactly. When the yi 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.

3.7.2. 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 x0,…,xn∈F be distinct, and define E:F[x]≤n→Fn+1 by E(p)=(p(x0),…,p(xn)). Show that E is bijective, and recover Theorem 3.7.3 from that alone.

Solution. Linear. For p,q∈F[x]≤n and c∈F, Theorem 0.8.5 gives (cp+q)(xi)=cp(xi)+q(xi) in each entry, so E(cp+q)=cE(p)+E(q), and E is linear by Theorem 2.1.3.

Check the kernel. If E(p)=0, then p has the n+1 distinct roots x0,…,xn while deg⁡p≤n. A nonzero polynomial of degree at most n has at most n distinct roots (Lemma 3.7.2), so p=0. Hence kerE={0}, and E is injective (Theorem 2.2.3).

Count. dim⁡F[x]≤n=n+1, since (1,x,…,xn) is a basis (Example (Standard Bases)), and dim⁡Fn+1=n+1. By Corollary 2.3.2 (e), E is bijective.

Surjectivity of E says that for every (y0,…,yn)∈Fn+1 some p∈F[x]≤n has p(xi)=yi for all i; 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 n+1=n+1 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.

3.7.3. Balancing chemical equations

When ammonia burns in oxygen over a catalyst, it produces nitric oxide and water: aNH3+bO2⟶cNO+dH2O. The coefficients a,b,c,d 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: N:a=c,H:3a=2d,O:2b=c+d. 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 Q. Elimination uses only the four field operations on integer data, so it never leaves Q, 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 Q, and hence the balanced equation with the smallest positive integer coefficients.

Solution. In the order (a,b,c,d), with rows N, H, O, the coefficient matrix is reduced as follows: (10−10300−202−1−1)→R2→R2−3R1(10−10003−202−1−1)→R2↔R3(10−1002−1−1003−2). Scale rows 2 and 3 by 12 and 13, then clear column 3 above its pivot: →R3→13R3R2→12R2(10−1001−12−12001−23)→R2→R2+12R3R1→R1+R3(100−23010−56001−23). This is the RREF. The pivot columns are 1, 2, 3, and d is the only free variable. By Theorem 3.2.4, with d=t, the solutions are (a,b,c,d)=t(23,56,23,1),t∈Q. So the null space is a line: rank 3 and nullity 4−3=1, as Theorem 3.5.7 predicts. The coefficients are integers exactly when 23t, 56t and t are integers, which forces t to be a multiple of 6. The smallest positive choice t=6 gives (4,5,4,6): 4NH3+5O2⟶4NO+6H2O. Check: N: 4=4. H: 12=12. O: 10=4+6.

Nullity 1 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 2 or more does not give one balanced equation. For aH2+bO2→cH2O+dH2O2, the equations 2a=2c+2d (hydrogen) and 2b=c+2d (oxygen) have rank 2 and nullity 2. Both (2,1,2,0) and (1,1,0,1) balance, and so does every positive combination of them. The “reaction” is really two reactions, 2H2+O2→2H2O and H2+O2→H2O2, 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.

3.7.4. 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) 1,…,m and the streets (edges) 1,…,k. Each edge e runs from a vertex tail(e) to a different vertex head(e). The unknown fe is the flow along edge e. The data sv is the net external supply at v: cars entering the network there per minute, with a negative sign for cars leaving. Conservation at v says (flow out of v)−(flow into v)=sv.

Definition 3.7.1 (Incidence matrix)

The incidence matrix of a network with vertices 1,…,m and edges 1,…,k, where k≥1, is N∈Mm×k(R) with Nve={1if v=tail(e),−1if v=head(e),0otherwise.

Row v of Nf is ∑eNvefe, the flow out of v minus the flow into v. So conservation at every vertex is the single matrix equation Nf=s. Column e of N has exactly one 1 and one −1, so its entries sum to 0. Adding up all the conservation equations therefore gives 0=s1+⋯+sm: 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 v,w there is a sequence of vertices v=w0,w1,…,wt=w in which each consecutive pair is joined by an edge, in either direction.

Proposition 3.7.4 (Rank of an incidence matrix)

Let N∈Mm×k(R) be the incidence matrix of a connected network with m vertices. Then rankN=m−1.

Idea. Rank is easier to see through the transpose. A vector y∈Rm assigns a number to each vertex, and N⊤y records, for each edge, the difference of the numbers at its two ends. So N⊤y=0 says that the numbers agree across every edge. Along a chain of edges they then agree everywhere, so the null space of N⊤ is the line of constant vectors. Rank–nullity and “row rank equals column rank” finish.

Proof. Let y∈Rm. For each edge e, entry e of N⊤y is ∑vNveyv=ytail(e)−yhead(e), by Definition 0.9.10 and Definition 3.7.1. Hence N⊤y=0 if and only if yu=yw whenever u and w are joined by an edge.

Suppose N⊤y=0. Given any vertex w, connectedness gives a sequence 1=w0,w1,…,wt=w with consecutive vertices joined by edges, so y1=yw1=⋯=yw. Hence y=y11, where 1=(1,…,1)∈Rm. Conversely N⊤1=0, since all differences vanish. So nul(N⊤)=span(1), and since 1≠0, its dimension is 1.

The matrix N⊤ has m columns, so Theorem 3.5.7 gives rankN⊤=m−1. By Theorem 3.5.5, rankN=rankN⊤=m−1. This proves the proposition.

Corollary 3.7.5 (Solvable flow problems)

Let N∈Mm×k(R) be the incidence matrix of a connected network, and let s∈Rm. Then Nf=s has a solution if and only if s1+⋯+sm=0. In that case the solutions form f0+nul(N) for any one solution f0, and dim⁡nul(N)=k−m+1.

Proof. Let W={z∈Rm:z1+⋯+zm=0}. It is the solution set of the homogeneous system with the 1×m coefficient matrix (1⋯1), so it is a subspace by Theorem 3.1.2. That matrix has rank 1, since its column space is spanned by the nonzero column (1) and so equals R1. By Theorem 3.5.7, dim⁡W=m−1.

Each column of N has entries summing to 0, so it lies in W, and since W is a subspace, col(N)⊆W by Theorem 1.3.1. Also dim⁡col(N)=rankN=m−1=dim⁡W, by Definition 3.5.4 and Proposition 3.7.4. Hence col(N)=W by Theorem 1.6.8. By Theorem 3.1.1, Nf=s is consistent if and only if s∈col(N)=W, which is the first claim. The description of all solutions is Theorem 3.1.3, and dim⁡nul(N)=k−(m−1) by Theorem 3.5.7, since N has k columns.

The k−m+1 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 1→2, 2→3, 3→4, 4→1, and 1→3, carrying unknown flows f1,…,f5 (cars per minute) in that order. From outside, 40 cars per minute enter at intersection 1 and 20 at intersection 2, while 35 leave at intersection 3 and 25 at intersection 4.

Diagram: Traffic in a town center. Labels: 1, 2, 3, 4, f_1, f_2, f_3, f_4, f_5, 40, 20, 35, 25

Find all flows that satisfy conservation. If street 4→1 is closed for repairs and flows cannot be negative, what is the largest flow the diagonal street 1→3 may have to carry?

Solution. The network is connected, and s=(40,20,−35,−25) sums to 0, so by Corollary 3.7.5 a solution exists and the solutions have 5−4+1=2 free parameters. We row reduce [N∣s], with rows for vertices 1,2,3,4 and columns for f1,…,f5: (100−1140−11000200−110−1−3500−110−25)→R2→R2+R1(100−1140010−11600−110−1−3500−110−25) →R3→R3+R2(100−1140010−1160001−102500−110−25)→R4→R4+R3(100−1140010−1160001−1025000000). This is the RREF, with pivots in columns 1, 2, 3, so rankN=3=m−1, as Proposition 3.7.4 predicts. The free variables are f4=α and f5=β, and by Theorem 3.2.4, f=(40602500)+α(11110)+β(−1−1001),α,β∈R. The two null space vectors are the loops: α sends extra cars around 1→2→3→4→1, and β moves cars from the route 1→2→3 onto the diagonal 1→3.

With street 4→1 closed, α=f4=0 and f=(40−β,60−β,25,0,β). Nonnegativity requires β≥0, 40−β≥0 and 60−β≥0, that is, 0≤β≤40. So the diagonal may carry up to 40 cars per minute, which happens when street 1→2 is empty. Check, for f=(0,20,25,0,40): at vertex 1, out 0+40 minus in 0 is 40; at 2, out 20 minus in 0 is 20; at 3, out 25 minus in 20+40 is −35; at 4, out 0 minus in 25 is −25.

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. Nonnegativity and street capacities turn the problem into one about inequalities, which is the subject of linear programming. The matrix NN⊤ of this model, the graph Laplacian, returns in Chapter 24.

3.7.5. Lights out over F2

A puzzle has a 3×3 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 F2={0,1}.

  1. Encode “on” as 1 and “off” as 0. Toggling a light is adding 1 in F2, because 0+1=1 and 1+1=0. 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.
  2. Pressing a button twice toggles each affected light twice, which is 1+1=0: nothing. So a strategy is just the set of buttons pressed once, a vector x∈F29.

Number the cells (i,j), row i, column j, and list them row by row. Pressing button (i,j) adds to the pattern a fixed vector aij∈F29, with 1’s at (i,j) and its neighbors. Let A∈M9(F2) be the matrix with these columns. Starting from pattern b and pressing the buttons in x, the final pattern is b+Ax by Theorem 0.9.3, and we want it to be 0. Since −b=b in F29, the puzzle is the linear system Ax=bover F2,A=(110100000111010000011001000100110100010111010001011001000100110000010111000001011). By Theorem 3.1.1, pattern b is solvable exactly when b∈col(A). So “is every pattern solvable?” asks whether rankA=9.

Example (Every pattern of the 3 × 3 puzzle is solvable)

Show that rankA=9. Deduce that every one of the 29=512 starting patterns can be switched off, by exactly one set of presses.

Solution. We show that Ax=0 has only the trivial solution. Write the presses as a grid xij, and suppose Ax=0: the presses change no light. The equation for light (i,j) says that the presses at (i,j) and its neighbors add up to 0. We solve these equations row by row, remembering that −u=u in F2. Name the top row x11=p, x12=q, x13=r.

Lights of row 1 determine the presses of row 2. Light (1,1) gives x11+x12+x21=0, so x21=p+q. Likewise lights (1,2) and (1,3) give x22=x11+x12+x13=p+q+r,x23=x12+x13=q+r. Lights of row 2 determine the presses of row 3. Light (2,1) gives x31=x11+x21+x22=p+(p+q)+(p+q+r)=p+r, using 3p=p and 2q=0. Light (2,2) gives x32=x12+x21+x22+x23=q+(p+q)+(p+q+r)+(q+r)=0. Light (2,3) gives x33=x13+x22+x23=r+(p+q+r)+(q+r)=p+r.

Lights of row 3 give three conditions on p,q,r. (3,1):x21+x31+x32=(p+q)+(p+r)+0=q+r=0,(3,2):x22+x31+x32+x33=(p+q+r)+(p+r)+0+(p+r)=p+q+r=0,(3,3):x23+x32+x33=(q+r)+0+(p+r)=p+q=0. The first and third give r=q and p=q, and then the second gives 3q=q=0. So p=q=r=0, and the formulas above make every xij=0.

Hence the null space of A is {0}, and rankA=9−0=9 by Theorem 3.5.7. So col(A) is a subspace of F29 of dimension 9, and col(A)=F29 by Theorem 1.6.8. Every pattern b lies in col(A), so every pattern is solvable. The solution is unique by Corollary 3.1.4, since Ax=0 has only the trivial solution. In particular exactly one of the 512 press sets solves each of the 512 patterns.

The same chase finds an actual solution: the constants from b simply ride along.

Example (Switching off the center)

Only the center light is on. Which buttons should be pressed?

Solution. Now b has a 1 at (2,2) only, so the equation for light (2,2) has right-hand side 1 and all others 0. Rows 1 and 2 of lights give, as before, x21=p+q, x22=p+q+r, x23=q+r, x31=p+r, x33=p+r, and now x32=1+x12+x21+x22+x23=1. The lights of row 3 give (p+q)+(p+r)+1=0, (p+q+r)+(p+r)+1+(p+r)=0 and (q+r)+1+(p+r)=0, that is, q+r=1,p+q+r=1,p+q=1. Adding the first two gives p=0; then q=1 and r=0. Substituting, x21=x22=x23=1, x31=x33=0, and x32=1. So we press the center and its four neighbors, a plus sign:

Diagram

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 (1,1), is toggled by presses at (1,2) and (2,1): even, so it stays off. An edge light, say (1,2), is toggled by presses at (1,2) and (2,2): 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 0, presses x produce the pattern Ax, so we need Ax=b with b the center pattern, which is exactly the system just solved. Over F2, turning a pattern on and turning it off are the same problem.

Remark. Larger boards behave differently. A computation over F2, by the same elimination, gives rankA=12 for the 4×4 board and rankA=23 for the 5×5 board. On the 5×5 board, col(A) has dimension 23, so it contains 223 patterns (coordinates in a basis match its elements with F223), and only one pattern in four can be switched off.

What the model leaves out. Nothing, which is rare. The puzzle is linear over F2 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.

3.7.6. Exercises

A. Check your understanding

Exercise (A1)
  • (a) State the polynomial interpolation theorem, including its hypotheses.
  • (b) True or false: there is a polynomial p∈R[x]≤1 with p(1)=2 and p(1)=3. 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 1? Dimension 2?
  • (d) Why is lights out modeled over F2 and not over R?
  • (e) A connected network has 6 vertices and 9 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 x0,…,xn∈F and any y0,…,yn∈F, there is exactly one p∈F[x]≤n with p(xi)=yi for all i.
  • (b) False: p(1) is one number, and 2≠3. The theorem needs distinct x-values, and here x0=x1=1.
  • (c) Dimension 1: all balancings are multiples of one vector, so there is one balanced equation up to scaling (provided a positive multiple exists). Dimension 2 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 1 with 1+1=0, which is arithmetic in F2. Over R, pressing a button twice would count as 2, not 0.
  • (e) By Proposition 3.7.4 the rank is 6−1=5. By Corollary 3.7.5 a consistent problem has 9−6+1=4 free parameters.

B. Practice

Exercise (B1: Interpolating four points)

Find the polynomial p∈Q[x]≤3 with p(0)=−1, p(1)=1, p(2)=3, and p(3)=11. Justify that there is only one.

Solution. The x-values 0,1,2,3 are distinct, so there is exactly one such p=c0+c1x+c2x2+c3x3, by Theorem 3.7.3. Its coefficients solve (1000−111111124831392711)→R4→R4−R1R2→R2−R1, R3→R3−R1(1000−101112024840392712)→R4→R4−3R2R3→R3−2R2(1000−10111200260006246) and then R4−3R3 turns the last row into (0,0,0,6∣6). Back substitution: c3=1; 2c2+6=0, so c2=−3; c1−3+1=2, so c1=4; c0=−1. Hence p=−1+4x−3x2+x3. Check: p(0)=−1, p(1)=−1+4−3+1=1, p(2)=−1+8−12+8=3, p(3)=−1+12−27+27=11.

Exercise (B2: Balancing a redox reaction)

Potassium permanganate reacts with hydrochloric acid: aKMnO4+bHCl⟶cKCl+dMnCl2+eH2O+fCl2. 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: K: a=c,Mn: a=d,O: 4a=e,H: b=2e,Cl: b=c+2d+2f. In the order (a,b,c,d,e,f), the coefficient matrix has rows (1,0,−1,0,0,0), (1,0,0,−1,0,0), (4,0,0,0,−1,0), (0,1,0,0,−2,0), and (0,1,−1,−2,0,−2). 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 c=a, d=a, e=4a. The H equation gives b=2e=8a. The Cl equation gives 2f=b−c−2d=8a−a−2a=5a, so a=25f. Taking f=t as the free variable, the RREF of the coefficient matrix is (10000−2501000−16500100−2500010−2500001−85), and the solutions are (a,b,c,d,e,f)=t(25,165,25,25,85,1), t∈Q. The rank is 5 and the nullity 6−5=1, so the balancing is unique up to scaling. All entries are integers exactly when t is a multiple of 5, and t=5 gives 2KMnO4+16HCl⟶2KCl+2MnCl2+8H2O+5Cl2. Check: K 2=2; Mn 2=2; O 8=8; H 16=16; Cl 16=2+4+10.

Exercise (B3: A ring road)

Four intersections lie on a ring of one-way streets 1→2, 2→3, 3→4, 4→1, with flows f1,f2,f3,f4 in that order. From outside, 30 cars per minute enter at intersection 1 and 10 at intersection 3, while 15 leave at intersection 2 and 25 at intersection 4.

  • (a) Write down the incidence matrix N and the supply vector s, and explain without computation why the system Nf=s is consistent.
  • (b) Find all solutions.
  • (c) If all flows must be nonnegative, what is the smallest possible flow on each street?

Solution.

  • (a) With rows for the vertices and columns for the edges, N=(100−1−11000−11000−11),s=(30−1510−25). The ring is connected, and 30−15+10−25=0, so the system is consistent by Corollary 3.7.5.
  • (b) Row reducing [N∣s]: R2+R1 gives (0,1,0,−1∣15); then R3+R2 gives (0,0,1,−1∣25); then R4+R3 gives the zero row. The pivots are in columns 1, 2, 3, and f4=t is free, so f=(30+t,15+t,25+t,t),t∈R. There is 4−4+1=1 parameter, the flow around the ring. Check at t=0: vertex 1, 30−0=30; vertex 2, 15−30=−15; vertex 3, 25−15=10; vertex 4, 0−25=−25.
  • (c) All flows are nonnegative exactly when t≥0, since then 30+t,15+t,25+t≥0 too. Each flow increases with t, so all are smallest at t=0: f=(30,15,25,0). No car needs to use street 4→1.

C. Going deeper

Exercise (C1: The 2 × 2 puzzle)

Consider lights out on a 2×2 grid, where pressing a light toggles it and its two horizontal and vertical neighbors. Number the cells 1=(1,1), 2=(1,2), 3=(2,1), 4=(2,2).

  • (a) Write down the matrix A∈M4(F2) of the puzzle.
  • (b) Show that A2=I.
  • (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 1 on.

Solution.

  • (a) Button j toggles every light except the one diagonally opposite. So A=(1110110110110111).
  • (b) Let J be the 4×4 all-ones matrix and Q the permutation matrix exchanging 1↔4 and 2↔3, which has 1’s on the anti-diagonal. Then A=J−Q=J+Q over F2. Every entry of J2 is 1+1+1+1=0, so J2=O. Each row and each column of Q has a single 1, so JQ=J and QJ=J. And Q=Pσ for σ=(1 4)(2 3), with σ∘σ=id, so Q2=Pid=I by Lemma 3.4.7 (a). By Theorem 0.9.4, A2=J2+JQ+QJ+Q2=O+J+J+I=I, because J+J=2J=O over F2.
  • (c) By (b), A is invertible with A−1=A. By Theorem 0.9.7 (7), Ax=b has exactly one solution x=Ab for every b∈F24. For b=e1, x=Ae1=(1,1,1,0): press lights 1,2,3. 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 p=c0+c1x+c2x2+c3x3∈F[x]≤3, define its (formal) derivative p′=c1+2c2x+3c3x2.

  • (a) Prove that for every field F and all a,b,c,d∈F there is exactly one p∈F[x]≤3 with p(0)=a,p′(0)=b,p(1)=c,p′(1)=d.
  • (b) Find this p over Q for (a,b,c,d)=(0,1,1,0).

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 c0,…,c3: p(0)=c0, p′(0)=c1, p(1)=c0+c1+c2+c3, p′(1)=c1+2c2+3c3. Row reducing the augmented matrix, using only additions of multiples of rows, (1000a0100b1111c0123d)→R4→R4−R2R3→R3−R1−R2(1000a0100b0011c−a−b0023d−b)→R4→R4−2R3(1000a0100b0011c−a−b00012a+b−2c+d). Here 3−2=1 holds in every field. The coefficient matrix is now upper triangular with every diagonal entry equal to 1, so it is invertible by Lemma 3.6.2, and back substitution gives the unique solution without any division: c3=2a+b−2c+d,c2=(c−a−b)−c3=−3a−2b+3c−d,c1=b,c0=a. Row operations preserve the solution set (Theorem 3.2.2), so the original system also has exactly this one solution, for every field F.
  • (b) With (a,b,c,d)=(0,1,1,0): c3=0+1−2+0=−1, c2=0−2+3−0=1, c1=1, c0=0. So p=x+x2−x3. Check: p(0)=0; p′=1+2x−3x2, so p′(0)=1; p(1)=1+1−1=1; p′(1)=1+2−3=0.
Exercise (C3: Networks in several pieces)

Let N∈Mm×k(R) be the incidence matrix of a network with m vertices. Say that vertices v and w 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 c be their number.
  • (b) Prove that rankN=m−c.

Solution.

  • (a) Reflexive: by the sequence of length zero. Symmetric: reversing a sequence from v to w gives one from w to v, and consecutive vertices still share an edge. Transitive: following a sequence from u to v by one from v to w gives a sequence from u to w. So “linked” is an equivalence relation (Definition 0.5.2).
  • (b) Let C1,…,Cc be the components, and let 1Cr∈Rm have entry 1 at the vertices of Cr and 0 elsewhere. As in the proof of Proposition 3.7.4, N⊤y=0 if and only if yu=yw for every edge joining u and w. Following sequences of edges, this holds if and only if y is constant on each component, that is, y=∑rλr1Cr with λr the common value on Cr. (Conversely each 1Cr is in the null space, since both ends of an edge lie in the same component.) So (1C1,…,1Cc) spans nul(N⊤). It is independent: if ∑rλr1Cr=0, then reading the entry at any vertex of Cr, where only the r-th vector is nonzero because the components are disjoint (Theorem 0.5.2), gives λr=0. Hence dim⁡nul(N⊤)=c. Since N⊤ has m columns, Theorem 3.5.7 gives rankN⊤=m−c, and Theorem 3.5.5 gives rankN=m−c, as claimed.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.