Lecture 4 - Determinants - Matrices - Eigen Values and Vectors
Lecture 4 - Determinants - Matrices - Eigen Values and Vectors
Lecture 4
Determinants
Matrices
Eigen Values & Eigen Vectors
1
Determinants
2
Introduction to Determinants
Determinants are powerful tools for solving systems of linear equations and they are indispensable in
the development of matrix theory.
3
Introduction to Determinants
1. Systems of Linear Equations
Solution of Two Linear Equations
a1x + b1y = d1, (1)
a2x + b2y = d2, (2)
multiply (1) by b2 and (2) by b1, and then take the difference → y is eliminated
(b2a1 − b1a2)x = b2d1 − b1d2,
4
Introduction to Determinants
1. Systems of Linear Equations
Solution of Two Linear Equations
It turns out that if we use the following notation, it is much easier to generalize this process to
larger systems of n × n equations
Its meaning is just that its value is equal to the right-hand side of this equation.
Explicitly, the value of a second-order determinant is defined as the difference
between the two products of the diagonal elements as shown in the schematic
diagram
6
Introduction to Determinants
1. Systems of Linear Equations
Solution of Two Linear Equations
Example 1. Find the solution of
2x − 3y = −4,
6x − 2y = 2.
Solution:
7
Introduction to Determinants
2. Properties of Second-Order Determinants
1. If the rows and columns are interchanged, the determinant is unaltered,
2. If two columns (or two rows) are interchanged, the determinant changes sign,
8
Introduction to Determinants
9
Introduction to Determinants
(6) (7)
10
Introduction to Determinants
we have
(8)
(9)
11
Introduction to Determinants
(12)
(14)
12
Introduction to Determinants
13
2. Solution of Three Linear Equations
Using the determinant notation, one can easily
show that Nx in (11) is equal to:
and get
The determinant D is called the determinant of the coefficients. It is formed with the array of
the coefficients on the left-hand sides of (3)–(5).
To find Nx, start with D, erase the x coefficients a1, a2, & a3, and replace them with the
constants d1, d2, and d3 from the right-hand sides of the equations. Similar to Ny & Nz.
14
Introduction to Determinants
15
Introduction to Determinants
2.Solution of Three Linear Equations
Solution of example 2:
Thus:
16
Practice
17
Matrices
18
Introduction
• Matrices have many important uses.
• One of the simplest uses of matrices is to store data.
• In fact, this is the most common use outside mathematics.
• Matrices are used to solve linear systems and represent geometric figures and
transformations. Building on this geometric interpretation, matrices can also be applied in
the study of trigonometry.
• Matrices are a powerful unifying concept, connecting ideas in mathematics to those in other
content domains as well as connecting various branches of mathematics. As such, matrices
can be a means of integrated whole rather than a set of isolated topics.
• Matrices introduce a fundamental concept in discrete mathematics.
• They model numerous realistic applications.
• They furnish opportunities for doing arithmetic and algebraic computation in a new context.
• Their properties and their operations lead to important theoretical results.
19
19
Storing and organizing numerical data
20
20
Storing and: organizing numerical data
Example
Type Friction Textbooks General Reference 25 47 22 30
Malay 25 47 22 30
40 72 38 40
80 85 67 54
Chinese 40 72 38 40
English 80 85 67 54
3 4 Matrix
The element aij are the entries of the matrix. The subscript on the entry aij indicates
that it is in the ith row and the jth column.
n columns
We say the matrix has dimension m x n.
When m = n, A is called a square matrix.
22
The order of a matrix
Consider the following examples of matrices:
• The order is not a number, but an expression involving two positive integers and
the symbol .
• The order of the matrix A is 2 × 3,
• while the order of the matrix B is 3 × 2.
• The numbers m and n are sometimes called the dimensions of the matrix.
23
TYPES OF MATRICES
NAME DESCRIPTION EXAMPLE
25
Vectors - Notation and Terminology
Vectors are special kinds of matrices, but we will use a different notation for them:
This is also the notation that you should use in your notes, quizzes, and tests.
26
Columns of a matrix
Consider an m × n matrix
27
A matrix of column vectors
Consider an m × n matrix
and let
28
Some new concepts:
◼ Diagonal matrix:
d1 0 0
0 d 0
A = diag (d1 , d 2 ,, d n ) = 2
M nn
0 0 d n
◼ Trace:
If A = [aij ]nn
Then Tr ( A) = a11 + a22 + + ann
29
Matrices and
Systems of Linear Equations
30
Introduction
In this section, we express a linear system by a matrix.
31
The Augmented Matrix
of a Linear System
32
Augmented Matrix
We can write a system of linear equations as a matrix by writing only the
coefficients and constants that appear in the equations.
33
Augmented Matrix
Here is an example.
3 x − 2y + z = 5 3 −2 1 5
1 3 −1 0
x + 3y − z = 0
− x + 4z = 11 −1 0 4 11
Notice that a missing variable in an equation corresponds to a 0 entry in the
augmented matrix.
34
34
Ex. 1—Finding Augmented Matrix of Linear System
Write the augmented matrix of the system of
equations.
6 x − 2 y − z = 4
x + 3z = 1
7y + z = 5
35
35
Ex. 1—Finding Augmented Matrix of Linear System
6 −2 −1 4
1 0 3 1
0 7 1 5
36
Elementary Row Operations
37
Elementary Row Operations
38
Elementary Row Operations—Notation
We use the following notation to describe the elementary
row operations:
Symbol Description
Change the ith row by adding
Ri + kRj → Ri k times row j to it.
Then, put the result back in row i.
39
Gaussian
Elimination
40
Row-Echelon Form
A matrix is in row-echelon form if it satisfies the
following conditions.
1. The first nonzero number in each row (reading from left to
right) is 1.
This is called the leading entry.
2. The leading entry in each row is to the right of
the leading entry in the row immediately above it.
3. All rows consisting entirely of zeros are at
the bottom of the matrix.
4. Every number above and below each leading entry is a 0.
41
Not in Row-Echelon Form
Not in row-echelon form:
0 1 − 21 0 7
1 0 3 4 −5
0 0 0 1 0.4
0 1 1 0 0
1 4 4 2 4 4 3
Leading 1's do not
shift to the right
in successive rows.
42
Row-Echelon & Reduced Row-Echelon Forms
43
Putting in Row-Echelon Form—Step 1, 2, 3
Start by obtaining 1 in the top left corner.
1
Then, obtain zeros below that 1 by adding 0
appropriate multiples of the first row to the rows 0
below it.
Next, obtain a leading 1 in the next row.
Then, obtain zeros below that 1.
• At each stage, make sure every leading entry is
to the right of the leading entry in the row above it.
• Rearrange the rows if necessary.
1 1
0 → 0 1
0 0 0
44
Putting in Row-Echelon Form—Step 4
1 1 1
0 → 0 1 → 0 1
0 0 0 0 0 1
45
Gaussian Elimination
Once an augmented matrix is in row-
echelon form, we can solve the
corresponding linear system using back-
Johann Carl Friedrich Gauss
substitution. Born: 30 April 1777 @ Brunswick,
Duchy of Brunswick (now Germany)
→ This technique is called Gaussian elimination, in Died: 23 February 1855
Göttingen, Hanover (now Germany)
honor of its inventor, the German mathematician C. worked in a wide variety of fields in
both mathematics and physics
incuding number theory, analysis,
F. Gauss. differential geometry, geodesy,
magnetism, astronomy and optics.
His work has had an immense
influence in many areas.
46
Solving a System Using Gaussian Elimination
1. Augmented matrix
2. Row-echelon form
3. Back-substitution
47
Solving a System Using Gaussian Elimination
1. Augmented matrix
Write the augmented matrix of the system.
To solve a system 2. Row-echelon form
using Gaussian Use elementary row operations to change
elimination, we the augmented matrix to row-echelon
use: form.
3. Back-substitution
Write the new system of equations that
corresponds to the row-echelon form of
the augmented matrix and solve by
back-substitution.
48
Ex—Solving a System Using Row-Echelon Form
Solve the system of linear equations using Gaussian elimination.
4 x + 8 y − 4z = 4
3 x + 8y + 5z = − 11
− 2x + y + 12z = − 17
We first write the augmented matrix of the system.
Then, we use elementary row operations to put it
in row-echelon form.
49
Ex-Solving a System Using Row-Echelon Form
1
R2
2
R3 – 5R2 → R3
1
− R3
10
50
Ex-Solving a System Using Row-Echelon Form
We now have an equivalent matrix in row-echelon form.
The corresponding system of equations is:
x + 2y − z = 1
y + 4z = −7
z = −2
We use back-substitution to solve the system.
y + 4(–2) = –7
y=1
x + 2(1) – (–2) = 1
x = –3
51
Modeling with
Linear Systems
52
Modeling with Linear Systems
Linear equations—often containing hundreds or even thousands of
variables—occur frequently in the applications of algebra to the sciences
and to other fields.
→ For now, let’s consider an example that involves only three variables.
53
Ex-Nutritional Analysis
• 500 mg of potassium
• 75 g of protein
• 1150 units of vitamin D
54
Ex—Nutritional Analysis
The amounts of these nutrients in one ounce of each food are given here.
How many ounces of each food should the subject eat every day
to satisfy the nutrient requirements exactly?
55
Ex—Nutritional Analysis
Let x, y, and z represent the number of ounces of MiniCal, LiquiFast, and
SlimQuick, respectively, that the subject should eat every day.
56
Ex-Nutritional Analysis
Based on the requirements of the three nutrients, we get the system
50 x + 75y + 10z = 500 Potassium
5 x + 10 y + 3z = 75 Protein
90 x + 100 y + 50z = 1150
Vitamin D
Dividing the first equation by 5 and the third by 10 gives the system
10 x + 15y + 2z = 100
5 x + 10y + 3z = 75
9 x + 10y + 5z = 115
• We can solve this using Gaussian elimination.
• Alternatively, we could use a graphing calculator to find the reduced row-
echelon form of the augmented matrix of the system.
57
The Algebra of Matrices
58
The Algebra of Matrices
• Thus far, we’ve used matrices simply for notational convenience when
solving linear systems.
• Matrices have many other uses in mathematics and the sciences.
• For most of these applications, we need to know about matrix algebra.
• Like numbers, matrices can be added, subtracted, multiplied, and
divided.
59
Equality of Matrices
60
Equality of Matrices
Two matrices are equal if they have the same entries in the
same positions.
4 22 e 0 2 4 1 1 2
= 1 2 3 4 1 3 5
0.5 1 1 − 1 2 2 0 2 4 6
5 6
61
Equality of Matrices
• The matrices A = [aij] & B = [bij] are equal if and only if:
• They have the same dimension m × n.
• Corresponding entries are equal.
That is,
aij = bij
for i = 1, 2, . . . , m
and j = 1, 2, . . . , n.
62
Ex—Equal Matrices
Find a, b, c, and d, if
a b 1 3
c d = 5 2
Since the two matrices are equal, corresponding entries must be the same.
So, we must have:
a = 1, b = 3, c = 5, d = 2
63
Addition, Subtraction,
and
Scalar Multiplication of
Matrices
64
Addition and Subtraction of Matrices
• Two matrices can be added or subtracted if they have the same
dimension.
65
Scalar Multiplication of Matrices
• To multiply a matrix by a number, we multiply
every element of the matrix by that number.
• This is called the scalar product
66
Sum, Difference, and Scalar Product of Matrices
Let: A = [aij] and B = [bij] be matrices of the same dimension m x n. And,
c be any real number.
67
Sum of Matrices
The sum A + B is the m x n matrix obtained by adding corresponding entries of A and
B. A + B = [aij + bij]
68
Difference of Matrices
The difference A – B is the m x n matrix obtained by
subtracting corresponding entries of A and B.
A – B = [aij – bij]
69
Scalar Product of Matrices
The scalar product cA is the m x n matrix obtained by multiplying each
entry of A by c.
cA = [caij]
70
Properties of Addition and Scalar Multiplication
• Let A, B, and C be m x n matrices and
• Let c and d be scalars.
71
Ex—Solving a Matrix Equation
Solve the matrix equation
2X – A = B
for the unknown matrix X, where:
2 3 4 −1
A= B=
−5 1 1 3
72
Multiplication of
Matrices
73
Multiplication of Matrices
74
Multiplication of Matrices
• First, the product AB (or A · B) of two matrices A and B is defined
only when
• The number of columns in A is equal to the number of rows in B.
• To multiply a matrix times a matrix, we write
AB (A times B)
• This is pre-multiplying B by A, or post-multiplying A by B.
75
Multiplication of Matrices
This means that, if we write their dimensions side by side, the two inner
numbers must match:
Matrices A B
Dimensions mxn nxk
Columns in A Rows in B
So,
A B = C
(m n) (n p) = (m p)
76
Inner Product
If a1 a2 L an is a row of A, and
if b1 is a column of B,
b
2
M
bn
77
Matrix Multiplication
• If A = [aij] is an m × n matrix and B = [bij] an n × k matrix, their
product is the m × k matrix
C = [cij]
• where cij is the inner product of the ith row of A and the jth
column of B.
• We write the product as C = AB
• This definition of matrix product says that each entry in the matrix AB is
obtained from a row of A and a column of B, as follows.
78
Multiplication of Matrices
• The entry cij in the ith row and jth column of the matrix AB is obtained by:
• Multiplying the entries in the ith row of A with the corresponding entries in
the jth column of B.
• Adding the results.
W
W W W W = cij
W
79
Multiplication of Matrices
80
Ex—Multiplying Matrices
Let
1 3 −1 5 2
A= and B =
−1 0 0 4 7
81
Properties of
Matrix
Multiplication
82
Properties of Matrix Multiplication
Although matrix multiplication is not commutative, it does obey the Associative
and Distributive Properties.
83
Properties of Matrix Multiplication
Let A, B, and C be matrices for which the following products
are defined.
A(BC) = (AB)C Associative
Property
A(B + C) = AB + AC Distributive
(B + C)A = BA + CA Property
84
Special matrices
a11 0 0 0
0 a 0 0
22
0 0 a33 0
0 0 0 a44
85
Identity Matrix
AI=A
86
86
Null Matrix
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
87
87
The Transpose of a Matrix: A'
88
Computer Graphics
89
Computer Graphics
90
Pixels
• For example, in a 256-level gray-scale image, each pixel is assigned a
value between 0 and 255.
• 0 represents white.
• 255 represents black.
• The numbers in between represent increasing gradations of gray.
91
Gray Scale
• The gradations of a much simpler 8-level gray scale are
shown.
92
Digitizing Images
To digitize the black and white image shown, we place a grid over
the picture.
93
Digitizing Images
94
94
Digitizing Images
• The values are stored in the matrix shown.
• The digital image corresponding to this matrix is shown in the
accompanying image.
95
Digitizing Images
Here, we summarize the process.
96
Inverses of
Matrices and
Matrix Equations
97
Inverse of a Matrix—Definition
98
Inverse of a 2 x 2 Matrix
a b
If A=
c d
−1 1 d −b
A =
then ad − bc −c a
Find A–1
100
Finding the Inverse
of an n × n Matrix
101
Finding the Inverse of an n × n Matrix
If A is an n × n matrix, we first construct the n × 2n matrix that has the
entries of A on the left and of the identity matrix In on the right:
102
Finding the Inverse of an n × n Matrix
We then use the elementary row operations on this new large matrix to change the
left side → the identity matrix.
→ This means that we are changing the large matrix to reduced row-echelon form.
103
Finding the Inverse of an n × n Matrix
• The right side is transformed automatically into A–1.
• We omit the proof of this fact.
104
Ex—Finding the Inverse of a 3 × 3 Matrix
Let A be the matrix
1 −2 −4
A = 2 −3 −6
−3 6 15
Find A–1.
105
Matrix Equations
106
Matrix Equations
For example, the system
x − 2y − 4z = 7
2 x − 3 y − 6z = 5
−3 x + 6 y + 15z = 0
is equivalent to the matrix equation
1 −2 −4 x 7
2 −3 −6 y = 5
−3 6 15 z 0
107
Coefficient Matrix
• If we let
1 −2 −4 x 7
A = 2 −3 −6 X = y B = 5
−3 6 15 z 0
108
Matrix Equations
We solve this matrix equation by multiplying each side by
the inverse of A—provided the inverse exists.
AX = B
A–1(AX) = A–1B
(A–1A)X = A–1B Associative Property
I3X = A–1B Property of Inverses
X = A–1B
109
Matrix Equations
−3 2 0
−1 2
A = −4 1 − 3
1 0 1
3
110
Matrix Equations
x −3 2 0 7 −11
y = −4 1 − 2 5 = −23
3
z 1 0 1
3
0 7
111
Eigen Values and
Eigen Vectors
112
What are Eigenvalues and Eigenvectors?
113
Eigenvalues
• Let x be an eigenvector of the matrix A. Then there must exist an
eigenvalue λ such that Ax = λx or, equivalently,
Ax - λx = 0 or
(A – λI)x = 0
• If we define a new matrix B = A – λI, then
Bx = 0
• If B has an inverse then x = B-10 = 0. But an eigenvector cannot be
zero.
• Thus, it follows that x will be an eigenvector of A if and only if
B does not have an inverse, or equivalently det(B)=0, or
det(A – λI) = 0
• This is called the characteristic equation of A. Its roots
determine the eigenvalues of A.
114
Eigenvalues: examples
2 − 12
Example: Find the eigenvalues of A =
1 − 5
−2 12
I − A = = ( − 2)( + 5) + 12
−1 +5
= 2 + 3 + 2 = ( + 1)( + 2)
two eigenvalues: −1, − 2
Note: The roots of the characteristic equation can be repeated. That is, λ1 = λ2
=…= λk. If that happens, the eigenvalue is said to be of multiplicity k.
Example 3: Find the eigenvalues of 2 1 0
A = 0 2 0
0 0 2
−2 −1 0
I − A = 0 −2 0 = ( − 2)3 = 0 λ = 2 is an eigenvector
0 0 −2 of multiplicity 3.
115
Eigenvectors
To each distinct eigenvalue of a matrix A there will correspond at least one eigenvector
which can be found by solving the appropriate set of homogenous equations. If λi is an
eigenvalue then the corresponding eigenvector xi is the solution of (A – λiI)xi = 0
Example (cont.):
−3 12 1 −4
= −1: (−1) I − A =
−1 4 0 0
x1 − 4 x2 = 0 x1 = 4t , x2 = t
x1 4
x1 = = t , t 0
x2 1
−4 12 1 −3
= −2 : (−2) I − A =
−1 3 0 0
x1 3
x 2 = = s , s 0
x2 1
116
Properties of Eigenvalues and Eigenvectors
117
Properties of Eigenvalues and Eigenvectors
118
Example
−3 −2
A=
−5 0
119