Linear Algebra & Applications

2201NSC

Simultaneous Equations

Linear Equations

A (real) linear equation in $n$ unknowns is an equation of the form

$ a_1x_1 + a_2x_2 + \cdots + a_nx_n = b $

where

  • $a_1, a_2, \ldots, a_n$ and $b$ are (real) coefficients; and
  • $x_1, x_2, \ldots, x_n$ are (real) variables.

Examples:

  • $ 2 x_1 + 3 x_2 - x_3 - 5x_4 = 0 $
  • $2 r + 3 s = 4$


Systems of Linear Simultaneous Equations

Systems of Linear Equations

A system of linear equations is a collection of $m$ simultaneous equations in $n$ unknowns, of the form

\begin{align*} a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n &= b_1 \\ a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n &= b_2 \\ &\vdots \\ a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n &= b_m \end{align*}



Examples of Systems of Linear Simultaneous Equations

  • $\begin{aligned} 2x + 3y &= 1 \\ 3x - y &= 2 \end{aligned}$
  • $\begin{aligned} ax + by &= r \\ cx + dy &= s \end{aligned}$

  • $ \begin{aligned} x_1 + x_2 + x_3 &= 3 \\ x_1 + x_2 - x_3 &= 1 \\ x_1 - x_2 + x_3 &= 1 \end{aligned}$


Application example - Balancing a chemical equation

Photosynthesis converts water and carbon dioxide into oxygen and glucose:

$ x_1\text{CO}_2 + x_2\text{H}_2\text{O}\ \rightarrow\ x_3\text{O}_2 + x_4\text{C}_6\text{H}_{12}\text{O}_6 $

What are the coefficients $x_i$? Since matter is neither created nor destroyed, we must have equal amounts of each element on either side.

C H O
LHS \(x_1\) \(2x_2\) \(2x_1+x_2\)
RHS \(6x_4\) \(12x_4\) \(2x_3+6x_4\)
\[ \begin{aligned} x_1 &= 6x_4 \\ 2x_2 &= 12x_4 \\ 2x_1 + x_2 &= 2x_3 + 6x_4 \end{aligned} \] $\rightarrow$ \[ \begin{aligned} x_1 - 6x_4 &= 0 \\ 2x_2 - 12x_4 &= 0 \\ 2x_1 + x_2 - 2x_3 - 6x_4 &= 0 \end{aligned} \]

Solving systems of 2 variables

How can we solve the following system?

$\begin{align} 2x_1 + x_2 &= 3 \quad \quad (1)\\ x_1 - x_2 &= 0 \quad \quad (2) \end{align}$

From (2):

$x_2 = x_1$

Sub into (1):

$2x_1+x_1=3$ $\implies x_1=1$

Sub back into (2):

$x_2 = x_1 =1$


Further problems

How can we solve the following system?

\begin{align*} 2x_1 + x_2 + x_3 - 4 x_4 + 2x_5 &= 3 \\ x_1 - x_2 - x_4 + x_5 &= 0 \\ x_2 + 2x_3 - x_4 + 2x_5 &=1 \\ x_1 - x_2 - 2x_3 - 3x_4 - 4x_5 &=10 \\ x_1 + 2x_2 + 3x_3 - 4x_4 + x_5 &=-2 \end{align*}

  • Does a solution always exist?
  • If it exists, what is the solution?

We need a systematic approach!! 🤔


A systematic approach...

We represent the system

$ \begin{align*} 2x_1 + x_2 &= 3 \\ x_1 - x_2 &= 0 \end{align*} $

using the augmented matrix

$ \left( \begin{array}{rr|r} 2 & 1 & 3 \\ 1 & -1 & 0 \end{array} \right) $

and solve this system using row operations

This approach is called row reduction, or Gaussian elimination


Allowed row operations

