Ran Wei/ Linear Algebra
中文
Linear Algebra · Vectors and linear systems

Module 2Linear systems and elimination

Reduce a system row by row, read its pivots and free variables, and tell when constraints conflict.

75 minYou need Module 1 and simultaneous equations

In this module you will

  • Translate simultaneous equations into an augmented matrix
  • Perform reversible row operations
  • Classify and describe all solutions of a system
1

Equations as rows

Each row stores the coefficients of one equation and the value on its right. The augmented matrix records both. Swap two equations, multiply an equation by a nonzero scalar, or add a multiple of another equation to it. Each operation is reversible, so it preserves the solution set.

Elimination creates leading entries, called pivots, with zeros below them. In reduced row echelon form every pivot is 11 and is the only nonzero entry in its column. Pivot columns move right as you go down the nonzero rows.

Example 2.1Eliminate a variable✓ Checked

For x+2y=5x+2y=5 and 3x+5y=13,3x+5y=13\mathclose{\text{,}} subtract three times the first equation from the second. The new second equation is −y=−2,-y=-2\mathclose{\text{,}} so y=2y=2 and the first gives x=1.x=1\mathclose{\text{.}}

2

Read the whole solution set

If a row says 0=1,0=1\mathclose{\text{,}} the system is inconsistent. Otherwise, pick arbitrary values for variables whose coefficient columns have no pivot. These free variables determine the remaining variables through the pivot equations.

Example 2.2An entire line of solutions✓ Checked

Take x+y+z=4x+y+z=4 and x−y+z=2.x-y+z=2\mathclose{\text{.}} Subtract the equations to get 2y=2.2y=2\mathclose{\text{.}} The remaining relation is x+z=3.x+z=3\mathclose{\text{.}} Let z=tz=t and obtain (x,y,z)=(3−t,1,t)(x,y,z)=(3-t,1,t) for every real t.t\mathclose{\text{.}} This line has a starting point and a direction, a description you will use again when studying the null space.

Watch out

A row of zeros makes no additional demand. A row with zero coefficients and a nonzero right side is a contradiction. Keep the right-hand column attached while reducing.

3

Exact row reduction in Python

Compute itA consistent system and an inconsistent one

SymPy returns the reduced matrix and the zero-based pivot column indices. An augmented column with a pivot exposes an inconsistency.

Python
from sympy import Matrix

for rows in ([[1, 1, 2], [2, 2, 4]], [[1, 1, 2], [2, 2, 5]]):
    reduced, pivots = Matrix(rows).rref()
    print(reduced.tolist(), pivots)
Output
[[1, 1, 2], [0, 0, 0]] (0,)
[[1, 1, 0], [0, 0, 1]] (0, 2)
4

Exercises

Exercise 2.1★Solve two equations

Solve x−y=2x-y=2 and x+y=6.x+y=6\mathclose{\text{.}}

Show solution✓ Checked

Add the equations to get 2x=8.2x=8\mathclose{\text{.}} Then x=4x=4 and y=2.y=2\mathclose{\text{.}}

Exercise 2.2★★Redundant or inconsistent

For which kk is x+2y=3,x+2y=3\mathclose{\text{,}} 2x+4y=k2x+4y=k consistent? Find all solutions then.

Show solution✓ Checked

Subtract twice the first row from the second to get 0=k−6.0=k-6\mathclose{\text{.}} When k=6,k=6\mathclose{\text{,}} put y=ty=t and set x=3−2t.x=3-2t\mathclose{\text{.}}

Exercise 2.3★★★Why row operations work

Explain why replacing R2R_2 by R2+cR1R_2+cR_1 cannot change the solution set.

Show solution✓ Checked

A solution of the original equations satisfies their linear combination. Conversely, a solution of the new equations satisfies the old second equation after subtracting cR1.cR_1\mathclose{\text{.}} For example, adding the first row to the second and subtracting it again restores both the coefficient and the right-hand side.

5

Check yourself

1
What does the row [0    0∣5][0\;\;0\mid5] tell you?
2
How many free variables does a consistent system with three variables and two coefficient pivots have?
3
Which operation always preserves the solutions?
Finished this module?