~~REVEAL~~ ==== Example ==== Use [[EROs]] to find the intersection of the planes \begin{align*} 3x+4y+7z&=2\\x+3z&=0\\y-2z&=5\end{align*} ==== Solution 1 ==== \begin{align*} \def\go#1#2#3{\left[\begin{smallmatrix}#1\\#2\\#3\end{smallmatrix}\right]} \def\ar#1{\\\xrightarrow{#1}&} &\go{3&4&7&2}{1&0&3&0}{0&1&-2&5} \ar{\text{reorder rows}}\go{1&0&3&0}{0&1&-2&5}{3&4&7&2} \ar{R3\to R3-3R1}\go{1&0&3&0}{0&1&-2&5}{0&4&-2&2} \ar{R3\to R3-4R2}\go{1&0&3&0}{0&1&-2&5}{0&0&6&-18} \ar{R3\to \tfrac16 R3}\go{1&0&3&0}{0&1&-2&5}{0&0&1&-3} \end{align*} ==== ==== $\go{1&0&3&0}{0&1&-2&5}{0&0&1&-3}$ * from the last row, we get $z=-3$ * from the second row, we get $y-2z=5$ * so $y-2(-3)=5$ * so $y=-1$ * from the first row, we get $x+3z=0$ * so $x+3(-3)=0$ * so $x=9$ * Conclusion: $\begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}9\\-1\\-3\end{bmatrix}$ is the only solution. ==== Solution 2 ==== We start in the same way, but by performing more [[EROs]] we make the algebra at the end simpler. \begin{align*} \def\go#1#2#3{\left[\begin{smallmatrix}#1\\#2\\#3\end{smallmatrix}\right]} \def\ar#1{\\\xrightarrow{#1}&} &\go{3&4&7&2}{1&0&3&0}{0&1&-2&5} \ar{\ldots \text{same EROs as above}\ldots}\go{1&0&3&0}{0&1&-2&5}{0&0&1&-3} \ar{R2\to R2+2R3}\go{1&0&3&0}{0&1&0&-1}{0&0&1&-3} \ar{R1\to R1-3R3}\go{1&0&0&9}{0&1&0&-1}{0&0&1&-3} \end{align*} ==== ==== \[ \go{1&0&0&9}{0&1&0&-1}{0&0&1&-3}\] * from the last row, we get $z=-3$ * from the second row, we get $y=-1$ * from the first row, we get $x=9$ * So $\begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}9\\-1\\-3\end{bmatrix}$ is the only solution. ==== Discussion ==== Both solutions use EROs to transform the [[augmented matrix]]. * Solution 1: $\left[\begin{smallmatrix}1&0&3&0\\0&1&-2&5\\0&0&1&-3\end{smallmatrix}\right]$. * "Staircase pattern": 1s on "steps", zeros below steps * Called **row echelon form** * Needed algebra to finish solution. * Solution 2: $\left[\begin{smallmatrix}1&0&0&9\\0&1&0&-1\\0&0&1&-3\end{smallmatrix}\right]$ * Staircase with zeros **above** 1s on steps (and below). * Called **reduced row echelon form** * No extra algebra needed to finish solution. ===== Row echelon form and reduced row echelon form ===== ==== Definition: zero row ==== {{page>zero row}} ==== Definition: leading entry ==== {{page>leading entry}} ==== Row echelon form (REF) ==== A matrix is in **row echelon form**, or **REF**, if: - the [[zero rows]] of the matrix (if any) are all at the bottom of the matrix; and - in every non-zero row of the matrix, the [[leading entry]] is $1$; and - as you go down the rows, the leading entries go to the right. * $\left[\begin{smallmatrix} 1&2&3&4&5\\0&1&2&3&4\\0&0&1&2&3\end{smallmatrix}\right]$ $\left[\begin{smallmatrix} 1&2&3&4&5\\0&1&2&3&4\\0&0&1&2&3\\0&0&0&0&0\end{smallmatrix}\right]$ $\left[\begin{smallmatrix} 1&2&3&4&5\\0&0&0&0&0\\0&0&1&2&3\end{smallmatrix}\right]$ $\left[\begin{smallmatrix} 1&2&3&4&5\\0&0&0&0&0\\0&0&1&2&3\\0&0&0&0&0\end{smallmatrix}\right]$ $\left[\begin{smallmatrix} 1&2&3&4&5\\0&2&3&4&1\\0&0&1&2&3\end{smallmatrix}\right]$ $\left[\begin{smallmatrix} 0&1&2&3&4\\1&2&3&4&5\\0&0&1&2&3\end{smallmatrix}\right]$ $\left[\begin{smallmatrix} 1&2&3&4&5\\1&5&4&3&2\\0&1&2&3&4\end{smallmatrix}\right]$ * Which are in REF? ==== Reduced row echelon form (RREF) ==== A matrix is in **reduced row echelon form** or **RREF** if it is in [[row echelon form]] (REF) and also has the property:
  1. If a column contains the leading entry of a row, then every other entry in that column is $0$.
