[TOC]
A linear equation in n unknowns is an equation of the form:
$$
a_1 x_1 + a_2 x_2 + \cdots + a_n x_n = b
$$
where linear system of
By a solution of
If a linear system has no solution, we say that the system is inconsistent.
If the system has at least one solution, we say tht it is consistent.
The set of all solutions of a linear system is called the solution set of the system. To solve a consistent system, we must find its solution set.
Definition 1: Two systems of equations involving the same variables are said to be equivalent if they have the same solutions set.
There are three operations that can be used on a system to obtain an equivalent system:
-
The order in which any two euqations are written may be interchanged
For example, the systems: $$ x_1 + 2x_2 = 4 \ 3x_1 - x_2 = 2 \ 4x_1 + x_2 = 6 $$ and $$ 4x_1 + x_2 = 6 \ 3x_1 - x_2 = 2 \ x_1 + 2x_2 = 4 $$ are equivalent.
-
Both sides of an equation may be multiplied by the same nonzero real number
For example, the systems: $$ x_1 + x_2 + x_3 = 3 \ -2x_1 - x_2 + 4x_3 = 1 $$ and $$ 2x_1 + 2x_2 + 2x_3 = 6 \ -2x_1 - x_2 + 4x_3 = 1 $$ are equivalent.
-
A multiple of one equation may be added to (or subtracted from) another
For example, the systems: $$ a_{i1}x_1 + \cdots + a_{in}x_n = b_i \ a_{j1}x_1 + \cdots + a_{jn}x_n = b_j $$ and $$ a_{i1}x_1 + \cdots + a_{in}x_n = b_i \ (a_{j1} + \alpha a_{i1})x_1 + \cdots + (a_{jn} + \alpha a_{in})x_n = b_j + \alpha b_i $$ are equivalent.
Definition 2: A system is said to be in strict triangular form if, in the $k$th equation, the coefficients of the first
For example:
The system $$ \begin{equation}\begin{split} 3x_1 + 2x_2 + x_3 &= 1 \ x_2 - x_3 &= 2 \ 2x_3 &= 4 \end{split}\end{equation} $$ is in strict triangular form, since in the second equation the coefficients are 0, 1, -1, respectively, and in the third equation the coefficients are 0, 0, 2, respectively.
The term matrix means a rectangular array of numbers. A matrix having
In general, when an
B =
\begin{bmatrix}
b_{11} & b_{12} & \cdots & b_{1r} \
b_{21} & b_{22} & \cdots & b_{2r} \
\vdots \
b_{m1} & b_{m2} & \cdots & b_{mr}
\end{bmatrix}
$$
then
$$
\left[\begin{array}{ccc|ccc}
a_{11} & \cdots & a_{1n} & b_{11} & \cdots & b_{1r} \
\vdots & & & \vdots & & \
a_{m1} & \cdots & a_{mn} & b_{m1} & \cdots & b_{mr}
\end{array}\right]
$$
With each system of equations, we may associate an augmented matrix of the form
$$
\left[\begin{array}{ccc|c}
a_{11} & \cdots & a_{1n} & b_{1} \
\vdots & & & \vdots \
a_{m1} & \cdots & a_{mn} & b_{m}
\end{array}\right]
$$
In general, if an
- Interchange two rows.
- Multiply a row by a nonzero real number.
- Replace a row by the sum of that row and a multiple of another row.
For example:
$$ \begin{equation}\begin{split} -x_2 - x_3 + x_4 &= 0 \\ x_1 + x_2 + x_3 + x_4 &= 6 \\ 2x_1 + 4x_2 + x_3 - 2x_4 &= -1 \\ 3x_1 + x_2 + 2x_3 + 2x_4 &= 3 \end{split}\end{equation} $$ The augmented matrix for this system is: $$ \left[\begin{array}{cccc|c} 0 & -1 & -1 & 1 & 0 \ 1 & 1 & 1 & 1 & 6 \ 2 & 4 & 1 & -2 & -1 \ 3 & 1 & -2 & 2 & 3 \end{array}\right] $$ Since it is not possible to eliminate any entries by using 0 as a pivot element, we will use row [operation 1](#Elementary Row Operations) to interchange the first two rows of the augmented matrix. The new first row will be the pivotal row and the pivot element will be 1: $$ \left[\begin{array}{cccc|c} 1 & 1 & 1 & 1 & 6 \ 0 & -1 & -1 & 1 & 0 \ 2 & 4 & 1 & -2 & -1 \ 3 & 1 & -2 & 2 & 3 \end{array}\right] $$ Row [operation 3](#Elementary Row Operations) is then used twice to eliminate the two nonzero entries in the first column: $$ \left[\begin{array}{cccc|c} 1 & 1 & 1 & 1 & 6 \ 0 & -1 & -1 & 1 & 0 \ 0 & 2 & -1 & -4 & -13 \ 0 & -2 & -5 & -1 & -15 \end{array}\right] $$ Next, the second row is used as the pivotal row to eliminate the entries in the second column below the pivot element -1: $$ \left[\begin{array}{cccc|c} 1 & 1 & 1 & 1 & 6 \ 0 & -1 & -1 & 1 & 0 \ 0 & 0 & -3 & -2 & -13 \ 0 & 0 & -3 & -3 & -15 \end{array}\right] $$ Finally, the tired row is used as the pivotal row to eliminate the last element in the third column: $$ \left[\begin{array}{cccc|c} 1 & 1 & 1 & 1 & 6 \ 0 & -1 & -1 & 1 & 0 \ 0 & 0 & -3 & -2 & -13 \ 0 & 0 & 0 & -1 & -2 \end{array}\right] $$ This augmented matrix represents a strictly triangular system. Solving by back substitution, we obtain the solution (2, -1, 3, 2).
The variables corresponding to the first nonzero elements in each row of the reduced matrix will be referred to as lead variables.
The remaining variables corresponding to the columns skipped in the reduction process will be referred to as free variables.
For example:
The system: $$ \begin{equation}\begin{split} x_1 + x_2 + x_3 + x_4 + x_5 &= 1 \ x_3 + x_4 + 2x_5 &= 0 \ x_5 &= 3 \end{split}\end{equation} $$ Thus,
$x_1, x_3$ , and$x_5$ are the lead variables.$x_2$ and$x_4$ are the free variables.
Definition 3: A matrix is aid to be in row echelon form if:
- The first nonzero entry in each nonzero row is 1.
- If row
$k$ does not consist entirely of zeros, the number of leading zero entries in row$k + 1$ is greater than the number of leading zero entries in row$k$ . - If there are rows whose entries are all zero they are below the rows having nonzero entries.
For example:
The following matrices are not in row echelon form: $$ \begin{bmatrix} 2 & 4 & 6 \ 0 & 3 & 5 \ 0 & 0 & 4 \end{bmatrix},
\begin{bmatrix} 0 & 0 & 0 \ 0 & 1 & 0 \end{bmatrix},
\begin{bmatrix} 0 & 1\ 1 & 0 \end{bmatrix} $$ The first matrix does not satisfy condition 1. The second matrix fails to satisfy condtion 3, and the third matrix fails to satisfy condition 2.
Definition 4: The process of using [row operations 1, 2, and 3](#Elementary Row Operations) to transform a liner system into one whose augmented matrix is in row echelon form is called Gaussian elimination.
(Note that [row operation 2](#Elementary Row Operations) is necessary in order to scale the rows so that the leading coefficients are all 1. If the row echelon form of the augmented matrix contains a row of the form: $$ \left[\begin{array}{cccc|c} 0 & 0 & \cdots & 0 & 1 \end{array}\right] $$ the system is inconsistent. Otherwise, the system will be consistent. If the system is consistent and the nonzero rows of the row echelon form of the matrix form a strictly triangular system, the system will have a unique solution.)
A linear system is said to be overdetermined if there are more equations than unknowns. Overdetermined systems are usually (but not always) inconsistent.
For example:
The system: $$ x_1 + x_2 = 1 \ x_1 - x_2 = 3 \ -x_1 + 2x_2 = -2 $$ By using Gaussian elimination to put these systems into row echelon form: $$ \left[\begin{array}{cc|c} 1 & 1 & 1 \ 1 & -1 & 3 \ -1 & 2 & -2 \end{array}\right]
\rightarrow
\left[\begin{array}{cc|c} 1 & 1 & 1 \ 0 & 1 & -1 \ 0 & 0 & 1 \end{array}\right] $$ The last row of the reduced matrix tells us that
$0x_1 + 0x_2 = 1$ . Since this is never possible, the system must be inconsistent.
A system of
(Although it is possible for underdetermined systems to be inconsistent, they are usually consistent with infinitely many solutions. It is not possible for an underdetermined system to have a unique solution. The reason for this is that any row echelon form of the coefficient matrix will involve $r \leq m$ nonzero rows. Thus, there will be $r$ lead variables and $n - r$ free variables, where $n - r \geq n - m > 0$. If the system is consistent, we can assign the free variables arbitrary values and solve for the lead variables. Therefore, a consistent underdetermined system will have infinitely many solutions.)
For example:
System: $$ \left[\begin{array}{ccc|c} 1 & 2 & 1 & 1 \ 2 & 4 & 2 & 3 \ \end{array}\right]
\rightarrow
\left[\begin{array}{ccc|c} 1 & 2 & 1 & 1 \ 0 & 0 & 0 & 1 \ \end{array}\right] $$ is inconsistent.
Definition 5 A matrix is said to be in reduced row echelon form if:
- The matrix is in row echelon form.
- The first nonzero entry in each row is the only nonzero entry in its column.
For example:
The following matrices are in reduced row echelon form: $$ \begin{bmatrix} 1 & 0 \ 0 & 1 \end{bmatrix},
\begin{bmatrix} 1 & 0 & 0 & 3 \ 0 & 1 & 0 & 2 \ 0 & 0 & 1 & 1 \end{bmatrix},
\begin{bmatrix} 0 & 1 & 2 & 0 \ 0 & 0 & 0 & 1 \ 0 & 0 & 0 & 0 \end{bmatrix},
\begin{bmatrix} 1 & 2 & 0 & 1 \ 0 & 0 & 1 & 3 \ 0 & 0 & 0 & 0 \end{bmatrix} $$
The process of using elementary row operations to transform a matrix into reduced row echelon form is called Gauss-Jordan reduction.
For example:
Solve the system: $$ \begin{equation}\begin{split} -x_1 + x_2 - x_3 + 3x_4 &= 0 \ 3x_1 + x_2 - x_3 - x_4 &= 0 \ 2x_1 - x_2 - 2x_3 - x_4 &= 0 \end{split}\end{equation} $$ By Using Gauss-Jordan reduction: $$ \left[\begin{array}{cccc|c} -1 & 1 & -1 & 3 & 0 \ 3 & 1 & -1 & -1 & 0 \ 2 & -1 & -2 & -1 & 0 \end{array}\right]
\rightarrow
\left[\begin{array}{cccc|c} -1 & 1 & -1 & 3 & 0 \ 0 & 4 & -4 & 8 & 0 \ 0 & 1 & -4 & 5 & 0 \ \end{array}\right]
\rightarrow
\left[\begin{array}{cccc|c} -1 & 1 & -1 & 3 & 0 \ 0 & 4 & -4 & 8 & 0 \ 0 & 0 & -3 & 3 & 0 \ \end{array}\right]
\ \rightarrow
\left[\begin{array}{cccc|c} 1 & -1 & 1 & -3 & 0 \ 0 & 1 & -1 & 2 & 0 \ 0 & 0 & 1 & -1 & 0 \ \end{array}\right]
\rightarrow
\left[\begin{array}{cccc|c} 1 & -1 & 0 & -2 & 0 \ 0 & 1 & 0 & 1 & 0 \ 0 & 0 & 1 & -1 & 0 \ \end{array}\right]
\rightarrow
\left[\begin{array}{cccc|c} 1 & 0 & 0 & -1 & 0 \ 0 & 1 & 0 & 1 & 0 \ 0 & 0 & 1 & -1 & 0 \ \end{array}\right] $$ If we set
$x_4$ equal to any real number$\alpha$ , then$x_1 = \alpha, x_2 = -\alpha$ , and$x_3 = \alpha$ . Thus, all ordered 4-tuples of the form ($\alpha, -\alpha, \alpha, \alpha$ ) are solutions of the system.
A system of linear equations is said to be homogeneous if the constants on the right-hand side are all zero.
(Homogeneous systems are always consistent. It is straightforward to find a solution; just set all the variables equal to zero. Thus, if an $m \times n$ A homogeneous system has a unique solution; it must be the trivial solution (0, 0, ..., 0).)
For example:
The homogeneous system: $$ \left[\begin{array}{cccc|c} -1 & 1 & -1 & 3 & 0 \ 3 & 1 & -1 & -1 & 0 \ 2 & -1 & -2 & -1 & 0 \end{array}\right] $$ consisted of
$m = 3$ equations in$n = 4$ unknowns.
Theorem 1: An
The entries of a matrix are called scalars. (They are usually either real or complex numbers.)
If we wish to refer to matrices without specifically writing out all their entries, we will use uppercase A, B, C, and so on. In general,
Matrices that have only one row or one column are of special interest, since they are used to represent solutions of linear systems. A solution of a system of
For example:
The solution of the linear system: $$ x_1 + x_2 = 3 \ x_1 - x_2 = 1 $$ can be represented by the row vector
$(2, 1)$ or the column vector $\begin{bmatrix} 2 \ 1 \end{bmatrix}$.
The set of all
If A is an
\quad
j = 1, ..., n
$$
The matrix A can be represented in terms of either its column vectors or its row vectors:
$$
A = (a_1, a_2, ..., a_n) \text{ or } A = \begin{bmatrix}
\vec{a_1} \
\vec{a_2} \
\vdots \
\vec{a_m}
\end{bmatrix}
$$
Similarly, if B is an
If:
$$ A = \begin{bmatrix} 3 & 2 & 5 \\ -1 & 8 & 4 \end{bmatrix} $$ Then: $$ a_1 = \begin{bmatrix} 3 \ -1 \end{bmatrix},
a_2 = \begin{bmatrix} 2 \ 8 \end{bmatrix},
a_3 = \begin{bmatrix} 5 \ 4 \end{bmatrix} $$ and $$ \vec{a_1} = (3, 2, 5), \vec{a_2} = (-1, 8, 4) $$
Definition 6 Two
Definition 7 If A is an
For example:
If: $$ A = \begin{bmatrix} 4 & 8 & 2 \ 6 & 8 & 10 \end{bmatrix} $$ then $$ \frac{1}{2}A = \begin{bmatrix} 2 & 4 & 1 \ 3 & 4 & 5 \end{bmatrix}
\text{ and }
3A = \begin{bmatrix} 12 & 24 & 6 \ 18 & 24 & 30 \end{bmatrix} $$
Definition 8 If
For example:
$$ \begin{bmatrix} 3 & 2 & 1 \ 4 & 5 & 6 \end{bmatrix} + \begin{bmatrix} 2 & 2 & 2 \ 1 & 2 & 3 \end{bmatrix}
\begin{bmatrix} 5 & 4 & 3 \ 5 & 7 & 9 \end{bmatrix} $$
If
Definition 9 If
(If A is an $m \times n$ matrix and x is a vector in $\mathbb{R}^n$, then $Ax = x_1 a_1 + x_2 a_2 + \cdots + x_n a_n $)
Theorem 2 (Consistency Theorem for Linear Systems): A linear system
For example:
The linear system: $$ x_1 + 2x_2 = 1 \ 2x_1 + 4x_2 = 1 $$ is inconsistent since the vector $\begin{bmatrix} 1 \ 1 \end{bmatrix}$ cannot be written as a linear combination of the column vectors $\begin{bmatrix} 1 \ 2 \end{bmatrix}$ and $\begin{bmatrix} 2 \ 4 \end{bmatrix}$. Note that any linear combination of these vectors would be of the form: $$ x_1 \begin{bmatrix} 1 \ 2 \end{bmatrix}
x_2 \begin{bmatrix} 2 \ 4 \end{bmatrix}
=
\begin{bmatrix} x_1 + 2x_2 \ 2x_1 + 4x_2 \end{bmatrix} $$ and hence the second entry of the vector must be double the first entry.
NOTE: More generally, it is possible to multiply a matrix A times a matrix B if the number of columns of A equals the number of rows of B.
Definition 10 If
For example:
If $$ A = \begin{bmatrix} 3 & -2 \ 2 & 4 \ 1 & -3 \end{bmatrix} \text{ and } B = \begin{bmatrix} -2 & 1 & 3 \ 4 & 1 & 6 \end{bmatrix}\ $$ then $$ \begin{equation}\begin{split} AB &= \begin{bmatrix} 3 & -2 \ 2 & 4 \ 1 & -3 \end{bmatrix} \begin{bmatrix} -2 & 1 & 3 \ 4 & 1 & 6 \end{bmatrix} \ &= \begin{bmatrix} 3 \cdot (-2) - 2 \cdot 4 & 3 \cdot 1 - 2 \cdot 1 & 3 \cdot 3 - 2 \cdot 6 \ 2 \cdot (-2) + 4 \cdot 4 & 2 \cdot 1 + 4 \cdot 1 & 2 \cdot 3 + 4 \cdot 6 \ 1 \cdot (-2) - 3 \cdot 4 & 1 \cdot 1 - 3 \cdot 1 & 1 \cdot 3 - 3 \cdot 6 \end{bmatrix} \ &= \begin{bmatrix} -14 & 1 & -3 \ 12 & 6 & 30 \ -14 & -2 & -15 \end{bmatrix} \end{split}\end{equation} $$
$$ \begin{equation}\begin{split} BA &= \begin{bmatrix} -2 & 1 & 3 \\ 4 & 1 & 6 \end{bmatrix} \begin{bmatrix} 3 & -2 \\ 2 & 4 \\ 1 & -3 \end{bmatrix} \\ &= \begin{bmatrix} -2 \cdot 3 + 1 \cdot 2 + 3 \cdot 1 & -2 \cdot (-2) + 1 \cdot 4 + 3 \cdot (-3) \\ 4 \cdot 3 + 1 \cdot 2 + 6 \cdot 1 & 4 \cdot (-2) + 1 \cdot 4 + 6 \cdot (-3) \\ \end{bmatrix} \\ &= \begin{bmatrix} -1 & -1 \\ 20 & -22 \end{bmatrix} \end{split}\end{equation} $$
Notice: If A and B are both
For example:
If $$ A = \begin{bmatrix} 1 & 1 \ 0 & 0 \end{bmatrix} $$ and $$ B = \begin{bmatrix} 1 & 1 \ 2 & 2 \end{bmatrix} $$ then $$ AB = \begin{bmatrix} 1 & 1 \ 0 & 0 \end{bmatrix} \begin{bmatrix} 1 & 1 \ 2 & 2 \end{bmatrix}
\begin{bmatrix} 3 & 3 \ 0 & 0 \end{bmatrix} $$ and $$ BA = \begin{bmatrix} 1 & 1 \ 2 & 2 \end{bmatrix} \begin{bmatrix} 1 & 1 \ 0 & 0 \end{bmatrix}
\begin{bmatrix} 1 & 1 \ 2 & 2 \end{bmatrix} $$ Hence,
$AB \neq BA$ .
Just as in ordinary algebra, if an expression involves both multiplication and addition and there are no parentheses to indicate the order of the operations, multiplications are carried out before additions. This is true for both scalar and matrix multiplications.
For example:
If $$ A = \begin{bmatrix} 3 & 4 \ 1 & 2 \end{bmatrix}, B = \begin{bmatrix} 1 & 3 \ 2 & 1 \end{bmatrix}, C = \begin{bmatrix} -2 & 1 \ 3 & 2 \end{bmatrix} $$ then $$ A + BC = \begin{bmatrix} 3 & 4 \ 1 & 2 \end{bmatrix} + \begin{bmatrix} 7 & 7 \ -1 & 4 \end{bmatrix}
\begin{bmatrix} 10 & 11 \ 0 & 6 \end{bmatrix} $$ and $$ 3A + B = \begin{bmatrix} 9 & 12 \ 3 & 6 \end{bmatrix} + \begin{bmatrix} 1 & 3 \ 2 & 1 \end{bmatrix}
\begin{bmatrix} 10 & 15 \ 5 & 7 \end{bmatrix} $$
Definition 11 The transpose of an
For example:
If $$ A = \begin{bmatrix} 1 & 2 & 3 \ 4 & 5 & 6 \end{bmatrix} $$ then $$ A^T = \begin{bmatrix} 1 & 4 \ 2 & 5 \ 3 & 6 \end{bmatrix} $$
Definition 12 An
For example:
The following are some examples of symmetric matrices: $$ \begin{bmatrix} 1 & 0 \ 0 & -4 \end{bmatrix}, \begin{bmatrix} 2 & 3 & 4 \ 3 & 1 & 5 \ 4 & 5 & 3 \end{bmatrix}, \begin{bmatrix} 0 & 1 \ 0 & -4 \end{bmatrix}, $$
WARNING: In general,
Theorem 3: Each of the following statements is valid for any scalars
$A + B = B + A$ $(A + B) + C = A + (B + C)$ $(AB)C = A(BC)$ $A(B + C) = AB + AC$ $(A + B)C = AC + BC$ $(\alpha \beta)A = \alpha(\beta A)$ $\alpha(AB) = (\alpha A)B = A(\alpha B)$ $(\alpha + \beta)A = \alpha A + \beta A$ $\alpha(A + B) = \alpha A + \alpha B$
For example:
If: $$ A = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix},
B = \begin{bmatrix} 2 & 1 \ -3 & 2 \end{bmatrix},
\text{ and }
C = \begin{bmatrix} 1 & 0 \ 2 & 1 \end{bmatrix} $$ verify that
$A(BC) = (AB)C$ and$A(B + C) = AB + AC$ .Solution: $$ A(BC) = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix} \begin{bmatrix} 4 & 1 \ 1 & 2 \end{bmatrix}
\begin{bmatrix} 6 & 5 \ 16 & 11 \end{bmatrix} $$
$$ (AB)C = \begin{bmatrix} -4 & 5 \ -6 & 11 \end{bmatrix} \begin{bmatrix} 1 & 0 \ 2 & 1 \end{bmatrix}
\begin{bmatrix} 6 & 5 \ 16 & 11 \end{bmatrix} $$
Thus, $$ A(BC) = \begin{bmatrix} 6 & 5 \ 16 & 11 \end{bmatrix} = (AB)C $$
$$ A(B + C) = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix} \begin{bmatrix} 3 & 1 \ -1 & 3 \end{bmatrix}
\begin{bmatrix} 1 & 7 \ 5 & 15 \end{bmatrix} $$
$$ AB + AC = \begin{bmatrix} -4 & 5 \ -6 & 11 \end{bmatrix} + \begin{bmatrix} 5 & 2 \ 11 & 4 \end{bmatrix}
\begin{bmatrix} 1 & 7 \ 5 & 15 \end{bmatrix} $$
Therefore, $$ A(B + C) = AB + AC $$
In the case where an
If: $$ A = \begin{bmatrix} 1 & 1 \ 1 & 1 \end{bmatrix} $$ then $$ A^2 = \begin{bmatrix} 1 & 1 \ 1 & 1 \end{bmatrix} \begin{bmatrix} 1 & 1 \ 1 & 1 \end{bmatrix}
\begin{bmatrix} 2 & 2 \ 2 & 2 \end{bmatrix} $$
$$ A^3 = AAA = AA^2 = \begin{bmatrix} 1 & 1 \ 1 & 1 \end{bmatrix} \begin{bmatrix} 2 & 2 \ 2 & 2 \end{bmatrix}
\begin{bmatrix} 4 & 4\ 4 & 4 \end{bmatrix} $$
and, in general, $$ A^n = \begin{bmatrix} 2^{n - 1} & 2^{n - 1} \ 2^{n - 1} & 2^{n - 1} \end{bmatrix} $$
Definition 12 The
For example:
$$ \begin{bmatrix} 1 & 0 & 0 \ 0 & 1 & 0 \ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 3 & 4 & 1 \ 2 & 6 & 3 \ 0 & 1 & 8 \end{bmatrix}
\begin{bmatrix} 3 & 4 & 1 \ 2 & 6 & 3 \ 0 & 1 & 8 \end{bmatrix} $$
and $$ \begin{bmatrix} 3 & 4 & 1 \ 2 & 6 & 3 \ 0 & 1 & 8 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \ 0 & 1 & 0 \ 0 & 0 & 1 \end{bmatrix}
\begin{bmatrix} 3 & 4 & 1 \ 2 & 6 & 3 \ 0 & 1 & 8 \end{bmatrix} $$
Definition 13 An
(If B and C are both multiplicative inverses of A, then $B = BI = B(AC) = (BA)C = IC = C$. Thus, a matrix can have at most one multiplicative inverse. We will refer to the multiplicative inverse of a nonsingular matrix A as simply the inverse of A and denote it by $A^{-1}$.)
For example:
The matrices: $$ \begin{bmatrix} 2 & 4 \ 3 & 1 \end{bmatrix}
\text{ and }
\begin{bmatrix} -\frac{1}{10} & \frac{2}{5} \ \frac{3}{10} & -\frac{1}{5} \end{bmatrix} $$ are inverses of each other, since $$ \begin{bmatrix} 2 & 4 \ 3 & 1 \end{bmatrix} \begin{bmatrix} -\frac{1}{10} & \frac{2}{5} \ \frac{3}{10} & -\frac{1}{5} \end{bmatrix}
\begin{bmatrix} 1 & 0 \ 0 & 1 \end{bmatrix} $$ and $$ \begin{bmatrix} -\frac{1}{10} & \frac{2}{5} \ \frac{3}{10} & -\frac{1}{5} \end{bmatrix} \begin{bmatrix} 2 & 4 \ 3 & 1 \end{bmatrix}
\begin{bmatrix} 1 & 0 \ 0 & 1 \end{bmatrix} $$
Definition 14 An
(Note: Only square matrices have multiplicative inverses. One should not use the terms singular and nonsingular when referring to nonsquare matrices.)
Theorem 4 If A and B are nonsingular
Algebraic Rules for Transposes:
$(A^T)^T = A$ $(\alpha A)^T = \alpha A^T$ $(A + B)^T = A^T + B^T$ $(AB)^T = B^T A^T$
For example:
Let: $$ A = \begin{bmatrix} 1 & 2 & 1 \ 3 & 3 & 5 \ 2 & 4 & 1 \end{bmatrix}, B = \begin{bmatrix} 1 & 0 & 2 \ 2 & 1 & 1 \ 5 & 4 & 1 \end{bmatrix} $$ Note that, on the one hand, the (3, 2) entry of AB is computed taking the scalar product of the third row of A and the second column of B. $$ AB = \begin{bmatrix} 1 & 2 & 1 \ 3 & 3 & 5 \ 2 & 4 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 2 \ 2 & 1 & 1 \ 5 & 4 & 1 \end{bmatrix}
\begin{bmatrix} 10 & 6 & 5 \ 34 & 23 & 14 \ 15 & 8 & 9 \end{bmatrix} $$ When the product is transposed, the (3, 2) entry of AB becomes the (2, 3) entry of
$(AB)^T$ . $$ (AB)^T = \begin{bmatrix} 10 & 34 & 15 \ 6 & 23 & 8 \ 5 & 14 & 9 \end{bmatrix} $$ On the other hand, the (2, 3) entry of$B^T A^T$ is computed by taking the scalar product of the second row of$B^T$ and the third column of$A^T$ . $$ B^T A^T = \begin{bmatrix} 1 & 2 & 5 \ 0 & 1 & 4 \ 2 & 1 & 1 \end{bmatrix} \begin{bmatrix} 1 & 3 & 2 \ 2 & 3 & 4 \ 1 & 5 & 1 \end{bmatrix}\begin{bmatrix} 10 & 34 & 15 \ 6 & 23 & 8 \ 5 & 14 & 9 \end{bmatrix} $$ In both caes, the arithmetic for computing the (2, 3) entry is the same.
A matrix A is symmetric if
Theorem 5 If A is an
Given an
If we start with the identity matrix
There are three types of elementary matrices corresponding to the three types of elementary row operations:
-
Type 1: An elementary matrix of type
$I$ is a matrix obtained by interchanging two rows of$I$ .For example:
The matrix:
$$ E_1 = \begin{bmatrix} 0 & 1 & 0 \ 1 & 0 & 0 \ 0 & 0 & 1 \end{bmatrix} $$
is an elementary matrix of type 1 since it was obtained by interchanging the first two rows of
$I$ . If A is a$3 \times$ matrix, then $$ E_1 A = \begin{bmatrix} 0 & 1 & 0 \ 1 & 0 & 0 \ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} a_{11} & a_{12} & a_{13} \ a_{21} & a_{22} & a_{23} \ a_{31} & a_{32} & a_{33} \end{bmatrix}\begin{bmatrix} a_{21} & a_{22} & a_{23} \ a_{11} & a_{12} & a_{13} \ a_{31} & a_{32} & a_{33} \end{bmatrix} $$
$$ A E_1 = \begin{bmatrix} a_{11} & a_{12} & a_{13} \ a_{21} & a_{22} & a_{23} \ a_{31} & a_{32} & a_{33} \end{bmatrix} \begin{bmatrix} 0 & 1 & 0 \ 1 & 0 & 0 \ 0 & 0 & 1 \end{bmatrix}
\begin{bmatrix} a_{12} & a_{11} & a_{13} \ a_{22} & a_{21} & a_{23} \ a_{32} & a_{31} & a_{33} \end{bmatrix} $$
Multiplying A on the left by
$E_1$ interchanges the first and second rows of A. Right multiplication of A by$E_1$ is equivalent to the elementary column operation of interchanging the first and second columns. -
Type 2: An elementary matrix of type 2 is a matrix obtained by multiplying a row of
$I$ by a nonzero constant.For example:
The matrix: $$ E_2 = \begin{bmatrix} 1 & 0 & 0 \ 0 & 1 & 0 \ 0 & 0 & 3 \end{bmatrix} $$ is an elementary matrix of type 2. If A is a
$3 \times 3$ matrix, then $$ E_2 A = \begin{bmatrix} 1 & 0 & 0 \ 0 & 1 & 0 \ 0 & 0 & 3 \end{bmatrix} \begin{bmatrix} a_{11} & a_{12} & a_{13} \ a_{21} & a_{22} & a_{23} \ a_{31} & a_{32} & a_{33} \end{bmatrix}\begin{bmatrix} a_{11} & a_{12} & a_{13} \ a_{21} & a_{22} & a_{23} \ 3a_{31} & 3a_{32} & 3a_{33} \end{bmatrix} $$
$$ A E_2 = \begin{bmatrix} a_{11} & a_{12} & a_{13} \ a_{21} & a_{22} & a_{23} \ a_{31} & a_{32} & a_{33} \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \ 0 & 1 & 0 \ 0 & 0 & 3 \end{bmatrix}
\begin{bmatrix} a_{11} & a_{12} & 3a_{13} \ a_{21} & a_{22} & 3a_{23} \ a_{31} & a_{32} & 3a_{33} \end{bmatrix} $$
Multiplication on the left by
$E_2$ performs the elementary row operation of multiplying the third row by 3, while multiplication on the right by$E_2$ performs the elementary column operation of multiplying the third column by 3. -
Type 3: An elementary matrix of type 3 is a matrix obtained from
$I$ by adding a multiple of one row to another row.For example:
The matrix: $$ E_3 = \begin{bmatrix} 1 & 0 & 3 \ 0 & 1 & 0 \ 0 & 0 & 1 \end{bmatrix} $$ is an elementray matrix of type 3. If A is a
$3 \times 3$ matrix, then $$ E_3 A = \begin{bmatrix} a_{11} + 3a_{31} & a_{12} + 3a_{32} & a_{13} + 3a_{33} \ a_{21} & a_{22} & a_{23} \ a_{31} & a_{32} & a_{33} \end{bmatrix}A E_3 = \begin{bmatrix} a_{11} & a_{12} & 3a_{11} + a_{13} \ a_{21} & a_{22} & 3a_{21} + a_{23} \ a_{31} & a_{32} & 3a_{31} + a_{33} \end{bmatrix} $$ Multiplication on the left by
$E_3$ adds 3 times the third row to the first row. Multiplication on the right adds 3 times the first column to the third column.
Theorem 6 If
Definition 15 A matrix
(The following properties of row equivalent matrices are easily established:
- If
$A$ is row equivalent to$B$ , then$B$ is row equivalent to$A$ . - If
$A$ is row equivalent to$B$ , and$B$ is row equivalent to$C$ , then$A$ is row equivalent to$C$ .)
Theorem 7 (Equivalent Conditions for Nonsingularity) Let
-
$A$ is nonsingular. -
$Ax = 0$ has only the trivial solution 0. -
$A$ is row equivalent to$I$ .
Corollary 1 The system
For example:
Compute
$A^{-1}$ if: $$ A = \begin{bmatrix} 1 & 4 & 3 \ -1 & -2 & 0 \ 2 & 2 & 3 \end{bmatrix} $$ Solution: $$ \left[\begin{array}{ccc|ccc} 1 & 4 & 3 & 1 & 0 & 0 \ -1 & -2 & 0 & 0 & 1 & 0 \ 2 & 2 & 3 & 0 & 0 & 1 \ \end{array}\right] \rightarrow \left[\begin{array}{ccc|ccc} 1 & 4 & 3 & 1 & 0 & 0 \ 0 & 2 & 3 & 1 & 1 & 0 \ 0 & -6 & -3 & -2 & 0 & 1 \ \end{array}\right] \rightarrow \left[\begin{array}{ccc|ccc} 1 & 4 & 3 & 1 & 0 & 0 \ 0 & 2 & 3 & 1 & 1 & 0 \ 0 & 0 & 6 & 1 & 3 & 1 \ \end{array}\right] \rightarrow \ \left[\begin{array}{ccc|ccc} 1 & 4 & 0 & \frac{1}{2} & -\frac{3}{2} & -\frac{1}{2} \ 0 & 2 & 0 & \frac{1}{2} & -\frac{1}{2} & -\frac{1}{2} \ 0 & 0 & 6 & 1 & 3 & 1 \ \end{array}\right] \rightarrow \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & -\frac{1}{2} & -\frac{1}{2} & \frac{1}{2} \ 0 & 2 & 0 & \frac{1}{2} & -\frac{1}{2} & -\frac{1}{2} \ 0 & 0 & 6 & 1 & 3 & 1 \ \end{array}\right] \rightarrow \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & -\frac{1}{2} & -\frac{1}{2} & \frac{1}{2} \ 0 & 1 & 0 & \frac{1}{4} & -\frac{1}{4} & -\frac{1}{4} \ 0 & 0 & 1 & \frac{1}{6} & -\frac{1}{2} & -\frac{1}{6} \ \end{array}\right] $$ Thus, $$ A^{-1} = \begin{bmatrix} -\frac{1}{2} & -\frac{1}{2} & \frac{1}{2} \ \frac{1}{4} & -\frac{1}{4} & -\frac{1}{4} \ \frac{1}{6} & \frac{1}{2} & \frac{1}{6} \end{bmatrix} $$
An
For example:
The matrix: $$ \begin{bmatrix} 3 & 2 & 1 \ 0 & 2 & 1 \ 0 & 0 & 5 \end{bmatrix} $$ is upper triangular.
The matrix: $$ \begin{bmatrix} 1 & 0 & 0 \ 6 & 0 & 0 \ 1 & 4 & 3 \end{bmatrix} $$ is lower triangular.
An
For example:
The matrices:
$$ \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix}, \begin{bmatrix} 1 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 1 \end{bmatrix}, \begin{bmatrix} 0 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 0 \end{bmatrix} $$ are all diagonal.
If an
If the matrix
In general, if an
For example:
Let: $$ A = \begin{bmatrix} 2 & 4 & 2 \ 1 & 5 & 2 \ 4 & -1 & 9 \end{bmatrix} $$ and let us use only [row operation 3](#Elementary Row Operations) to carry out the reduction process. At the first step, we subtract
$\frac{1}{2}$ times the first row from the second and then we subtract twice the first row from the third. $$ \begin{bmatrix} 2 & 4 & 2 \ 1 & 5 & 2 \ 4 & -1 & 9 \end{bmatrix} \rightarrow \begin{bmatrix} 2 & 4 & 2 \ 0 & 3 & 1 \ 0 & -9 & 5 \end{bmatrix} $$ To keep track of the multiples of the first row that were subtracted, we set$l_{21} = \frac{1}{2}$ and$l_{31} = 2$ . We complete the elimination process by eliminating the -9 in the ($3, 2$ ) position. $$ \begin{bmatrix} 2 & 4 & 2 \ 0 & 3 & 1 \ 0 & -9 & 5 \end{bmatrix} \rightarrow \begin{bmatrix} 2 & 4 & 2 \ 0 & 3 & 1 \ 0 & 0 & 8 \end{bmatrix} $$ Let$l_{32} = -3$ , the multiple of the second row subtracted from the third row. If we call the resulting matrix$U$ and set $$ L = \begin{bmatrix} 1 & 0 & 0 \ l_{21} & 1 & 0 \ l_{31} & l_{32} & 1 \end{bmatrix}\begin{bmatrix} 1 & 0 & 0 \ \frac{1}{2} & 1 & 0 \ 2 & -3 & 1 \end{bmatrix} $$ then it is easily verified that $$ LU = \begin{bmatrix} 1 & 0 & 0 \ \frac{1}{2} & 1 & 0 \ 2 & -3 & 1 \end{bmatrix} \begin{bmatrix} 2 & 4 & 2 \ 0 & 3 & 1 \ 0 & 0 & 8 \end{bmatrix}
\begin{bmatrix} 2 & 4 & 2 \ 1 & 5 & 2 \ 4 & -1 & 9 \end{bmatrix} = A $$
In general, if A is an
Let A be an
Given two vectors
\begin{bmatrix} y_1 \ y_2 \ \vdots \ y_n \end{bmatrix}
=
x_1 y_1 + x_2 y_2 + \cdots + x_n y_n $$ This type of product is referred to as a scalar product or an inner product.
The matrix product
\begin{bmatrix} y_1 & y_2 & \cdots & y_n \end{bmatrix}
=
\begin{bmatrix}
x_1 y_1 & x_1 y_2 & \cdots & x_1 y_n \
x_2 y_1 & x_2 y_2 & \cdots & x_2 y_n \
\vdots \
x_n y_1 & x_n y_2 & \cdots & x_n y_n \
\end{bmatrix}
$$
The product
For example:
If: $$ x = \begin{bmatrix} 4 \ 1 \ 3 \end{bmatrix} $$ and $$ y = \begin{bmatrix} 3 \ 5 \ 2 \end{bmatrix} $$ then $$ xy^T = \begin{bmatrix} 4 \ 1 \ 3 \end{bmatrix} \begin{bmatrix} 3 & 5 & 2 \end{bmatrix}
\begin{bmatrix} 12 & 20 & 8 \ 3 & 5 & 2 \ 9 & 15 & 6 \end{bmatrix} $$ Note that each row is a multiple of (3, 5, 2) and each column is a multiple of
$x$ .
Suppose that we start with an $m \times n$ matrix $X$ and a $k \times n$ matrix $Y$ . We can then form a matrix product $XY^T$ . If we partition $X$ into columns and $Y^T$ into rows and perform the block multiplication, we see that $XY^T$ can be represented as a sum of outer products of vectors:
$$
XY^T =
\begin{bmatrix}
x_1 & x_2 & \cdots & x_n
\end{bmatrix}
\begin{bmatrix}
y_{1}^{T} \
y_{2}^{T} \
\vdots \
y_{n}^{T}
\end{bmatrix}
x_1 y_{1}^{T} + x_2 y_{2}^{T} + \cdots + x_n y_{n}^{T} $$ This representation is referred to as an outer product expansion.
For example:
Given $$ X = \begin{bmatrix} 3 & 1\ 2 & 4\ 1 & 2 \end{bmatrix} \text{ and } Y = \begin{bmatrix} 1 & 2\ 2 & 4\ 3 & 1 \end{bmatrix} $$ compute the outer product expansion of
$XY^T$ .SOLUTION $$ \begin{equation}\begin{split} XY^T &= \begin{bmatrix} 3 & 1\ 2 & 4\ 1 & 2 \end{bmatrix} \begin{bmatrix} 1 & 2 & 3 \ 2 & 4 & 1 \end{bmatrix} \
&= \begin{bmatrix} 3\ 2\ 1 \end{bmatrix} \begin{bmatrix} 1 & 2 & 3 \end{bmatrix} + \begin{bmatrix} 1\ 4\ 2 \end{bmatrix} \begin{bmatrix} 2 & 4 & 1 \end{bmatrix} \
&= \begin{bmatrix} 3 & 6 & 9 \ 2 & 4 & 6 \ 1 & 2 & 3 \end{bmatrix} + \begin{bmatrix} 2 & 4 & 1 \ 8 & 16 & 4 \ 4 & 8 & 2 \end{bmatrix} \end{split}\end{equation} $$
Implement (by numpy):
import numpy as np
# arumented matrix example
def calc_arumented_matrix():
# 4x_1 - 3x_2 = 4
# 2/3 x_1 + 4x_2 = 3
A = np.array([[4, 3], [2/3, 4]], dtype=float)
B = np.array([4, 3], dtype=float)
x = np.linalg.solve(A, B)
print(x)
calc_arumented_matrix() # [0.5 0.66666667]
# matrix multiple example
def calc_mat_mul():
A = np.array([[3, 5, 1],
[-2, 0, 2]])
B = np.array([[2, 1],
[1, 3],
[4, 1]])
if not A.shape[1] == B.shape[0]:
raise ValueError("Cannot multiply: number of columns in A must equal number of rows in B.")
result = np.dot(A, B)
print(result) # [[15 19]
# [ 4 0]]
calc_mat_mul()
# matrix additGraph the lines and determine geometrically the number of solutions $$ x_1 + x_2 = 4 \ x_1 - x_2 = 2 $$ Implement (by matplot and numpy):
import numpy as np
import matplotlib.pyplot as plt
# support for negative sign in plot
plt.rcParams['axes.unicode_minus'] = False
# create a range of x1 values to plot the equations
x1 = np.linspace(-5, 10, 100)
# x1 + x2 = 4 => x2 = 4 - x1
# x1 - x2 = 2 => x2 = x1 - 2
x2_eq1 = 4 - x1
x2_eq2 = x1 - 2
# create a plot to visualize the two equations and their intersection point
plt.figure(figsize=(8, 6))
# plot the two lines representing the equations
plt.plot(x1, x2_eq1, label='x₁ + x₂ = 4', linewidth=2, color='blue')
plt.plot(x1, x2_eq2, label='x₁ - x₂ = 2', linewidth=2, color='red')
# mark the solution point where the two lines intersect
# x1 = 3, x2 = 1
x1_solution = 3
x2_solution = 1
plt.plot(x1_solution, x2_solution, 'go', markersize=10, label=f'result: ({x1_solution}, {x2_solution})')
# plot arrows to indicate the solution point
plt.annotate(f'({x1_solution}, {x2_solution})',
xy=(x1_solution, x2_solution),
xytext=(x1_solution+0.5, x2_solution+0.5),
arrowprops=dict(arrowstyle='->', color='green'))
# set the limits and labels for the plot
plt.grid(True, alpha=0.3)
plt.xlabel('x₁', fontsize=12)
plt.ylabel('x₂', fontsize=12)
plt.title('the illustration of the solution', fontsize=14)
# set the limits for x and y axes to better visualize the intersection point
plt.xlim(-2, 8)
plt.ylim(-3, 7)
# customize the axes to pass through the origin (0, 0)
ax = plt.gca()
ax.spines['left'].set_position('zero')
ax.spines['bottom'].set_position('zero')
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
plt.legend()
plt.show()For a homogeneous linear system consisting of two equations in three unknowns: $$ x_1 + x_2 + x_3 = 0 \ x_1 - x_2 - x_3 = 0 $$ Implement (by matplot and numpy):
import numpy as np
import matplotlib.pyplot as plt
# Create figure
fig = plt.figure(figsize=(10, 8))
ax = fig.add_subplot(111, projection='3d')
# Grid
x = np.linspace(-5, 5, 40)
y = np.linspace(-5, 5, 40)
X, Y = np.meshgrid(x, y)
# Planes
# x1 + x2 + x3 = 0
Z1 = -X - Y
# x1 - x2 - x3 = 0
Z2 = X - Y
# Draw planes
plane1 = ax.plot_surface(X, Y, Z1, alpha=0.6)
plane2 = ax.plot_surface(X, Y, Z2, alpha=0.6)
# Intersection line
t = np.linspace(-5, 5, 100)
x_line = np.zeros_like(t)
y_line = -t
z_line = t
ax.plot(x_line, y_line, z_line, linewidth=3)
# Add equation labels onto the planes
ax.text(
2, 2, -4,
r'$x_1 + x_2 + x_3 = 0$',
fontsize=12
)
ax.text(
2, -2, 4,
r'$x_1 - x_2 - x_3 = 0$',
fontsize=12
)
# Add intersection line label
ax.text(
0, -4, 4,
r'Intersection Line',
fontsize=12
)
# Axis labels
ax.set_xlabel(r'$x_1$')
ax.set_ylabel(r'$x_2$')
ax.set_zlabel(r'$x_3$')
# Title
ax.set_title('Visualization of Two Linear Equations')
plt.show()[1] Steven J. Leon. LINEAR ALGEBRA with Applications. 10ED