A system asks which inputs satisfy all constraints

A linear equation in unknowns x1,…,xnx_1,\ldots,x_n has the form

a1x1+⋯+anxn=b,a_1x_1+\cdots+a_nx_n=b,

with known coefficients and right-hand side. Unknowns occur only to the first power, not multiplied together, in denominators, or inside nonlinear functions. Thus 2x−y=32x-y=3 is linear, while xy=3xy=3 and x2+y=1x^2+y=1 are not. A zero coefficient may make an unknown absent from an equation.

A system requires the same unknown values to satisfy several equations simultaneously. The matrix form Ax=bA\mathbf x=\mathbf b has two complementary readings: each row is a constraint, while the columns are vectors whose combination must produce b\mathbf b.

ExampleIntersecting, coincident, and parallel lines

The equation x+y=2x+y=2 describes a line. Adding x−y=0x-y=0 gives their unique intersection (1,1)(1,1).

Replacing the second equation by 2x+2y=42x+2y=4 adds no constraint; every (t,2−t)(t,2-t) is a solution. Replacing it by 2x+2y=52x+2y=5 produces a contradiction and no solution.

Counting equations and unknowns therefore gives only a first indication. Independence of constraints and compatibility of right-hand sides determine the answer.

Elimination reorganizes information

Elimination does not begin by guessing every unknown. It reorganizes constraints until dependent variables, free choices, or contradictions become visible. The expressions change while the solution set must remain fixed.

We first derive a system from conservation and follow its elimination in full. Then we extract the general algorithm and explain how LU records the work for reuse.

Conservation does not determine every traffic flow

Consider junctions A,B,C,DA,B,C,D with the following internal roads. Each xix_i measures vehicles per common unit of time along its arrow.

RoadDirection
x1x_1D→BD\to B
x2x_2A→BA\to B
x3x_3C→AC\to A
x4x_4C→DC\to D
x5x_5B→CB\to C

Assume no accumulation at a junction during the measurement period. External measurements give net outward flow 4545 at BB, net inward flow 4545 at CC, net inward flow 1010 at AA, and net outward flow 1010 at DD. These internal roads and external balances define the network we will model [1][1] X. Yang, “ENG1005 Week 2: Traffic Flow, Personal Workshop Solutions,” 2024. Personal solutions to Monash ENG1005 workshop problems; source snapshot 77ebe58de2fea53d62533d6dd23caa16108ed109. Repository access may be restricted.. https://github.com/Eryc123Y/ENG1005-2024S2/blob/77ebe58de2fea53d62533d6dd23caa16108ed109/Source%20Code/W2.tex.

Writing the balances in the order B,C,A,DB,C,A,D gives