* e.g. $\left[\begin{smallmatrix} {\color{blue}1}&{\color{red}2}&{\color{red}3}&4&5\\0&{\color{blue}1}&{\color{red}2}&3&4\\0&0&{\color{blue}1}&2&3\end{smallmatrix}\right]$ and $\left[\begin{smallmatrix} {\color{blue}1}&0&{\color{red}3}&4&5\\0&{\color{blue}1}&0&3&4\\0&0&{\color{blue}1}&2&3\end{smallmatrix}\right]$ are in REF but not RREF * e.g. $\left[\begin{smallmatrix} {\color{blue}1}&0&0&4&5\\0&{\color{blue}1}&0&3&4\\0&0&{\color{blue}1}&2&3\end{smallmatrix}\right]$ is in RREF. * How about $\left[\begin{smallmatrix} {\color{blue}1}&9&0&4&5\\0&0&{\color{blue}1}&0&3\\0&0&0&{\color{blue}1}&2\end{smallmatrix}\right]$, $\left[\begin{smallmatrix} {\color{blue}1}&9&0&0&5\\0&0&{\color{blue}1}&0&3\\0&0&0&{\color{blue}1}&2\end{smallmatrix}\right]$, $\left[\begin{smallmatrix} {\color{blue}1}&0&0&0&5\\0&0&{\color{blue}1}&0&3\\0&0&0&{\color{blue}1}&2\end{smallmatrix}\right]$? ==== Example ==== Use [[EROs]] to put $\go{1&2&3&4&5}{0&1&2&3&4}{0&0&1&2&3}$ into [[RREF]]. Solve the corresponding linear system. ==== Solution ==== \begin{align*} &\go{1&2&3&4&5}{0&1&2&3&4}{0&0&1&2&3} \ar{R2\to R2-2R3}\go{1&2&3&4&5}{0&1&0&-1&-2}{0&0&1&2&3} \ar{R1\to R1-3R3}\go{1&2&0&-2&-4}{0&1&0&-1&-2}{0&0&1&2&3} \ar{R1\to R1-2R2}\go{1&0&0&0&0}{0&1&0&-1&-2}{0&0&1&2&3},\text{ in RREF} \end{align*} ==== ==== \[ \go{1&0&0&0&0}{0&1&0&-1&-2}{0&0&1&2&3} \] * Write $x_i$ for the variable corresponding to the $i$th column. * Column 4 has no leading variable. So we set $x_4=t$, a free parameter ($t\in\mathbb{R}$). * From row 3: $x_3+2t=3$, so $x_3=3-2t$ * From row 2: $x_2-t=-2$, so $x_2=-2+t$ * From row 1: $x_1=0$ * Solution: $\left[\begin{smallmatrix}x_1\\x_2\\x_3\\x_4\end{smallmatrix}\right]=\left[\begin{smallmatrix}0\\-2\\3\\0\end{smallmatrix}\right]+t\left[\begin{smallmatrix}0\\1\\-2\\1\end{smallmatrix}\right],\quad t\in\mathbb{R}$. * (Geometrically, this is a line in 4-dimensional space $\mathbb{R}^4$). ===== Solving a system in REF or RREF ===== {{page>leading variable}} To solve the corresponding linear system: - assign a free parameter ($r,s,t,\dots$) to each free variable - starting at the bottom, write out each equation and rearrange for its leading variable ==== Example ==== Solve the linear system for $\newcommand{\sm}{\left[\begin{smallmatrix}}\newcommand{\esm}{\end{smallmatrix}\right]} \sm 1&2&3&0&0&8\\0&0&1&1&1&5\\0&0&0&1&3&4\esm$. * This is in REF, so can use the method just described. * Free variables: $x_2$, $x_5$. Set $x_2=s$, $x_5=t$. * Working from bottom: * $ x_4+3x_5=4\implies x_4=4-3x_5=4-3t$ * $ x_3+x_4+x_5=5\implies x_3=1+2t$ * $ x_1+2x_2+3x_3=8\implies x_1=5-2s-6t.$ * So $ \left[\begin{smallmatrix} x_1\\x_2\\x_3\\x_4 \\x_5\end{smallmatrix}\right]= \left[\begin{smallmatrix} 5\\0\\1\\4\\0\end{smallmatrix}\right] +s\left[\begin{smallmatrix} -2\\1\\0\\0\\0\end{smallmatrix}\right] +t\left[\begin{smallmatrix} -6\\0\\2\\-3\\1\end{smallmatrix}\right],\quad s,t\in \mathbb{R}.$ * 2 free vars, 5 vars in all * Solution set is $2$-dimensional, in $5$-dimensional space $\mathbb{R}^5$.