There are three allowed row operations:

  1. Interchanging two rows, i.e.

    $ \left( \begin{array}{rrr|r} 0 & -4 & 8 & 4 \\ 1 & -1 & 1& 0 \\ 2 & 2 & 3 & 4 \end{array} \right) $ $ \begin{array}{rrr|r} R1 \\ R2 \\ R3 \end{array} $ $\quad\rightarrow\quad$ $ \left( \begin{array}{rrr|r} 1 & -1 & 1 & 0 \\ 0 & -4 & 8 & 4 \\ 2 & 2 & 3 & 4 \end{array} \right) $ $ \begin{array}{rrr|r} \color{red}{R2} \\ \color{red}{R1} \\ R3 \end{array} \qquad \qquad \qquad $

  2. Rescaling one row, i.e.

    $ \left( \begin{array}{rrr|r} 1 & -1 & 1& 0 \\ 0 & -4 & 8 & 4 \\ 2 & 2 & 3 & 4 \end{array} \right) $ $ \begin{array}{rrr|r} R1a \\ R2a \\ R3 \end{array} $ $\quad\rightarrow\quad$ $ \left( \begin{array}{rrr|r} 1 & -1 & 1 & 0 \\ 0 & 1 & -2 & -1 \\ 2 & 2 & 3 & 4 \end{array} \right) $ $ \begin{array}{r} R1a \\ \color{red}{-\frac{1}{4}R2a} \\ R3 \end{array}\qquad \qquad $

  3. Adding a multiple of one row to another row, i.e.

    $ \left( \begin{array}{rrr|r} 1 & -1 & 1 & 0 \\ 0 & 1 & -2 & -1 \\ 2 & 2 & 3 & 4 \end{array} \right) $ $ \begin{array}{r} R1a \\ R2b \\ R3 \end{array} $ $\quad\rightarrow\quad$ $ \left( \begin{array}{rrr|r} 1 & -1 & 1 & 0 \\ 0 & 1 & -2 & -1 \\ 0 & 4 & 1 & 4 \end{array} \right) $ $ \begin{array}{l} R1a \\ R2b \\ \color{red}{R3 - 2 R1a} \end{array}\qquad \qquad $


Allowed row operations

These operations are allowed because they produce a new set of equations with the same solution.

1. Interchanging two rows: Hopefully obvious 😃

2. Rescaling one row:

If $\;-4y + 8z = 4\;$ then $\;y- 2z = -1$

3.Adding a multiple of one row to another row:

If $\color{red}{x- y + z = 0}\;$ and $\;\color{blue}{2x + 2y + 3z = 4}\;$ then

$\color{blue}{2x + 2y + 3z} - 2(\color{red}{x - y + z}) = \color{blue}{4}- 2(\color{red}0) $ $ = 4$

$\Ra \; 2x + 2y + 3z- 2x + 2y- 2z = 4$

$\Ra \; 4y + z = 4$

Our objective - Upper triangular form

A square matrix is in upper triangular form if and only if (iff) $a_{ij} = 0$ whenever $i > j.$

That is, whenever all entries below the main diagonal are zero.

Example:

$ \left( \begin{array}{rrrr} a_{11} & a_{11} & \cdots & a_{1n} \\ 0 & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & 0 & a_{nn} \end{array} \right) $


Our objective - Upper triangular form

Our objective using row reduction on an augmented matrix:

$ \left( \begin{array}{cccc|c} a_{11} & a_{12} & \cdots & a_{1n} & q_1 \\ a_{21} & a_{22} & \cdots & a_{2n} & q_2 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} & q_n \\ \end{array} \right) $ $\;\;\rightarrow\;\; \left( \begin{array}{ccccc|c} 1 & b_{12} & b_{13} & \cdots & b_{1n} & r_1 \\ 0 & 1 & b_{23} & \cdots & b_{2n} & r_2 \\ 0 & 0 & 1 & \ldots & b_{3n} & r_3 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 &0 & 0 & \cdots & 1 & r_n \\ \end{array} \right) $

With equations in this form, we obtain the solution by back-substitution.

The bottom line gives: $\;x_n = r_n.$

The line above then gives:

$x_{n-1}+ b_{(n-1)n}x_n = r_{n-1}$ $\;\Ra \; x_{n-1} = r_{n-1}-b_{(n-1)n}r_n .$

and so on...


Example 1

$ \begin{array}{r} 2x_1+ x_2 =3 \\ x_1 -x_2 = 0 \end{array} $ $\Ra$ $ \left( \begin{array}{rr|r} 2 & 1 & 3 \\ 1 & -1 & 0 \end{array} \right) \begin{array}{l} R1 \\ R2 \end{array} $
$ \left( \begin{array}{rr|r} 1 & -1 & 0 \\ 2 & 1 & 3 \end{array} \right) \begin{array}{l} R1a = R2 \\ R2a = R1 \end{array} $
$ \left( \begin{array}{rr|r} 1 & -1 & 0 \\ 0 & 3 & 3 \end{array} \right) \begin{array}{l} R1a \\ R2b = R2a-2R1a \end{array} $
$ \left( \begin{array}{rr|r} 1 & -1 & 0 \\ 0 & 1 & 1 \end{array} \right) \begin{array}{l} R1a \\ R2c = \frac{1}{3}R2b \end{array} $ $\Ra \begin{array}{r} x_1- x_2 =0 \\ x_2 = 1 \end{array} $