{x1+x2−x5=45,x3+x4−x5=45,−x2+x3=−10,−x1+x4=10.\begin{cases} x_1+x_2-x_5=45,\\ x_3+x_4-x_5=45,\\ -x_2+x_3=-10,\\ -x_1+x_4=10. \end{cases}

Each equation is valid, but four equations do not necessarily provide four independent constraints.

Why row operations preserve solutions

Collect coefficients and right-hand sides in an augmented matrix:

[A∣b]=[1100−1450011−1450−1100−10−1001010].[A\mid\mathbf b]= \left[\begin{array}{rrrrr|r} 1&1&0&0&-1&45\\ 0&0&1&1&-1&45\\ 0&-1&1&0&0&-10\\ -1&0&0&1&0&10 \end{array}\right].

Elementary row operations swap two rows, multiply a row by a nonzero scalar, or add a multiple of another row to it. Each operation has an inverse, so the solution set is unchanged.

Subtracting a row from itself has no inverse: it deletes a constraint. For example, replacing x=1x=1 by 0=00=0 changes a unique solution into an unrestricted variable.

Perform, in order,

R4←R4+R1,R2↔R3,R2←−R2.R_4\leftarrow R_4+R_1,\qquad R_2\leftrightarrow R_3,\qquad R_2\leftarrow -R_2.

This yields

[1100−14501−100100011−1450101−155].\left[\begin{array}{rrrrr|r} 1&1&0&0&-1&45\\ 0&1&-1&0&0&10\\ 0&0&1&1&-1&45\\ 0&1&0&1&-1&55 \end{array}\right].

Next, R4←R4−R2R_4\leftarrow R_4-R_2 makes row four equal to row three. Now R4←R4−R3R_4\leftarrow R_4-R_3 legitimately produces a zero row:

[1100−14501−100100011−145000000].\left[\begin{array}{rrrrr|r} 1&1&0&0&-1&45\\ 0&1&-1&0&0&10\\ 0&0&1&1&-1&45\\ 0&0&0&0&0&0 \end{array}\right].

This is row echelon form: the first nonzero entry in each nonzero row is its pivot, pivot positions move right down the rows, and zero rows are at the bottom. Making pivots one and clearing entries above them gives reduced row echelon form.

Pivots, free variables, and the full solution set

Further elimination yields

[100−10−100101−1550011−145000000].\left[\begin{array}{rrrrr|r} 1&0&0&-1&0&-10\\ 0&1&0&1&-1&55\\ 0&0&1&1&-1&45\\ 0&0&0&0&0&0 \end{array}\right].

Columns one through three contain pivots. Set the free variables s=x4,t=x5s=x_4,t=x_5:

x=(s−1055−s+t45−s+tst)=(−10554500)⏟xp+s(1−1−110)⏟v1+t(01101)⏟v2.\mathbf x= \begin{pmatrix}s-10\\55-s+t\\45-s+t\\s\\t\end{pmatrix} =\underbrace{\begin{pmatrix}-10\\55\\45\\0\\0\end{pmatrix}}_{\mathbf x_p} +s\underbrace{\begin{pmatrix}1\\-1\\-1\\1\\0\end{pmatrix}}_{\mathbf v_1} +t\underbrace{\begin{pmatrix}0\\1\\1\\0\\1\end{pmatrix}}_{\mathbf v_2}.

The particular solution xp\mathbf x_p solves the equations, but need not satisfy physical nonnegativity. The directions obey Av1=Av2=0A\mathbf v_1=A\mathbf v_2=\mathbf0: varying internal flows along either direction leaves the external balances unchanged.

Physical one-way traffic requires every component to be nonnegative:

s≥10,t≥0,s≤45+t.s\ge10,\qquad t\ge0,\qquad s\le45+t.

For example, s=20,t=0s=20,t=0 gives the feasible flow (10,35,25,20,0)T(10,35,25,20,0)^{\mathsf T}. The equations describe a translated plane; inequalities select its feasible region.

Rank summarizes the possibilities

Rank is the dimension of the column space and also the number of pivots in echelon form. We use pivot counting here; vector spaces and bases explains its connection to dimension.

For a real system with mm equations and nn unknowns:

Elimination resultSolutions
A row 0=c0=c with c≠0c\ne0None
No contradiction and a pivot for every unknownExactly one
No contradiction and at least one free variableInfinitely many

Thus consistency means rank⁡(A)=rank⁡([A∣b])\operatorname{rank}(A)=\operatorname{rank}([A\mid\mathbf b]). A consistent system has n−rank⁡(A)n-\operatorname{rank}(A) free variables. Our matrix has rank 33, leaving two.

Why is one balance redundant? The original coefficient rows satisfy R1−R2+R3+R4=0R_1-R_2+R_3+R_4=0, and the right-hand sides satisfy 45−45−10+10=045-45-10+10=0. Summing junction balances cancels every internal inflow against an internal outflow, leaving the external balance of the entire region. Matrix as Graph expresses this through the incidence matrix.

The general elimination procedure

Suppose the augmented matrix has mm rows and nn coefficient columns. Let rr be the next pivot row, initially one. Process coefficient columns j=1,…,nj=1,\ldots,n:

  1. Search column jj in rows rr and below for a nonzero entry. If none exists, skip to the next column.
  2. If one is found in row pp, exchange rows p,rp,r, obtaining a nonzero pivot arja_{rj}.
  3. For each i>ri>r, subtract aij/arja_{ij}/a_{rj} times the pivot row from row ii. Include the right-hand side in every operation.
  4. Increase rr by one. Stop if no rows remain.

This produces echelon form. For reduced echelon form, work upward from the last pivot, normalize each pivot to one, and clear entries above it. Back substitution alone usually suffices to solve an invertible triangular system; reducing the entire matrix to identity is unnecessary.

An absent pivot in the current column does not mean inconsistency. It means that position supplies no new constraint. A zero coefficient column, for example, leaves its variable unconstrained. Inconsistency requires a contradictory augmented row.

Classifying a parameterized system

Consider

{x+y=2,2x+λy=μ.\begin{cases} x+y=2,\\ 2x+\lambda y=\mu. \end{cases}

Subtract twice the first equation from the second:

(λ−2)y=μ−4.(\lambda-2)y=\mu-4.

For λ≠2\lambda\ne2, the unique solution is

y=μ−4λ−2,x=2−y.y=\frac{\mu-4}{\lambda-2},\qquad x=2-y.

For λ=2,μ=4\lambda=2,\mu=4, the second equation becomes an identity, giving solutions (2−t,t)(2-t,t). For λ=2,μ≠4\lambda=2,\mu\ne4, it becomes a contradiction.

The cases must be separated before dividing by λ−2\lambda-2. Dividing immediately would discard every inconsistent or nonunique case.

Why exactly two solutions are impossible

If distinct vectors x1,x2\mathbf x_1,\mathbf x_2 solve the same real linear system, then for every real tt,

A(x1+t(x2−x1))=b+t(b−b)=b.A\bigl(\mathbf x_1+t(\mathbf x_2-\mathbf x_1)\bigr) =\mathbf b+t(\mathbf b-\mathbf b)=\mathbf b.

Different tt give different solutions. A real linear system therefore has zero, one, or infinitely many solutions. General nonlinear equations do not have this restriction.

Measurements must contribute independent information

Measuring x5=tx_5=t fixes one parameter but leaves ss free. Identifying a general flow by additional linear measurements requires eliminating both free directions.

Measuring x4x_4 and x5x_5 works. Measuring x1x_1 and x4x_4 does not: the original equations already impose x4−x1=10x_4-x_1=10, so both readings determine only ss.

More generally, write new measurements as Mx=dM\mathbf x=\mathbf d. Substitution into the parameterization shows that Mv1,Mv2M\mathbf v_1,M\mathbf v_2 must be independent to determine both parameters. Counting measurements alone is insufficient. This describes identification by linear equalities for general states; nonnegativity at a particular boundary can further restrict feasibility.

LU saves elimination for new right-hand sides

The traffic matrix is rectangular and rank deficient. To develop ordinary LU for an invertible system, return to the interpolation matrix:

V=(111421931),y=(675).V=\begin{pmatrix}1&1&1\\4&2&1\\9&3&1\end{pmatrix},\qquad \mathbf y=\begin{pmatrix}6\\7\\5\end{pmatrix}.

Perform

R2←R2−4R1,R3←R3−9R1,R3←R3−3R2.R_2\leftarrow R_2-4R_1,\qquad R_3\leftarrow R_3-9R_1,\qquad R_3\leftarrow R_3-3R_2.

The resulting upper triangular matrix is

U=(1110−2−3001).U=\begin{pmatrix}1&1&1\\0&-2&-3\\0&0&1\end{pmatrix}.

Record the elimination multipliers below the diagonal:

L=(100410931).L=\begin{pmatrix}1&0&0\\4&1&0\\9&3&1\end{pmatrix}.

Then V=LUV=LU. Check directly: row two of LULU is 4U1+U24U_1+U_2; row three is 9U1+3U2+U39U_1+3U_2+U_3, recovering the original rows. In general, a product of elementary elimination matrices gives EV=UEV=U. In standard elimination without row swaps, the inverse operations form L=E−1L=E^{-1}.

Solve two triangular systems:

Lz=y,Uc=z.L\mathbf z=\mathbf y,\qquad U\mathbf c=\mathbf z.

Forward substitution gives

z1=6,z2=7−4z1=−17,z3=5−9z1−3z2=2.z_1=6,\qquad z_2=7-4z_1=-17,\qquad z_3=5-9z_1-3z_2=2.

Backward substitution gives

γ=2,−2β−3γ=−17,α+β+γ=6.\gamma=2,\qquad -2\beta-3\gamma=-17,\qquad \alpha+\beta+\gamma=6.

Hence α=−3/2,β=11/2,γ=2\alpha=-3/2,\beta=11/2,\gamma=2. These are exactly the required interpolation coefficients [2][2] X. Yang, “ENG1005 Week 3: Interpolation and Fitting, Personal Workshop Solutions,” 2024. Personal solutions to Monash ENG1005 workshop problems; source snapshot 77ebe58de2fea53d62533d6dd23caa16108ed109. Repository access may be restricted.. https://github.com/Eryc123Y/ENG1005-2024S2/blob/77ebe58de2fea53d62533d6dd23caa16108ed109/Source%20Code/W3.tex.

For new data y=(1,4,9)T\mathbf y=(1,4,9)^{\mathsf T}, reuse the same factors. Now z=(1,0,0)T\mathbf z=(1,0,0)^{\mathsf T} and the coefficients are (1,0,0)T(1,0,0)^{\mathsf T}, giving p(t)=t2p(t)=t^2. Factoring a dense square matrix typically costs O(n3)O(n^3) arithmetic operations; the two triangular solves for each new right-hand side cost O(n2)O(n^2).

When rows must be exchanged

Invertibility does not make every current pivot nonzero. For example,

H=(0111)H=\begin{pmatrix}0&1\\1&1\end{pmatrix}

is invertible, but its first entry cannot be used as a divisor. Swap rows, recording the swap in a permutation matrix PP, to obtain PH=LUPH=LU. Apply the same permutation to the right-hand side:

Lz=Pb,Ux=z.L\mathbf z=P\mathbf b,\qquad U\mathbf x=\mathbf z.

Floating-point computation also concerns error amplification by small pivots. Partial pivoting chooses an entry of largest absolute value among the unprocessed rows in the current column. Conditioning and error analysis belong to numerical linear algebra; here the purpose is to understand the factorization.

A complete row-swap example

Solve

(0213)(xy)=(47).\begin{pmatrix}0&2\\1&3\end{pmatrix} \begin{pmatrix}x\\y\end{pmatrix} =\begin{pmatrix}4\\7\end{pmatrix}.

The current first pivot is zero, so exchange rows:

P=(0110),PA=(1302).P=\begin{pmatrix}0&1\\1&0\end{pmatrix},\qquad PA=\begin{pmatrix}1&3\\0&2\end{pmatrix}.

Here L=I2L=I_2 and U=PAU=PA. The right-hand side becomes Pb=(7,4)TP\mathbf b=(7,4)^{\mathsf T}. Back substitution gives 2y=42y=4 and x+3y=7x+3y=7, so (x,y)=(1,2)(x,y)=(1,2).

Swapping only coefficient rows while retaining the original right-hand side would solve a different system. A permutation records a reordering of complete equations.

General triangular substitution

For a lower triangular LL with unit diagonal, forward substitution is

zi=bi−∑j=1i−1lijzj,i=1,…,n.z_i=b_i-\sum_{j=1}^{i-1}l_{ij}z_j,\qquad i=1,\ldots,n.

Only previously computed values occur on the right. For an upper triangular UU with nonzero diagonal entries, backward substitution is

xi=zi−∑j=i+1nuijxjuii,i=n,n−1,…,1.x_i=\frac{z_i-\sum_{j=i+1}^n u_{ij}x_j}{u_{ii}},\qquad i=n,n-1,\ldots,1.

These formulas assume A=LUA=LU. For PA=LUPA=LU, replace the first formula’s right-hand side by the corresponding entries of PbP\mathbf b.

Square elimination without swaps requires nonzero pivots at each stage to continue in this form. If the resulting UU has nonzero diagonal entries, both triangular systems have unique solutions for every right-hand side. Thus L,UL,U, and their product AA are invertible.

Exercises

ExerciseUse new measurements

In the traffic model, x2=30,x5=5x_2=30,x_5=5. Find all flows and check nonnegativity.

Solution

t=5t=5 and 55−s+t=3055-s+t=30 give s=30s=30. Thus x=(20,30,20,30,5)T\mathbf x=(20,30,20,30,5)^{\mathsf T}, with all components nonnegative.

ExerciseLocate a contradiction

Change only the first right-hand side of the original traffic system to 4646. Is the system consistent?

Solution

No. The coefficient relation R1−R2+R3+R4=0R_1-R_2+R_3+R_4=0 still holds, but its right-hand side becomes 46−45−10+10=146-45-10+10=1. Elimination produces 0=10=1: external flow no longer balances.

ExerciseClassify before dividing

For x+y=1x+y=1 and 2x+ay=b2x+ay=b, give the conditions for a unique solution, no solution, or infinitely many solutions.

Solution

Elimination gives (a−2)y=b−2(a-2)y=b-2. If a≠2a\ne2, the unique solution has y=(b−2)/(a−2),x=1−yy=(b-2)/(a-2),x=1-y. If a=2,b=2a=2,b=2, there are infinitely many solutions; if a=2,b≠2a=2,b\ne2, none.

ExerciseReusing triangular factors

Use the chapter’s interpolation factorization V=LUV=LU with right-hand side (2,3,4)T(2,3,4)^{\mathsf T}. Find the coefficients.

Solution

Forward substitution gives z=(2,−5,1)T\mathbf z=(2,-5,1)^{\mathsf T}. Back substitution gives (α,β,γ)=(0,1,1)(\alpha,\beta,\gamma)=(0,1,1), representing p(t)=t+1p(t)=t+1. Check its values at all three sample points.

References

  1. [1] X. Yang, “ENG1005 Week 2: Traffic Flow, Personal Workshop Solutions,” 2024. Personal solutions to Monash ENG1005 workshop problems; source snapshot 77ebe58de2fea53d62533d6dd23caa16108ed109. Repository access may be restricted.. https://github.com/Eryc123Y/ENG1005-2024S2/blob/77ebe58de2fea53d62533d6dd23caa16108ed109/Source%20Code/W2.tex ↩
  2. [2] X. Yang, “ENG1005 Week 3: Interpolation and Fitting, Personal Workshop Solutions,” 2024. Personal solutions to Monash ENG1005 workshop problems; source snapshot 77ebe58de2fea53d62533d6dd23caa16108ed109. Repository access may be restricted.. https://github.com/Eryc123Y/ENG1005-2024S2/blob/77ebe58de2fea53d62533d6dd23caa16108ed109/Source%20Code/W3.tex ↩