Matrices
algebra
matrices
A matrix is a rectangular array of numbers arranged in rows and columns.
The array of numbers below is an example of a matrix.
21 62 33 93
44 95 66 13
77 38 79 33
The number of rows and columns that a matrix has is called its dimension or its order. By
convention, rows are listed first; and columns, second. Thus, we would say that the
dimension (or order) of the above matrix is 3 x 4, meaning that it has 3 rows and 4 columns.
Numbers that appear in the rows and columns of a matrix are called elements of the
matrix. In the above matrix, the element in the first column of the first row is 21; the
element in the second column of the first row is 62; and so on.
Matrix Notation
• Matrix elements- Numbers that appear in the rows and columns of a matrix.
• Bold-face, capital letters refer to matrices, italic capital letters refer to matrix
elements, and subscripts reveal matrix dimension. For example, A and X refer to
matrices A and X, respectively.
• Aij refers to the element in row i and column j of matrix A. Aij refers to an i by j matrix
A.
• A' refers to the transpose of matrix A.
• I refers to an identity matrix.
• In refers to an n x n identity matrix.
• 1 refers to the sum vector, a column vector having all of its elements equal to one.
• 1n is a 1 x n sum vector.
• |A| refers to the determinant of matrix A.
.
How to Add and Subtract
Matrices
• Two matrices may be added or subtracted only if they have the same dimension;
that is, they must have the same number of rows and columns.
• Addition or subtraction is accomplished by adding or subtracting corresponding
elements. For example, consider matrix A and matrix B.
A Determinant is a real number associated
with a matrix. Only SQUARE matrices have
a determinant.
The symbol for a determinant can be the
phrase “det” in front of a matrix variable,
det(A); or vertical bars around a matrix, |A|
3 1
or
2 4
To find the determinant of a 2 x 2
matrix, multiply diagonal #1 and
subtract the product of diagonal #2.
Diagonal 2 = -2
3 1
12 ( 2) 14
2 4
Diagonal 1 = 12
To find the determinant of a 3 x 3
matrix, first recopy the first two
columns. Then do 6 diagonal
products. 18 60 16
5 2 6 5 2
2 1 4 2 1
3 3 4 3 3
-20 -24 36
The determinant of the matrix is the
sum of the downwards products minus
the sum of the upwards products.
18 60 16
5 2 6 5 2
2 1 4 2 1 = (-8) - (94) = -102
3 3 4 3 3
-20 -24 36
EVALUATE
2 1 3
2 0 1
1 2 4
Solution:
2 1 3 2 1
2 0 12 0
1 2 4 1 2
[0 ( 1) ( 12)] (0 4 8)
13 12
25
Other method
Identity Matrices
An identity matrix is a square matrix that has 1’s
along the main diagonal and 0’s everywhere
else.
1 0 0
0 1 0 1 0
0 1
0 0 1
When you multiply a matrix by the
identity matrix, you get the original
matrix.
Inverse Matrices
When you multiply a matrix and its
inverse, you get the identity matrix.
3 1 2 1 1 0
5 2 5 3 0 1
Properties of the Inverse
• (A-1)-1 = A
• (AB)-1 = B-1 A-1
• (AT)-1 = (A-1)T
• (λA)-1 = (1/ λ) A-1
• The inverse of a matrix is unique.
• The inverse of a nonsingular symmetric matrix is symmetric.
• The inverse of a nonsingular upper or lower triangular matrix
is again upper or lower triangular matrix respectively.
• If A is nonsingular then we define A-n = (A-1)n
Inverse Matrices
Not all matrices have an inverse!
To find the inverse of a 2 x 2 matrix, first find the
determinant.
a) If the determinant = 0, the inverse does not exist!
The inverse of a 2 x 2 matrix is the reciprocal of the
determinant multiplied by the matrix with the main
diagonal swapped and the other terms multiplied by -1.
INVERSE MATRIX
a b
A
c d
is
1 d
1
b
A
c
A a
1 1 d b
A
c
ad cb a
provided
ad cb 0
Inverse Matrices
Example 1: A 3 1
5 2
det(A) 6 (5) 1
11 2 1 2 1
A
1 5 3 5 3
Inverse Matrices
2 2
Example 2: B
5 4
det(B) ( 8) ( 10) 2
11 4 2 2 1
B 5
2 5 2 2 1
SOLVING A LINEAR SYSTEM
-3x + 4y = 5
2x - y = -10
Writing the original matrix equation.
Solution order
A X B
AX = B
3 4
x 5
A-1AX = A-1B
2 1y 10
IX = A-1B
X = A-1B
USING INVERSE MATRIX TO SOLVE THE
LINEAR SYSTEM
-3x + 4y = 5
2x - y = -10
1 4
1 1 1 4 5 5
A 2 3
3 8 2 3
5 5
1 4
1
5 5 5 7 x
X A B
2 3 10 4 y
5 5
Hence the solution of the system is (-7,-4)
Matrix Equations
●Example: Solve the system
3x - 2y = 9 3 2 x 9
x + 2y = -5 1 2 y 5
1
3 2 1 2 2
1 2
8 1 3
x 1 2 2 9
y 8 1 3 5
Matrix Equations
●Example, continued:
x 1 2 2 9
y 8 1 3 5
Multiply the matrices (a ‘2 x 2’ times a
‘2 x 1’) first, then distribute the scalar.
x 1 8
y 8 24
x 1
y 3
3x3 matrix inversion steps
1. Find det(A)
2. If det(A) = 0, then A has no inverse.
If det(A) ≠ 0, then there is inverse
3. Find the transpose AT by interchanging the rows and columns
4. find adj(A) - Replace each element in AT by its cofactors – by its minor
together with its associated place sign (+ - + ) i.e. we define the minor Mij of
(A)ij to be the determinant of the 2 x 2 matrix which remains when the ith
row and jth column (i.e. the row and column containing (A)ij ) are deleted
from A
5. The inverse of A is then given by
Matrix Equations or a 3x3 system
●Step 1: Write the system as a matrix equation. A
three-equation system is shown below.
a1 x b1 y c1z C1 a1 b1 c1 x C1
a b2
c2 y C2
a2 x b2 y c2 z C2 2
a3 b3 c3 z C3
a3 x b3 y c3 z C3
Matrix Equations
●Step 2: Find the inverse of the
coefficient matrix.
Following the rules of matrix inversion
Matrix Equations
●Step 3: Multiply both sides of the matrix equation by
the inverse.
The inverse of the coefficient matrix times the coefficient
matrix equals the identity matrix.
1
x a1 b1 c1 C1
y a b c C
2 2 2 2
z a3 b3 c3 C3
Again Note: The multiplication order on the right
side is very important. We cannot multiply a 3 x 1
times a 3 x 3 matrix!
Example
• Solve the system of linear equations
2x y z 1
3x 2 y z 2
2 x y 2 z 1
Solution
• Write the system of equations in the form AX = B where
2 1 1 x 1
A 3 2 1 X y B 2
2 1 2 z 1
Example
• Solve the system of linear equations
2x y z 1
3x 2 y z 2
2 x y 2 z 1
Solution
• Find the inverse matrix of A:
2 1 1 x 1 3 1 1
A 3 2 1 X y B 2 A 1 4 2 1
2 1 2 z 1 1 0 1
Example
• Solve the system of linear equations
2x y z 1
3x 2 y z 2
2 x y 2 z 1
Solution
• Finally, we write the matrix equation X = A–1B and
multiply: x 3 1 1 1
y 4 2 1 2
z 1 0 1 1
Example
• Solve the system of linear equations
2x y z 1
3x 2 y z 2
2 x y 2 z 1
Solution
• Finally, we write the matrix equation X = A–1B and multiply:
x (3)(1) ( 1)(2) ( 1)( 1) 2
y ( 4)(1) (2)(2) (1)( 1) 1
z ( 1)(1) (0)(2) (1)( 1) 2
• Thus, the solution is x = 2, y = –1, and z = –2.
Matrix Equations
•Example #2: Solve the 3 x 3 system
3x - 2y + z = 9 3 2 1 x 9
1 2 2 y 5
x + 2y - 2z = -5
x + y - 4z = -2 1 1 4 z 2
1
3 2 1 6
23
7
23 2
23
1 2 2
2
23
13
23 7
23
1 1 4 1
23
5
23 8
23
x 6
23
7
23 2
23 9
y 2 13
7 5
23 23 23
z 231 5
23 8
23
2
x 1
y 3
z 0
Cramer’s Rule
● Cramer’s Rule relies on determinants.
1. for the system matrix
2. for the other variables matrix (matrix formed without
the coefficients of the variable under consideration)
● Consider the system below with variables x and y:
a1 x b1 y C1
a2 x b2 y C2
Cramer’s Rule - 2 x 2
The formulae for the values of x and y are shown
below. The numbers inside the determinants are the
coefficients and constants from the equations.
C1 b1 a1 C1
C2 b2 a2 C2
x y
a1 b1 a1 b1
a2 b2 a2 b2
Cramer’s Rule
• Example:
Solve the system: 3x - 2y = 10
4x + y = 6
10 2 3 10
6 1 22 4 6 22
x 2 y 2
3 2 11 3 2 11
4 1 4 1
The solution is
(2, -2)
Cramer’s Rule - 3 x 3
Consider the 3-equation system below with
variables x, y and z:
a1 x b1 y c1z C1
a2 x b2 y c2 z C2
a3 x b3 y c3 z C3
Cramer’s Rule - 3 x 3
The formulae for the values of x, y and z are shown
below. Notice that all three have the same denominator.
C1 b1 c1 a1 C1 c1 a1 b1 C1
C2 b2 c2 a2 C2 c2 a2 b2 C2
C3 b3 c3 a 3 C 3 c3 a3 b3 C3
x y z
a1 b1 c1 a1 b1 c1 a1 b1 c1
a2 b2 c2 a2 b2 c2 a2 b2 c2
a3 b3 c3 a3 b3 c3 a3 b3 c3
●Not all systems have a definite solution. If the
determinant of the coefficient matrix is zero, a solution
cannot be found using Cramer’s Rule due to division by
zero.
●When the solution cannot be determined, one of two
conditions exists:
• The planes graphed by each equation are parallel and there are
no solutions.
• The three planes share one line (like three pages of a book
share the same spine) or represent the same plane, in which
case there are infinite solutions.
●Example:
Solve the system 3x - 2y + z = 9
x + 2y - 2z = -5
x + y - 4z = -2
9 2 1 3 9 1
5 2 2 1 5 2
2 1 4 23 1 2 4 69
x 1 y 3
3 2 1 23 3 2 1 23
1 2 2 1 2 2
1 1 4 1 1 4
• Example, continued: 3x - 2y + z = 9
x + 2y - 2z = -5
x + y - 4z = -2
3 2 9
1 2 5
1 1 2 0
z 0
3 2 1 23 The solution is
1 2 2 (1, -3, 0)
1 1 4