Hence $x_2=1$, and back-substitution in $x_1 - x_2 = 0\;$ gives $\;x_1 -1 = 0$ $\; \Ra\; x_1 = 1.$

Therefore $x_1 = 1$ and $x_2=1.$

Example 2

$ \begin{array}{r} 2x_1+ x_2 =3 \\ x_1 -x_2 = 0 \end{array} $ $\Ra$ $ \left( \begin{array}{rr|r} 2 & 1 & 3 \\ 1 & -1 & 0 \end{array} \right) \begin{array}{l} R1 \\ R2 \end{array} $
$ \left( \begin{array}{rr|r} 1 & \frac{1}{2} & \frac{3}{2} \\ 1 & -1 & 0 \end{array} \right) \begin{array}{l} R1a = \frac{1}{2}R1 \\ R2 \end{array} $
$ \left( \begin{array}{rr|r} 1 & \frac{1}{2} & \frac{3}{2} \\ 0 & -\frac{3}{2} & -\frac{3}{2} \end{array} \right) \begin{array}{l} R1a \\ R2a = R2-R1a \end{array} $
$ \left( \begin{array}{rr|r} 1 & \frac{1}{2} & \frac{3}{2} \\ 0 & 1 & 1 \end{array} \right) \begin{array}{l} R1a \\ R2b = -\frac{2}{3}R2a \end{array} $ $\Ra \begin{array}{r} x_1+ \frac{1}{2}x_2 =\frac{3}{2} \\ x_2 = 1 \end{array} $

Hence $x_2=1$, and back-substitution in $x_1+ \frac{1}{2}x_2 =\frac{3}{2}\;$ gives $\;x_1 +\frac{1}{2} = \frac{3}{2}$ $\; \Ra\; x_1 = 1.$

Therefore $x_1 = 1$ and $x_2=1.$

Extending to larger systems

How do we solve the following problem?

$ \begin{array}{rcl} 3x_1 + 2x_2-x_3 & = & -2 \\ 3x_1 + x_2-x_3 & = & -5 \\ 3x_1 + 2x_2+x_3 & = & 2 \\ \end{array} $ $ \Ra \left( \begin{array}{rrr|r} 3 & 2 & - 1 & -2 \\ 3 & 1 & - 1 & -5 \\ 3 & 2 & 1 & 2 \\ \end{array} \right) $
$ \Ra \left( \begin{array}{rrr|r} 3 & 2 & - 1 & -2 \\ 0 & -1 & 0 & -3 \\ 0 & 0 & 2 & 4 \\ \end{array} \right) \begin{array}{l} R1 \\ R2 - R1 \\ R3 - R1\\ \end{array} $

Back-substitution gives

$ 2x_3 = 4 $ $ \Ra\; x_3 = 2 $
$ -x_2 = -3 $ $ \Ra\; x_2 = 3 $
$ 3x_1 + 2x_2 -x_3 $ $ = 3x_1 + 6 - 2 $ $= - 2 $ $ \Ra\; x_1 = -2 $

Therefore $\;x_1 = -2,\, x_2 = 3,\,$ and $\, x_3 = 2.$

Don't forget to check your answer!!!

We found that

$ \begin{array}{rcl} 3x_1 + 2x_2-x_3 & = & -2 \\ 3x_1 + x_2-x_3 & = & -5 \\ 3x_1 + 2x_2+x_3 & = & 2 \\ \end{array} $ $ \;\Ra\; x_1 = -2,\, x_2 = 3, x_3 = 2 $

It's easy and wise to check your answer...

$ 3(-2)+ 2(3)-(2) $ $ =-6+6 -2 $ $ =-2\; $ ✅

$ 3(-2)+ (3)-(2) $ $ =-6+3 -2 $ $ =-5\; $ ✅

$ 3(-2)+ 2(3)+(2) $ $ =-6+6 +2 $ $ =2\; $ ✅

😃

Using Matlab/Octave

We found that

