Linear Algebra

Linear Systems of Equations

4/13 in Linear Algebra. See all.

Linear Systems of Equations
A system of equations (you know this), where every term is a scalar multiple of a variable. Then, each equation models a linear combination of the variables.

Credit to 3Blue1Brown.

This can be written as Ax=vA\cdot \vec{x}=\vec{v}. So the solution to a system of linear equations is just a vector that, when transformed by AA, gives v\vec{v}! How do we solve a system of linear equations (SLE)? We can use Gaussian elimination: we write the SLE as an augmented matrix, row reduce it, and then solve the resulting system of equations.
First, let's note that a system of linear equations will have either zero, one, or infinitely many solutions:

Theorem: Suppose x1x_1 and x2x_2 are solutions to the matrix equation Ax=bA\vec{x}=\vec{b}. If α\alpha and β\beta are any real numbers such that α+β=1\alpha + \beta=1, then αx1+βx2\alpha x_1 + \beta x_2 is also a solution to the equation.

Here are some important terms we need before we can solve SLEs:

Consistent
A linear system of equations is consistent if it has at least one solution. Otherwise, it is inconsistent.

Homogenous
A system of linear equations corresponding the matrix equation Ax=bA\vec{x}=\vec{b} is homogenous if b=0\vec{b}=\vec{\textbf{0}}. Otherwise, it is inhomegenous. Every homogenous system is consistent (x=0\vec{x}=\vec{\textbf{0}}, which is called the trivial solution).

Row-Reduced Form
A matrix is in row-reduced form if it satisfies the following four conditions:

  1. All zero rows (if any) appear below all nonzero rows.
  2. The first nonzero element in any nonzero row is 11.
  3. All elements below and in the same column as the first nonzero element in any nonzero row are 00.
  4. The first nonzero element of any nonzero row appears in a column further (farther??) to the right than the first nonzero element in any preceding row.

Ex. A=[171016000]A=\begin{bmatrix}1 & 7 & -1 \\ 0 & 1 & 6 \\ 0 & 0 & 0\end{bmatrix} is in row-reduced form.

Pivot
If a matrix is in row-echelon form, then the first nonzero element of each row is called a pivot, and a column in which a pivot appears is called a pivot column. In a system of linear equations, the pivot columns represent basic variables. Non-basic variables (ones that are not in a pivot column) are called free variables. Free variables can take on any value (we are "free" to choose any value)

Now we're ready to solve SLEs!

The first thing we need to do is form an augmented matrix. This is a matrix that has the coefficients of the variables on the left and the constants on the right. For example, the augmented matrix of the system x1+2x2+3x3=42x1+5x2+2x3=33x1+7x2+8x3=1\begin{align}x_1+2x_2+3x_3&=4\\2x_1+5x_2+2x_3&=3\\3x_1+7x_2+8x_3&=1\end{align} is [123425233781].\begin{bmatrix}1 & 2 & 3 & 4\\2 & 5 & 2 & 3\\3 & 7 & 8 & 1\end{bmatrix}.


Once we've constructed this augmented matrix, we can use Gaussian elimination to row reduce it. This involves using elementary row operations to transform the augmented matrix into row-reduced form.

Guassian Elimination
First, note that the following three operations do not change the set of solutions:

  1. R1R_1 — Changing the order of equations.
  2. R2R_2 — Multiplying an equation by a nonzero scalar.
  3. R3R_3 — Adding to one a equation a scalar times another equation.

These are called elementary row operations. We'll talk more about them in a later section. The augmented matrix of the system Ax=bA\vec{x}=\vec{b} is [A  |  b]\left [A\;\textbf{|}\;\vec{b} \right]. Guassian elimination has 4 steps:

  1. Write the system of equations as an augmented matrix.
  2. Use elementary row operations to transform the augmented matrix into row-reduced form.
  3. Write the equations corresponding to the reduced augmented matrix.
  4. Solve the new set of equations with back-substitution.

Here are some general guidelines for working with elementary row operations:

  • Completely transform one column into the required form before starting on another.
  • Work the columns in order from left to right.
  • Never use an operation that changes a 00 in a previous column.

If the number nn of variables is greater than the number rr of variables, then the rr equations determine the values of rr variables, and the remaining nrn-r variables have no restrictions. Thus, there are infinitely many solutions. Once we've row-reduced the augmented matrix, we can write the system of equations corresponding to the reduced augmented matrix. We can then solve this system of equations using back-substitution. For example: x1+2x2+3x3=42x1+2x2+2x3=23x1+6x2+9x3=12\begin{align}x_1+2x_2+3x_3&=4\\2x_1+2x_2+2x_3&=2\\3x_1+6x_2+9x_3&=12\end{align} The augmented matrix is [1234222236912].\begin{bmatrix}1 & 2 & 3 & 4\\2 & 2 & 2 & 2\\3 & 6 & 9 & 12\end{bmatrix}. The row-reduced form of the augmented matrix is [123401230000].\begin{bmatrix}1 & 2 & 3 & 4\\0 & 1 & 2 & 3\\0 & 0 & 0 & 0\end{bmatrix}. The corresponding system of equations is x1+2x2+3x3=4x2+2x3=30=0\begin{align}x_1+2x_2+3x_3&=4\\x_2+2x_3&=3\\0&=0\end{align} The last equation is a trivial equation and doesn't provide any new information. So, we can ignore it. We can then solve the remaining two equations using back-substitution.

Elementary Matrices
An elementary matrix EE is a square matrix such that multiplying it by AA on the left is the same as applying an elementary row operation to AA. Elementary matrices are easily constructed by applying the corresponding elementary row operation to the identity matrix of the same order. So, the elementary matrix that corresponds to multiplying the first row of an n×nn\times n matrix by kk is [k000010000100001].\begin{bmatrix}k & 0 & 0 & \dots & 0\\0 & 1 & 0 & \dots & 0\\0 & 0 & 1 & \dots & 0\\\vdots & \vdots & \vdots & \ddots & \vdots\\0 & 0 & 0 & \dots & 1\end{bmatrix}.

LU Decomposition
If a nonsingular (invertible) matrix AA can be written as the product of a lower triangular matrix on the left and an upper triangular matrix on the right, AA is said to have an LU decomposition. Let R3(i,j,k)R_3(i,j,k) denote the elementary row operation that adds kk times the jjth row to ii where k0k\neq 0 and iji\neq j. We know that the matrix R3(i,j,k)R_3(i,j,k) has all diagonal elements equal to 11, element at (i,j)(i,j) equal to kk, and 00 everywhere else. So, if i>ji>j, R3(i,j,k)R_3(i,j,k) is a lower triangular matrix. All diagonal elements of a square n×nn\times n nonsingular lower triangular matrix LL must be nonzero. A nonsingular n×nn\times n matrix AA has an LU decomposition if and only if AA can be transformed into an upper triangular matrix with R3(i,j,k)R_3(i,j,k) where i>ji>j. A square matrix AA has an LU decomposition if AA can be transformed to an upper triangular matrix using only the third elementary row operation. If AA has an LU decomposition, we can solve the equation Ax=bA\vec{x}=\vec{b} by solving Ly=bL\vec{y}=\vec{b} and the equation Ux=yU\vec{x}=\vec{y}. Then, we would have LUx=bLU\vec{x}=\vec{b}, Ly=bL\vec{y}=\vec{b}.