System of Linear Equations, Row Echelon Form

back to Fan's Intro Math for Econ, Matlab Examples, or MEconTools Repositories
See also: System of Linear Equations
See also: Solving for Two Equations and Two Unknowns
See also: System of Linear Equations, Row Echelon Form

Two Equations and Two Unknowns

This is a general system of equations with 2 equations and 2 unknowns
this is the augmented matrix:
We want to solve for the unknown and . In matlab, we just use the linsolve function, and in practice we do not solve these by hand. But how is linsolve solving this?

Elementary Row Operations

There are three things we can do to rows of the augmented matrix that do not change the solution to the linear system, they are called elementary row operations, and are very intuitive:
  1. Switch two rows in the matrix: we can move a row up or down, the system is still the same
  2. Replace an existing row by the sum of the row and a multiple of another row:
  3. Multiply all column values of a row by the same non-zero constant:
Using rule 3, we can multiple a row from an augmented matrix by Z
Using rule 2, we can add up Z times a row from an augmented matrix and Y times another row:

Row Echelon Form

After using elementary row operations to create as many zeros as possible in the lower left side of the matrix, we end up with a matrix that is equivalent to the original matrix that is in the Row Echelon Form, more formally:

Row Echelon Form with 2 Equations and 2 Unknowns

Let's study our system with just 2 equations and 2 unkowns. We can arrive at the row-echelon form in two steps:
Starting with: :
  1. Multiply second row by :
  2. Subtract the first row from the second row:
We now have the row-echelon form, because we have as many zeros as possible in the lower left side

Reduced Row Echelon Form

We can simplify the matrix more and get to the reduced row echelon form.
When we are solving a system of N equations with N unknowns, the reduced row echelon form gives the solution for the unknowns. With 2 dimensions, the solution is the intersection of 2 lines, and with 3 dimension, the solution is the point intersection of 3 surfaces.

Reduced Row Echelon Form with 2 Equations and 2 Unknowns

Starting with the row echelon form: :
  1. Divide second row by : , which simplifies to:
  2. Subtract from first row b times second row :
  3. Divide the first row by a:
Now we have the reduced row echelon form, which tells us that:
and