$ \begin{array}{rcl} 3x_1 + 2x_2-x_3 & = & -2 \\ 3x_1 + x_2-x_3 & = & -5 \\ 3x_1 + 2x_2+x_3 & = & 2 \\ \end{array} $ $ \;\Ra\; x_1 = -2,\, x_2 = 3, x_3 = 2 $

						
>> A = [3 2 -1 -2; 3 1 -1 -5; 3 2 1 2]
  
						
A =
3 2 -1 -2
3 1 -1 -5
3 2  1  2
  
						
>> rref(A)
  
						
ans =
1 0 0 -2
0 1 0  3
0 0 1  2
  

Row Echelon form

Definition (Row Echelon Form)

A matrix is in row echelon form if

  1. any rows of zeros are at the bottom; and
  2. the first nonzero term in any row - the leading entry - is to the left of any leading entries below it.

Once your row-reduced augmented matrix has this property

it is in row echelon form

... and you can stop row reducing!!

In row echelon form? Check the leading entries...

$ \left( \begin{array}{rrr|r} 1 & 2 & 1 & 3 \\ 0 & 0 & \color{red}{-1} & 0 \\ 0 & \color{red}{2} & 0 & 4\\ \end{array} \right) $ R2's leading entry is not to the left
of R3's leading entry  ❌
 
$ \left( \begin{array}{rrr|r} 1 & 2 & 1 & 3 \\ 0 & \color{green}{2} & 0 & 4 \\ 0 & 0 & \color{green}{-1} & 0 \\ \end{array} \right) $ Swapping R2 and R3 ✅


In row echelon form? Check the leading entries...

$ \left( \begin{array}{rrr|r} 1 & 2 & 1 & 3 \\ 0 & \color{red}{1} & -1 & 0 \\ 0 & \color{red}{2} & 0 & 4\\ \end{array} \right) $ R2's leading entry is not to the left
of R3's leading entry  ❌
 
$ \left( \begin{array}{rrr|r} 1 & 2 & 1 & 3 \\ 0 & \color{green}{1} & -1 & 0 \\ 0 & 0 & \color{green}{2} & 4 \\ \end{array} \right) $ R3a $\rightarrow$ R3$\,-\,$2R2  ✅


In row echelon form? Check the leading entries...

$ \left( \begin{array}{rrrrr|r} \color{green}{1} & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & \color{green}{1} & 1 & 1 & 0 \\ 0 & 0 & 0 & 0 & \color{green}{1} & -3 \\ 0 & 0 & 0 & 0 & 0 & -4 \\ 0 & 0 & 0 & 0 & 0 & -3 \\ \end{array} \right) $ All leading entries are to the left of
all lower leading entries  ✅
 
$ \left( \begin{array}{rrrrr|r} \color{red}{1} & 1 & 1 & 1 & 1 & 1 \\ \color{red}{1} & 0 & 1 & 1 & 2 & 0 \\ 0 & 0 & 0 & 1 & 3 & -3 \\ 0 & 0 & 0 & 0 & 0 & -4 \\ 0 & 0 & 0 & 0 & 0 & -3 \\ \end{array} \right) $ R1's leading entry is not to the left
of R2's leading entry  ❌


Can we always obtain upper triangular form?

Let's try some simple examples...

Example 1

$ \begin{array} {r} x_1 + x_2 = 2\\ x_1 - x_2 = 2\\ \end{array} $ $ \;\rightarrow\; \left( \begin{array}{rr|r} 1 & 1 & 2 \\ 1 & -1 & 2 \end{array} \right) $ $ \;\rightarrow\; \left( \begin{array}{rr|r} 1 & 1 & 2 \\ 0 & 2 & 0 \end{array} \right) $

  • As many equations as variables.
  • We obtain upper triangular form.
  • There is a unique solution: $x_1 = 2,\, x_2 = 0.$


Can we always obtain upper triangular form?

Example 2

$ \begin{array} {r} x_1 + x_2 = 2\\ x_1 + x_2 = 1\\ \end{array} $ $ \;\rightarrow\; \left( \begin{array}{rr|r} 1 & 1 & 2 \\ 1 & 1 & 1 \end{array} \right) $ $ \;\rightarrow\; \left( \begin{array}{rr|r} 1 & 1 & 2 \\ 0 & 0 & 1 \end{array} \right) $

  • As many equations as variables.
  • We obtain row echelon form.
  • There is no solution. This is because there are no $x_1,$ $x_2$ for which $0x_1+0x_2 = 1.$ This type of system is said to be inconsistent.


