A matrix is a rectangular array of numbers. The dimensions of a matrix are specified as rows by columns, typically written as $m \times n$. In the context of [[linear algebra]], a matrix can be used to efficiently encode and solve a [[linear system]].
## coefficient matrix
The coefficient matrix tracks the $a_i$ terms in a [[linear system]].
For example, the system of equations
$\begin{align}
60x + 30y = 3000\\
12x + 2y = 400
\end{align}$
Can be written as
$\left[\begin{array}{} 60 & 30 \\ 12 & 2 \end{array}\right]$
## augmented matrix
The augmented matrix is useful when solving a [[linear system]] as it combines the coefficient matrix and the constant matrix.
For example, the system of equations
$\begin{align}
60x + 30y = 3000\\
12x + 2y = 400
\end{align}$
Can be written as
$\left[\begin{array}{rr|r} 60 & 30 & 3000 \\ 12 & 2 & 400\end{array}\right]$
## row-equivalent matrices
An augmented matrix is transformed into a row-equivalent matrix by performing any of the following row operations.
- Interchange any two rows
- Multiply any row by a nonzero constant
- Add a constant multiple of one row to another row.
To solve a system using augmented matrix methods, the objective is to transform the matrix into the form
$\left[\begin{array}{rr|r} 1 & 0 & m \\ 0 & 1 & n \end{array}\right]$
For a system with two equations and two variables, the process is
1. Get a 1 in the upper left
2. Get a 0 in the lower left
3. Get a 1 in the lower right
4. Get a 0 in the upper right
Consider our augmented matrix above. Let's start by simplifying to
$\left[\begin{array}{rr|r} 2 & 1 & 100 \\ 6 & 1 & 200\end{array}\right]$
To get a $1$ in the upper left position, multiply $R_1$ by $1/2$.
$\left[\begin{array}{rr|r} 1 & 1/2 & 50 \\ 6 & 1 & 200\end{array}\right]$
To get a 0 in the lower left position, add $-6 \cdot R_1$ to $R_2$.
$\left[\begin{array}{rr|r} 1 & 1/2 & 50 \\ 0 & -2 & -100\end{array}\right]$
To get a 1 in the lower right position, multiply $R_2$ by $-1/2$.
$\left[\begin{array}{rr|r} 1 & 1/2 & 50 \\ 0 & 1 & 50\end{array}\right]$
To get a 0 in the upper right position, add $-1/2 \cdot R_2$ to $R_1$.
$\left[\begin{array}{rr|r} 1 & 0 & 25 \\ 0 & 1 & 50\end{array}\right]$
Therefore the solution is $x=25$ and $y=50$. (Note this is the same result as using elimination by addition in the example in [[linear system|linear systems]]).
### equivalent systems
If the result is a matrix with a row of all zeros, like
$\left[\begin{array}{rr|r} 1 & -2 & 4 \\ 0 & 0 & 0\end{array}\right]$
the system is equivalent (infinite number of solutions) and corresponds to a linear system like
$\begin{align}
x_1 - 2x_2 = 4 \\
0x_1 + 0x_2 = 0
\end{align}$
We set the variable $x_2= t$ and note that $x_1 = 2t + 4$, therefore the solution is the set $(2t + 4, t)$. These solutions are said to be consistent and dependent.
### inconsistent solutions
If the result is a matrix that cannot be satisfied by any ordered pair of real numbers, like
$\left[\begin{array}{rr|r} 1 & -2 & 4 \\ 0 & 0 & -7\end{array}\right]$
the system is inconsistent (no solutions).
However, keep in mind that for matrices that are taller than wide, there may exist a row of all zeros that does not indicate infinite solutions.
## reduced form
A matrix is said to be in **reduced row echelon form** (reduced form) if
- each row consisting entirely of zeroes is below any row having at least one nonzero element
- the leftmost nonzero element in each row is $1$
- all other elements in the column containing the leftmost 1 of a given row are zeros
- the leftmost $1$ in any row is to the right of the leftmost 1 in the row above.
The following matrix is in reduced row form.
$\left[\begin{array}{rrrr|r} 1 & 4 & 0 & 0 & -3 \\ 0 & 0 & 1 & 0 & 2 \\ 0 & 0 & 0 & 1 & 6\end{array}\right]$
Notice the "triangle" created by the area below and to the left of the diagonal is all zeros. Similarly for the triangle in the upper right.
## Gauss-Jordan elimination
The Gauss-Jordan elimination method is named after [[Carl Friedrich Gauss]] and the German geodesist Wilhelm Jordan. Gauss-Jordan elimination is a technique for solving systems of linear equations. The process is
1. Choose the leftmost nonzero column and use appropriate row operations to get a 1 at the top
2. Use multiples of the row containing the 1 from step 1 to get zeros in all remaining places in the column containing this 1
3. repeat step 1 with submatrix formed by (mentally) deleting the row used in step 2 and all rows above this row
4. repeat step 2 with the entire matrix, including the rows deleted mentally
5. continue this process until the entire matrix is in reduced form.
If the number of leftmost $1