Professional Documents
Culture Documents
1
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Chapter 2 - Learning Objectives
2
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
Matrix – an rectangular array of numbers
1 2 1 2 3 1
(2 1)
3 4 4 5 6 2
Typical m x n matrix
having m rows and n
columns. We refer to a 11 a 12 .... a 1n
m x n as the order of
the matrix. The A a 21 a 22 .... a 2n
number in the ith row .... .... .... ....
and jth column of A is
called the ijth element
of A and is written aij.
a m1 a m2 .... a mn
3
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
Two matrices A = [aij] and B = [bij] are equal if and
only if A and B are the same order and for all i
and j, aij = bij.
If 1 2 and x y
A B
3 4 w z
4
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
Vectors – any matrix with only one column is a
column vector. The number of rows in a
column vector is the dimension of the 1
column vector. An example of a 2 X 1
matrix or a two-dimensional column vector 2
is shown to the right.
5
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
Any m-dimensional
vector (either row or 0
column) in which all the
(0 0 0)
0
elements equal zero is
called a zero vector
(written 0).
Examples are shown to
the right.
6
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
Any m-dimensional vector
corresponds to a directed line X2
(1, 2)
7
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
The scalar product is the result of multiplying two vectors
where one vector is a column vector and the other is a
row vector. For the scalar product to be defined, the
dimensions of both vectors must be the same.
u v u 1 v 1 u 2 v 2 .... u n v n
2
Example: u (1 2 3 ) v 1
2
u v ( 1 2) ( 2 1) ( 3 2) 10
8
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
1 2 3 6
Scalar multiple of a matrix: A 3 A
1 0 3 0
1 2 3
A
0 1 1 1 1 2 2 3 3 0 0 0
C
0 2 1 1 1 1 2 0 0
1 2 3
B
2 1 1
9
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
X2
Addition of vectors (of
same degree). Vectors
may be added using the 3
(3,3)
parallelogram law or by
using matrix addition.
(1,2)
2
u+v
v (2 1 ) u
u (1 2 ) 1
(2,1)
v
u v (2 1 1 2 ) X1
u v (3 3 ) 1 2 3
10
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
Line Segments can be defined
using scalar multiplication X2
and the addition of matrices.
c=1
2
If u = (1,2) and v = (2,1), the c=1/2
line segment joining u and v u
11
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
Transpose of a matrix Example
12
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
Matrix multiplication Example
1 1
Given to matrices A and B, the 1 1 2 B 2 3
A
matrix product of A and B 2 1 3
1 2
(written AB) is defined if and
only if the number of columns
1 1
in A = the number of rows in B. C ( 1 1 2 ) 2 5 C ( 1 1 2 ) 3 8
11 12
The matrix product C = AB of A 1 2
and B is the m x n matrix C 1 1
C ( 2 1 3 ) 2 7 C ( 2 1 3 ) 3 11
whose ijth element is 21 22
determined as follows: 1 2
5 8
Cij = scalar product of row i of C
A x column j of B 7 11
Note: Matrix C will have the same number of rows as A and the same
number of columns as B.
13
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.1 - Matrices and Vectors
Matrix Multiplication with Excel
Step 3 – In the upper left-hand
corner (B8) of this selected
Use the EXCEL MMULT output range type the formula:
function to multiply the matrices:
= MMULT(B1:D2,B4:C6).
1 1 Step 4 - Press CONTROL
1 1 2
A B 2 3 SHIFT ENTER (not just enter)
2 1 3
1 2
A B C D
1 Matrix A 1 -1 2
Step 1 – Enter matrix A into 2 2 1 3
cells B1:D2 and matrix B into 3
cells B4:C6. 4 Matrix B 1 1
5 2 3
Step 2 – Select the output 6 1 2
range (B8:C9) into which the 7
8 AB= 1 2
product will be computed. 9 7 11
14
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.2 – Matrices and Systems of Linear Equations
Consider a system of linear equations a11 x1 a12 x2 .... a1n xn b1
shown to the right. The variables
(unknowns) are referred to as x1, x2, a21 x1 a22 x2 .... a2n xn b1
…, xn while the aij’s and bj’s are
constants. A set of such equations is .... .... .... ....
called a linear system of m equations
in n variables. am1 x1 am2 x2 .... amn xn bm
1
Example Given x where x1 1 x2 2
2
is a solution to the system x1 2x2 5 2x 1 x 2 0
15
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.2 – Matrices and Systems of Linear Equations
16
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.2 – Matrices and Systems of Linear Equations
1 2 x1 5
A x b
2 1 x2 0
1 2 5
A|b is written:
2 1 0
17
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
Using the Gauss-Jordan method, we can show that any system of
linear equations must satisfy one of the following three cases:
18
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
Elementary row operations (ero).
An ero transforms a given matrix A into a new
matrix A’ via one of the following operations:
19
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
Finding a solution using the Gauss-Jordan method.
The Gauss-Jordan method solves a linear equation
system by utilizing ero’s in a systematic fashion.
The steps to use the Gauss-Jordan method (with
an accompanying example) are shown below:
2 2 1 9
Solve Ax = b where: A 2 1 2 b 6
1 1 2 5
1 1 1 9
2. Replace row 2 of A1|b1 by -2*(row1 2 2
A2|b2 =
A1|b1) + row 2 of A1|b1 (type 2 ero). 0 3 1 3
1 1 2 5
1 1 1 9
2 2
3. Replace row 3 of A2|b2 by -1*(row 1
A3|b3 =
of A2|b2) + row 3 of A2|b2 (type 2 0 3 1 3
ero). 3 1
0 2
2 2
22
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
Step 3 - If the new current entry is non zero, use ero’s to transform it to
1 and the rest of the column entries to 0. Repeat this step until finished.
23
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
Making a22 the current entry: 1 1 1 9
2 2
A4|b4 = 0 1 1
4. Multiply row 2 of A3|b3 by -1/3 1
(type 1 ero) 3
3 1
0 2
2 2
1 0 5 7
6 2
5. Replace row 1 of A4|b4 by -1*(row A5|b5 = 0 1 1 1
2 of A4|b4) + row 1 of A4|b4 (type 2 3
ero). 3 1
0 2
2 2
1 0 5 7
6 2
6. Place row 3 of A5|b5 by 2*(row 2 of
A6|b6 = 0 1 1
A5|b5) + row 3 of A5|b5 (type 2 ero). 1
3
5 5
0 0
6 2
24
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
Repeating Step 3 again for the another 1 0 0 1
new entry (a33) and performing an A9|b9 = 0 1 0 2
additional three ero’s yields the final
augmented array:
0 0 1 3
Special Cases: After application of the Gauss-Jordan method, linear
systems having no solution or infinite number of solutions can be
recognized.
No solution example: Infinite solutions example:
1 2 3 1 0 1 2
0 1 0 3
0 0 2
0 0 0 0
25
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
Let BV be the set of basic variables for A’x=b’ and NBV be the
set of nonbasic variables for A’x=b’. The character of the
solutions to A’x=b’ ’ (and Ax=b) depends upon which of
following cases occur.
26
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
27
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
Case 2: Suppose
Case 1 does not apply
and NBV, the set of
nonbasic variables is
empty. Then A’x=b’
1 0 0 1
will have a unique A’|b’ = 0 1 0 2
solution. The matrix to
the right has a unique
solution. The set of 0 0 1 3
basic variables is x1,
x2, and x3 while the
NBV set is empty.
28
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
Case 3: Suppose
Case 1 does not
apply and NBV is
1 0 0 1 1 3
not empty. Then
0 1 0 2 0 2
A’x=b’ (and Ax = b) A’|b’ =
will have an infinite 0 0 1 0 1 1
number of solutions.
0
BV = {x1, x2, and x3} 0 0 0 0 0
while NBV = {x4 and
x5}.
29
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.3 – The Gauss-Jordan Method
shown to the
Ax = b has no
right. The end solution.
Find BV and NBV.
result of the
Is NBV empty?
Gauss-Jordan
method will be Yes
30
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.4 – Linear Independence and Linear Dependence
Let V = {v1, v2, …, vk} be a Example:
set of row vectors all
having the same
dimension. If V = { [1 , 2] , {2 , 1] }
A linear combination of
the vectors in V is any 2v1 – v2 = 2([1 2]) – [2 1] = [0 3]
vector of the form c1v1 +
c2v2 + … + ck where c1,
c2, …, ck are arbitrary and
scalars.
31
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.4 – Linear Independence and Linear Dependence
Example
Show that V = {[ 1 , 2 ] , [ 2 , 4 ]} is a linearly dependent set of
vectors.
Since 2([ 1 , 2 ]) – 1([ 2 , 4 }) = (0 0), there is a nontrivial linear
combination with c1 =2 and c2 = -1 that yields 0. Thus V is a
linear independent set of vectors.
32
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.4 – Linear Independence and Linear Dependence
X2
What does it mean for a set of 2
v2 = (2 2)
same line.
33
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.4 – Linear Independence and Linear Dependence
A method of determining
whether a set of vectors Given V = {[1 0 0], [0 1 0], [1 1 0]}
V = {v1, v2, …, vm} is 1 0 0
A 0 1 0
Form
linearly dependent is to matrix A
from a matrix A whose ith 1 1 0
row is vi. If the rank of A
= m, then V is a linearly After the 1 0 0
independent set of Gauss-Jordan A' 0 1 0
method:
vectors. If the rank A < 0 0 0
m, then V is a linearly
dependent set of vectors. Since the rank of A’ = 2 which is
See the example to the < 3, the set of vectors in V are
right. linearly dependent.
35
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.5 – The Inverse of a Matrix
36
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.5 – The Inverse of a Matrix
For any given m x m matrix A, the m
x m matrix B is the inverse of A BA AB Im
if :
Some square matrices do not have
inverses. If there does exist an m
x m matrix B that satisfies BA = 1
AB = Im, then we write: B A
2 0 1 1 0 1
A 3 1 2 B A
1 5 1 7
Example
1 0 1 1 0 2
2 0 1 1 0 1 1 0 0
AB AA
1
I3 3 1 2 5 1 7 0 1 0
1 0 1 1 0 2 0 0 1
37
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.5 – The Inverse of a Matrix
A 1Ax
has m equations in m unknowns.
Suppose that A-1 exists. The results 1
of multiplying both sides of the
A b
equation by A-1 is shown to the right.
1
This shows that knowing A-1 enables us Im x A b
to find the unique solution to a
square linear system of equations.
38
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.5 – The Inverse of a Matrix
40
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.5 – The Inverse of a Matrix
1 2
Consider matrix A (shown to the A
right). Applying the Gauss-Jordan
method yields A’. 2 4
Matrix A does not have a solution
1 2
since the bottom row of A’ has A'
zeros. This can only happen if
rank A < 2. If m X m matrix A has 0 0
rank < m, then A-1 will not exist.
41
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.5 – The Inverse of a Matrix
2 5 x1 7 3 5
Ax b or where: A'
1 3 x2 4 1 2
1 3 5 7 1
x A b
1 2 4 1
Thus, x1 = 1, x2 = 1 is the unique solution to the system.
42
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.5 – The Inverse of a Matrix
In the upper left-hand corner
Inverting Matrices with Excel
of the output range (cell B5),
Use the EXCEL MINVERSE enter the formula:
function to invert the = MINVERSE(B1:D3)
matrix:
A B C D
2 0 1 1 Matrix A 2 0 -1
A 3 1 2
2 3 1 2
3 -1 0 1
1 0 1
4
5 Matrix A-1 1 0 1
6 -5 1 -7
Enter the matrix into cells 7 1 0 2
B1:D3 and select the output
range (B5:D7 was chosen) Press CONTROL SHIFT
where you want A-1 ENTER and out A-1 is
computed. computed in the output range
43
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.6 – Determinants
Associated with any For a 2 x 2 matrix:
square matrix A is a
a11 a12
number called the A
determinant of A a21 a22
(often abbreviated as
det A or |A|). det A = a11a22 – a21a12
44
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.6 – Determinants
If A is an m x m matrix, 1 2 3
then for any values of i If A 4 5 6
and j, the ijth minor of 7 8 9
A (written Aij) is the (m
- 1) x (m - 1) submatrix 4 6
of A obtained by then A
12
7 9
deleting row i and
column j of A.
1 3
A
32
4 6
45
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.6 – Determinants
a 11 a 12 .... a 1m
a 21 a 22 .... a 2m
Let A be any m x m matrix. A
We may write A as: .... .... .... ....
a m1 a m2 .... a mm
46
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.6 – Determinants
1 2 3
Find det A given matrix A: A 4 5 6
7 8 9
det A is expanded by using row 1 cofactors (row 2 or row 3
could be used with similar results). Notice that using row
1: a11 =1, a12 = 2 and a13 =3 and the minors of matrix A.
5 6 4 6 4 5
A
11 A
12 A
13
7 9 7 9 7 8
47
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2.6 – Determinants
Thus: det A11 = 5(9) – 8(6) = -3
det A12 = 4(9) – 7(6) = -6
det A13 = 4(8) – 7(5) = -3
48
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.