Can we always obtain upper triangular form?

Example 3

$ \begin{array} {r} x_1 + x_2 = 2\\ -x_1 - x_2 = -2\\ \end{array} $ $ \;\rightarrow\; \left( \begin{array}{rr|r} 1 & 1 & 2 \\ -1 & -1 & -2 \end{array} \right) $ $ \;\rightarrow\; \left( \begin{array}{rr|r} 1 & 1 & 2 \\ 0 & 0 & 0 \end{array} \right) $

  • As many equations as variables.
  • We obtain row echelon form.
  • There is a family of solutions: $x_1=2-x_2,$ where the value of $x_2$ may be chosen arbitrarily.


Can we always obtain upper triangular form?

Example 4

$ \begin{array} {r} x_1 + x_2 + x_3 = 1\\ x_1 + x_2 +2x_3= 2\\ \end{array} $ $ \;\rightarrow\; \left( \begin{array}{rrr|r} 1 & 1 & 1 & 1 \\ 1 & 1 & 2 & 2 \end{array} \right) $ $ \;\rightarrow\; \left( \begin{array}{rrr|r} 1 & 1 & 1 & 1 \\ 0 & 0 & 1 & 1 \end{array} \right) $

  • Fewer equations than variables. This type of system is called an underdetermined system.
  • We obtain row echelon form.
  • There is a family of solutions:
    • $x_3=1.$
    • $x_1 + x_2 + 1 = 1$ $\;\Ra\; x_1 = -x_2,$ where the value of $x_2$ may be chosen arbitrarily.


Can we always obtain upper triangular form?

Example 5

$ \begin{array} {r} x_1 + x_2 = 2\\ x_1 + 2x_2 = 3\\ 2x_1 + 2x_2 = 4\\ \end{array} $ $ \;\rightarrow\; \left( \begin{array}{rr|r} 1 & 1 & 2 \\ 1 & 2 & 3 \\ 2 & 2 & 4 \\ \end{array} \right) $ $ \;\rightarrow\; \left( \begin{array}{rr|r} 1 & 1 & 2 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \\ \end{array} \right) $

  • More equations than variables. This type of system is called an overdetermined system.
  • We obtain row echelon form.
  • There is a unique solution: $x_1=1,\; x_2=1.$


Can we always obtain upper triangular form?

Example 6

$ \begin{array} {r} x_1 + x_2 = 2\\ x_1 + 2x_2 = 3\\ 2x_1 + 2x_2 = 5\\ \end{array} $ $ \;\rightarrow\; \left( \begin{array}{rr|r} 1 & 1 & 2 \\ 1 & 2 & 3 \\ 2 & 2 & 5 \\ \end{array} \right) $ $ \;\rightarrow\; \left( \begin{array}{rr|r} 1 & 1 & 2 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \\ \end{array} \right) $

  • More equations than variables - overdetermined system.
  • We obtain row echelon form.
  • There is no solution. This is because there are no $x_1,$ $x_2$ for which $0x_1 + 0x_2 = 1$. The system is inconsistent.


Summary

  1. Reduce to row echelon form (triangular if possible)
  2. Interpret the results
    • Rows of the form $(0 \; 0 \; \cdots\; 0 \;|\; 1)$
      • Inconsistent system
    • Rows of the form $(0 \; 0 \; \cdots\; 0 \;|\; 0)$
      • There is a redundant equation for each such row
    • Rows of the form $(\cdots \; a_1 \; a_2 \; \cdots\; a_n \;|\; r)$
      • As many such rows as variables $\Ra$ unique solution
      • Fewer such rows than variables $\Ra$ family of solutions
  3. Common (but not guaranteed) outcomes:
    • Overdetermined systems often have no solution.
    • Underdetermined systems often have a family of solutions.

Determining families of solutions

  1. Write out each equation from the row echelon form.
  2. Each variable appearing first in an equation is a lead variable.
  3. The remaining variables are the free (or undetermined) variables.

Examples:

$ \left( \begin{array}{rrr|r} 1 & 1 & 1 & 1 \\ 0 & 1 & 2 & 0 \\ \end{array} \right) $ $\;\rightarrow\; \begin{array} {r} \color{blue}{x_1} + \color{blue}{x_2} + \color{red}{x_3} = 1\\ \color{blue}{x_2} + 2\color{red}{x_3} = 0\\ \end{array} $

From the second equation: $\color{blue}{x_2}=-2\color{red}{x_3}.$

