Multiplying Matrices

Download Report

Transcript Multiplying Matrices

Multiplying Matrices
Scalar and Matrix by Matrix
Scalar Multiplication
• Scalar multiplication is very easy. Let’s
consider the pizza party example again.
• Let’s say that we decide that we want to
order 4 pizzas, 4 sodas, and 4 salads.
• To do this, we multiply each element in the
matrix by 4 to get a new matrix that is equal
to 4C.
Scalar Multiplication (cont’d)
• C=
4C =
$10.10
L
M
$1.09
M
M
N$3.69
$10.10
L
4M
$1.09
M
M
N$3.69
$40.40
L
M
$4.36
M
M
$14.76
N
O
P
P
P
Q
$10.86 $10.65
$0.89 $1.05
$3.89 $3.85
L
O
M
P
M
P
P
N
QM
$42.60O
$4.20 P
P
$15.40 P
Q
4($10.10) 4($10.86) 4($10.65)
$10.86 $10.65
$0.89 $1.05  4($1.09) 4($0.89) 4($1.05)
4($3.69) 4($3.89) 4($3.85)
$3.89 $3.85
$43.44
$3.56
$15.56
O
P
P
P
Q
Matrix x Matrix Multiplication
• In order for matrix multiplication to be
defined, the number of columns of the first
matrix must be equal to the number of rows
in the second matrix.
BC  D
(3  2)(2  3)  (3  3)
Same
Dimensions of the
product
Matrix Multiplication Example
• Let’s multiply these matrices:
1 4  2  2
L
1 2O L
L
4 3O M
M
P
M P  3 4  4  2
3
4
M
P
2 1Q M
N
M
5 6P
M
5 4  6  2
N
Q
N
44
L
M
M
12  8
M
20  12
N
O
P
P
P
Q
5O
P
13P
21P
Q
1 3  2  1
3  3  4 1
5  3  6 1
O
L
P
M
P
M
P
QM
N
3 2
8
9  4  20
15  6
32
More Examples
•
Given:
1 0 1O
1  1 0O
L
L
AM
CM
P
P
0 1 1Q
2 1 1Q
N
N
Find:
1. A+C
2. A-C 3. (A+C)(A-C) 4. A2-C2
Answers
L
M
N
2. .
0 1
L
AC  M
2 0
N
O
A C
P
Q ( A  A)  (C  C)
1ONot possible
P
0Q
2 1 1
AC 
2 2 2
1. .
3. Not possible
4.
2
2
Other Examples
•
http://www.analyzemath.com/matrixmultiplication/matrixmultiplication.html
Identity Matrix
• The matrix I is called an
identity matrix. An
identity matrix is any
matrix in which each of
the entries along the
main diagonal are ones
and all entries are zeros.
Identity matrices act in
the same way as the
number 1 does for
number products.
1 0
L
M
0 1
IM
M
0 0
M
0 0
N
O
P
0
P
0P
P
1Q
0 0
0
1
0
IA  AI  A
Inverse Matrices
• In algebra, two numbers whose product is 1
are called inverses of each other. For
example, 5 and 1/5 are inverses.
• The same is true of matrices. If A and B are
two square matrices such that AB=BA=I,
then A and B are called inverses of each
other.
• The inverse of A is denoted as A-1.
Your Turn!
• Verify that the matrices A and B are
inverses of each other, by computing AB
and BA.
2 3O
2 3O
L
L
AM P BM
P
1 2 Q
1 2Q
N
N
Hint About Inverse Matrices
• To find the inverse of a 2 x 2 matrix:
• Switch the elements in the 2,1 and 1,2 positions
and give them opposite signs.
a b O
L
MM P
c d Q
N
a c O
L
M P
b d Q
N
• So, the inverse of
would be
M
1