To solve this linear system we perform row operations. The row operation R2−R1→R2 states that we should subtract row 1 from row to2, then replace row 2 with this difference:
a−b+c=0a−b+c=0a+b+c=0R2−R1→R20+2b+0=00+b+0=00+b+0=0The last two equations give b=0, and then the top equation gives a=−c. So let a=α∈R the polynomial p(x) is given by:
p(x)=α(x2−1).We develop the proper definitions so that we can write the above system in matrix form as
[1−11111010][abc]=[000]A matrix is an n×m array of real (or complex) numbers, where ordering matters. Here n refers to the number of rows in the matrix and m is the number of columns.
For an n×m matrix A we use aij to refer to the element that is in the ith row and jth column. Rows and columns are counted from the top left entry. We use the notation
A=(aij)1≤i≤n,1≤j≤mto refer to the the matrix A by its entires. We also use A=(aij) when n and m are implied.
The diagonal entries of a matrix A are aii for 1≤i≤min.
A matrix A is triangular if either a_{ij} = 0 for i < j (lower triangular) or a_{ij} = 0 for j < i (upper triangular). If a matrix is both lower and upper triangular it is said to be diagonal.
A column vector is an n \times 1 matrix.
A row vector is an 1 \times m matrix.
If x is is either a row or column vector, we use x_i (1 \leq i \leq n or 1 \leq i \leq m, resp.) to refer to its entries.
Let A = (a_{ij}) be an n \times m matrix and let x be a m \times 1 column vector. The product y = Ax is a n \times 1 vector y given by
y_j = \sum_{i=1}^m a_{ji} x_i, \quad 1 \leq j \leq n.With this notation, the following linear system of equations
a_{11} x_1 + a_{12} x_2 + \cdots + a_{1n} x_n = y_1\\ a_{21} x_1 + a_{22} x_2 + \cdots + a_{2n} x_n = y_2\\ \vdots ~~~~~~~~~~~~~~~ \vdots\\ a_{n1} x_1 + a_{n2} x_2 + \cdots + a_{nn} x_n = y_nis equivalent to Ax = y
A = [1,2,3; 4,5,6]; % 2 x 3 matrix
x = [1;1;1]; % 3 x 1 vector
A*x % gives a 2 x 1 vector
The goal of Gaussian elimination is to solve a system of equations by performing what are called elementary row operations to reduce a general matrix to an upper-triangular matrix. Then a procedure calle backward substitution applies to the upper-triangular matrix.
Elementary row operations are:
Assume we want to solve the following linear system of equations Ax = b
\begin{bmatrix} 1 & -1 & 1 & 0\\ 1 & 1 & 2 & 1 \\ 0 & 1 & 0 & 0 \\ 1 & -1 &1 & -1 \end{bmatrix}\begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0\end{bmatrix}.We consider the associated augmented matrix
[A, b] = \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 1 & 1 & 2 & 1 & 1 \\ 0 & 1 & 0 & 0 & 0 \\ 1 & -1 &1 & -1 & 0\end{array} \right].The process of Gaussian elimination reduces this augmented matrix to an upper-triangular matrix:
\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 1 & 1 & 2 & 1 & 1 \\ 0 & 1 & 0 & 0 & 0 \\ 1 & -1 &1 & -1 & 0\end{array} \right] & R_2 - R_1 \to R_2 & \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 1 & 0 & 0 & 0 \\ 1 & -1 &1 & -1 & 0\end{array} \right] \end{array}\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 1 & 0 & 0 & 0 \\ 1 & -1 &1 & -1 & 0\end{array} \right] & R_4 - R_1 \to R_4 & \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 &0 & -1 & 0\end{array} \right] \end{array}\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 &0 & -1 & 0\end{array} \right]& R_3 - 1/2R_2 \to R_3 & \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 0 & -1/2 & -1/2 & -1/2 \\ 0 & 0 &0 & -1 & 0\end{array} \right] \end{array}The process of backward substitution starts with the final line. Let's take this equation out of augmented form and write it as Ux = y. The last equation is:
u_{44} x_4 = -x_4 = 0 \quad \Longrightarrow \quad x_4 = 0.Then the next ones:
u_{33}x_3 + u_{34} x_4 = -1/2 x_3 -1/2 x_4 = -1/2 \quad \Longrightarrow \quad x_3 = 1. u_{22}x_2 + u_{23}x_3+ u_{24} x_4 = 2x_2 + x_3 + x_4 = 1 \quad \Longrightarrow \quad x_2 = 0. u_{11}x_1 + u_{12}x_2 + u_{13}x_3+ u_{14} x_4 = x_1-x_2+x_3 = 0 \quad \Longrightarrow \quad x_1 = -1.In general, we perform these row operations to turn Ax = b (typically when A is n \times n) to Ux = y and then backsubsitition is given by
x_i = \frac{y_i - \sum_{j = i+1}^n u_{ij}x_j}{u_{ii}},\quad i = n, n-1, \ldots, 2,1Note that is is a well-defined solution procedure because x_i is given in terms of x_j for j > i. If we start with x_n and move our way down to x_1, we know everything on the right-hand side of this equations.
WARNING: This solution procedure is not well-defined if one of the diagonal entries vanishes as row operations are performed. If this happens, one has to interchange rows.
The full algorithm for this basic Gaussian elimination, including row swaps, is given in Algorithm 6.1 in the text.
In the above example, further row operations can be performed to be able to read off the solution:
\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 0 & -1/2 & -1/2 & -1/2 \\ 0 & 0 &0 & -1 & 0\end{array} \right]& -R_4 \to R_4 & \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 0 & -1/2 & -1/2 & -1/2 \\ 0 & 0 &0 & 1 & 0\end{array} \right] \end{array}\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 0 & -1/2 & -1/2 & -1/2 \\ 0 & 0 &0 & 1 & 0\end{array} \right] & -2R_3 \to R_3 & \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 0 & 1 & 1 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] \end{array}\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 0 & 1 & 1 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] & R_3-R_4 \to R_3 & \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] \end{array}\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 1 & 1 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] & R_2-R_4 \to R_2 & \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] \end{array}\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] & R_2-R_3 \to R_2 & \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] \end{array}\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 1 & 0 & 0 \\ 0 & 2 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] & R_1-R_3 \to R_1 & \left[\begin{array}{cccc|c} 1 & -1 & 0 & 0 & -1 \\ 0 & 2 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] \end{array}\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 0 & 0 & -1 \\ 0 & 2 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] & 1/2R_2 \to R_2 & \left[\begin{array}{cccc|c} 1 & -1 & 0 & 0 & -1 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] \end{array}\begin{array}{ccccc} \left[\begin{array}{cccc|c} 1 & -1 & 0 & 0 & -1 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] & R_1 + R_2 \to R_1 & \left[\begin{array}{cccc|c} 1 & 0 & 0 & 0 & -1 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 1 \\ 0 & 0 &0 & 1 & 0\end{array} \right] \end{array}If you now read off the equations that this augmented system represents, we have x_1 = -1, x_2 = 0, x_3 = 2, x_4 = 0. Note that this was a lot more work than solving the system with backward substitution. This is an indication that backward subsitution is preferable on a computer.
The n\times n identity matrix I = I_n (n is often suppressed) is the n\times n matrix with ones on the diagonal and zero everywhere else:
I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}.So, in the example we used row operations for the equation Ax =b to change [A,b] to [I,x].
Suppose A is an n \times n matrix. If the only solution of Ax = 0 is x = 0 (x is a vector of all zeros) then there exists a unique matrix A^{-1} called the inverse matrix such that A^{-1}A = AA^{-1} = I.
Use row operations to transform [A,I] to [I,B] and then B = A^{-1}.