Therefore from the first equation: $\color{blue}{x_1}=1-\color{red}{x_3}- \color{blue}{x_2}$ $= 1 + \color{red}{x_3}.$

So $\color{blue}{x_2}=-2\color{red}{x_3}$ and $\color{blue}{x_1}=1+\color{red}{x_3}.$

That is, once $\color{red}{x_3}$ is given, $\color{blue}{x_1}$ and $\color{blue}{x_2}$ are uniquely determined.

Determining families of solutions

Examples:

$ \left( \begin{array}{rrrrr|r} 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & 1 & 1 & 2 & 0 \\ 0 & 0 & 0 & 0 & 1 & -3 \\ 0 & 0 & 0 & 0 & 0& 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ \end{array} \right) $ $\rightarrow\; \begin{array} {r} \color{blue}{x_1} + \color{red}{x_2} + \color{blue}{x_3} + \color{red}{x_4} + \color{blue}{x_5} = 1\;\;\\ \color{blue}{x_3} + \color{red}{x_4} + 2\color{blue}{x_5} = 0\;\;\\ \color{blue}{x_5} = -3 \end{array} $ $\rightarrow\; \begin{array} {r} \color{blue}{x_1} + \color{blue}{x_3} +\color{blue}{x_5} = 1- \color{red}{x_2} - \color{red}{x_4}\\ \color{blue}{x_3} + 2\color{blue}{x_5} = - \color{red}{x_4}\quad\quad\;\;\,\\ \color{blue}{x_5} = -3\quad\quad\;\;\;\; \end{array} $

From the second and third equations: $\color{blue}{x_3}=-\color{red}{x_4} - 2\color{blue}{x_5}$ $=-\color{red}{x_4} + 6.$

$\color{blue}{x_1} = 1- \color{red}{x_2}-\color{red}{x_4} - \color{blue}{x_3} - \color{blue}{x_5}$ $=1- \color{red}{x_2}-\color{red}{x_4} -(-\color{red}{x_4} + 6)+ 3\qquad\qquad$

$\;\quad\qquad=1- \color{red}{x_2}-\color{red}{x_4} + \color{red}{x_4}-3$

$=-2- \color{red}{x_2}\quad\;$

Therefore $\,\color{blue}{x_1}= -2-\color{red}{x_2},\, \color{blue}{x_3} = -\color{red}{x_4}+6, \,$ and $\,\color{blue}{x_5}=-3.$


Gauss-Jordan elimination: reduced row echelon form

Definition (Reduced Row Echelon Form)

A matrix is in reduced row echelon form if

  1. it is in row echelon form;
  2. all leading entries in the nonzero rows are all 1; and
  3. all leading entries are the only nonzero entry in their column.

  • Gaussian elimination $\rightarrow$ row echelon form
    • Easier (for humans)
    • Need to back-substitute
    • Row echelon forms not unique
  • Gauss-Jordan elimination $\rightarrow$ reduced row echelon form
    • More work (but easy for computers)
    • No need for back-substitution
    • Reduced row echelon form is unique

Determining families of solutions

$ \left( \begin{array}{rrrrr|r} \color{blue}{1} & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & \color{blue}{1} & 1 & 2 & 0 \\ 0 & 0 & 0 & 0 & \color{blue}{1} & -3 \\ 0 & 0 & 0 & 0 & 0& 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ \end{array} \right) $ $\rightarrow\; \left( \begin{array}{rrrrr|r} \color{blue}{1} & 1 & 0 & 0 & 0 & -2 \\ 0 & 0 & \color{blue}{1} & 1 & 0 & 6 \\ 0 & 0 & 0 & 0 & \color{blue}{1} & -3 \\ 0 & 0 & 0 & 0 & 0& 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ \end{array} \right) $ $\rightarrow\; \begin{array} {l} \color{blue}{x_1}= -2-\color{red}{x_2} \\ \color{blue}{x_3}= 6-\color{red}{x_4} \\ \color{blue}{x_5}= -3 \end{array} $

  • No need for back-substitution.
    • Lead variables all expressed in terms of free variables
  • This is the form given by the Matlab command rref
						
>> rref([1 1 1 1 1 1; 0 0 1 1 2 0; 0 0 0 0 1 -3])
  
						
ans =
1 1 0 0 0 -2
0 0 1 1 0  6
0 0 0 0 1 -3
  

Application example - Dimensional Analysis

What could the period of a pendulum depend on?

  • Pendulum length $l$, measured in $\text{m}$.
  • Pendulum mass $\text{m}$, measured in $\text{kg}$.
  • Strength of the earth's gravitational field, measured as the acceleration due to gravity, $g$, in $\text{m}/\text{s}^2$.

We assume that $T \propto l^a\text{m}^bg^c,$ where $T$ is the period of the pendulum in seconds.

Comparing units, we get

$s = \text{m}^a\text{kg}^b\left(\text{m}/\text{s}^2\right)^c$ $ = \text{m}^{a+c}\text{kg}^b\text{s}^{-2c}$


Application example - Dimensional Analysis

$s = \text{m}^a\text{kg}^b\left(\text{m}/\text{s}^2\right)^c$ $ = \text{m}^{a+c}\text{kg}^b\text{s}^{-2c}$

Equating the exponents:

$a+c = 0,\qquad b = 0, \qquad -2c=1$

Row reduction gives:

$ \left( \begin{array}{rrr|r} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & -2 & 1 \\ \end{array} \right) $ $ \rightarrow \left( \begin{array}{rrr|r} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & -\frac{1}{2} \\ \end{array} \right) \begin{array}{r} R1 \\ R2 \\ -\frac{1}{2}R3 \\ \end{array} $ $ \rightarrow \left( \begin{array}{rrr|r} 1 & 0 & 0 & \frac{1}{2} \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & -\frac{1}{2} \\ \end{array} \right) \begin{array}{l} R1-R3a \\ R2 \\ R3a \\ \end{array} $

So $a = 1/ 2, \, b = 0$ and $c =-1/ 2,$ and the formula for the period becomes

$T\propto \sqrt{\frac{l}{g}}$

Application example - Dimensional Analysis

Let's include a fourth quantity, and see what happens.

  • Pendulum length $l$, measured in $\text{m}$.
  • Pendulum mass $\text{m}$, measured in $\text{kg}$.
  • Strength of the earth's gravitational field, measured as the acceleration due to gravity, $g$, in $\text{m}/\text{s}^2$.
  • Initial pendulum height $h_0$ (above equilibrium point)

Now we assume that $T \propto l^a\text{m}^bg^c h_0^d.$

Comparing units, we get

$s = \text{m}^a\text{kg}^b\left(\text{m}/\text{s}^2\right)^c\text{m}^d$ $ = \text{m}^{a+c+d}\text{kg}^b\text{s}^{-2c}$


Application example - Dimensional Analysis

$s = \text{m}^a\text{kg}^b\left(\text{m}/\text{s}^2\right)^c\text{m}^d$ $ = \text{m}^{a+c+d}\text{kg}^b\text{s}^{-2c}$

Equating the exponents:

$a+c +d= 0,\qquad b = 0, \qquad -2c=1$

Row reduction gives:

$ \left( \begin{array}{rrrr|r} 1 & 0 & 1 & 1 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & -2 & 0 & 1 \\ \end{array} \right) $ $ \rightarrow \left( \begin{array}{rrrr|r} 1 & 0 & 1 & 1 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & -\frac{1}{2} \\ \end{array} \right) \begin{array}{r} R1 \\ R2 \\ -\frac{1}{2}R3 \\ \end{array} $ $ \rightarrow \left( \begin{array}{rrrr|r} 1 & 0 & 0 & 1 & \frac{1}{2} \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & -\frac{1}{2} \\ \end{array} \right) \begin{array}{l} R1-R3a \\ R2 \\ R3a \\ \end{array} $

So $a = 1/ 2-d, \, b = 0$ and $c =-1/ 2,$ with free variable $d$. Thus

$T \propto l^{1/2-d}h_0^{d}\,g^{-1/2}$ $=\ds \sqrt{\frac{l}{g}\left(\frac{h_0}{l}\right)^d}\;$ for $d$ as a free variable.

Summary

Main points about row reduction

To solve systems of linear equations

  1. Reduce the system to row echelon form
  2. Interpret the results in terms of row-types
    • Rows of the form $(0\; 0\; \cdots 0 \; | \;1)$ $\Ra$ inconsistent system
    • As many non-zero rows as variables $\Ra$ unique solution
    • Fewer non-zero rows than variables $\Ra$ family of solutions $\qquad\qquad\qquad$

Where to next?

  • Matrices
    • notation and operations (addition, multiplication, etc.) on matrices
    • their connection with linear systems
    • some applications