Sie sind auf Seite 1von 40

7/9/2013

Matrices
A rectangular array of numbers written within
brackets is called a matrix




Each number in a matrix is called an element of the
matrix.
(

(




=
2 19 0
1 4 6
A
(
(
(
(

(








=
1 0 6
4 10 3
9 0 10
1 5 6
B
7/9/2013
Matrices
The rows of a matrix are the horizontal lists of
numbers in the array; the columns of a matrix are
the vertical list of numbers in the array
If a matrix has m rows and n columns, it is called
m x n matrix
A is a 2 x 3 matrix and B is a 4 x 3 matrix
m x n is called the size of the matrix, and the
numbers m and n are called the dimensions of the
matrix
A matrix with n rows and n columns is called a
square matrix of order n
7/9/2013
Matrices
A matrix with only 1 column is called a column
matrix and a matrix with only 1 row is called a row
matrix



(
(
(

(






2 0 7
5 3 0
1 0 5
(
(
(
(

(







0 . 0
8 . 1
2 . 0
5 . 3
(

(




3
2
0
2
1
2
1 x 4
row matrix
3 x 3
square matrix of order 3
4 x 1
column matrix
7/9/2013
Matrices
The position of an element in a matrix is given by
the row and column containing the element. This is
usually denoted using double subscript notation a
ij
.

(

(




=
2 19 0
1 4 6
A
2 19 0
1 4 6
23 22 21
13 12 11
= = =
= = =
a a a
a a a
7/9/2013
Basic Operations
Two matrices are equal if they have the same size and
their corresponding elements are equal.
The sum of two matrices of the same size is a matrix
obtained by adding the corresponding elements of the
two matrices.
Addition is not defined for matrices of difference sizes
Matrices of the same size are commutative and
associative relative to addition, i.e.
If A, B and C are all m x n matrices, then
A + B = B + A
(A + B) + C = A + (B + C )
7/9/2013
Basic Operations
The negative of a matrix M, denoted by M, is a matrix
obtained by replacing each entry with its negative
A matrix whose elements are all zeros is called zero
matrix, and is denoted by 0.
The product of a number k and a matrix M, is denoted by
kM, obtained by multiplying each element of M by k.

7/9/2013
Example 1:

Let , and .

Compute the following
a. 3A
b. B + C
c. 2B - C
d. A + B

(

=
4 5
3 1
A
(

=
4 4 12
6 1 3
B
(

=
2 3 0
7 1 2
C
7/9/2013
Example 1:- solution
a.

b.

c.

d.
(

=
12 15
9 3
3A
(

=
(

+
(

= +
6 7 12
13 0 1
2 3 0
7 1 2
4 4 12
6 1 3
C B
(

=
(

=
6 5 24
5 3 8
2 3 0
7 1 2
4 4 12
6 1 3
2 2 C B
(

+
(

= +
4 4 12
6 1 3
4 5
3 1
B A
undefined
7/9/2013
Product
The product of a 1 x n matrix and an n x 1 matrix is a
1 x 1 matrix given by (dot product)
| | n a a a 2 1
(
(
(
(

n b
b
b

2
1
=
| | n nb a b a b a + + + 2 2 1 1
7/9/2013
Example 2:

Compute


Solution:
| |
(
(
(
(

1
2
2
5
7 4 3 1
| |
(
(
(
(

1
2
2
5
7 4 3 1

10
1 7 ) 2 ( 4 2 3 5 1
=
+ + + =
7/9/2013
Matrix Product
If A is a m x n matrix and B is a n x p matrix, then the
matrix product of A and B, denoted AB, is an m x p
matrix whose element in the ith row and jth column is
the dot product of the ith row of A with the jth column
of B. i.e.
(AB)
ij
= a
i1
b
1j
+ a
i2
b
2j
+ + a
in
b
nj

7/9/2013
Matrix Product
To compute the element (AB)
ij
, we first isolate the ith
row of A and the jth column of B. Next, multiply each
element in the ith row of A to the corresponding
element in the jth column of B, and then add these
products.
(
(
(
(
(
(

mn m m
in i i
n
a a a
a a a
a a a

2 1
2 1
1 12 11
(
(
(
(

np nj n
p j
p j
b b b
b b b
b b b




1
2 2 21
1 1 11
7/9/2013
Example 3:
Compute

a. b.

c. d.

e.
| |
(
(
(

3
2
1
5 1 2 | | 5 1 2
3
2
1
(
(
(

1 6
1 3
4 3
2 1
(

3 1
6 2
6 3
2 1
(

3 2 7 9
3 6 5 1
(

2 1
1 2
7/9/2013




= 2(-1) + 1(-2) +5(3)
= 11

Example 3a :- solution
| |
(
(
(

3
2
1
5 1 2
7/9/2013
Example 3b:- solution
=
15 3
-10 -2
-5 -1
-4
6
3 X 3
[ ]
5 1 2
3
2
1
-
-
-2
3X1
1X 3
7/9/2013
=
-1
-1
33
2 X 2
15
2X2 2X2
-1 6
1 3
4 3
2 1
Example 3c:- solution
7/9/2013
=
0
0
0
2 X 2
0
2X2 2X2
-3 -1
6 2
6 3
2 1
Example 3d:- solution
7/9/2013
Example 3e:- solution
(

3 2 7 9
3 6 5 1
(

2 1
1 2
Not defined
7/9/2013
Matrix multiplication is not commutative, i.e. in
general

The associative law and distributive laws of
multiplication hold, i.e.



Properties of Matrix
Multiplication
BA AB =
AC AB C B A + = + ) ( BC AC C B A + = + ) (
C AB BC A ) ( ) ( =
,
7/9/2013
Example 4:
A store sells brand X and brand Y PCs. The following
matrix gives the sales figures and the costs of these
items for three months. Use matrix multiplication to
generate a matrix that has as its entries the total dollar
sales and the total costs for each of the three months.
(

180 310
250 445
(

19 23 21
35 43 32
Brand X Brand Y Jan Feb Mar
Retail price
Dealer cost
Brand X
Brand Y
7/9/2013
Example 4:- solution
The total sales for January
= (Retail price of X) x (no of X sold) + (Retail price of Y) x (no of Y sold)
The total cost for January is
= (Dealer cost of X) x (no of X sold) + (Dealer cost of Y) x (no of Y sold)




(

180 310
250 445
(

19 23 21
35 43 32
=
(

14270 17470 13700


20325 24885 19490


(

14270 17470 13700


20325 24885 19490
Jan Feb Mar
Total dollar sales
Total dealer cost
Therefore, the requested matrix is
Similar computations hold for Feb and March, and combining
the three months yields the following product,
7/9/2013
Inverse of a Square Matrix
Let I
n
be the n by n square matrix with 1s along the
diagonal and 0s elsewhere. Then I
n
is called the n
x n identity matrix
If M is a square matrix of order n and I is the
identity matrix of order n, then
IM = MI = M
If A is any m x n matrix and B is any n x p matrix,
and I is the identity matrix of order n then
AI = A and IB = B
7/9/2013
Example 5:
a.

b.


c.

d.
(
(
(

(
(
(

i h g
f e d
c b a
1 0 0
0 1 0
0 0 1
=
(
(
(

i h g
f e d
c b a
(
(
(

(
(
(

1 0 0
0 1 0
0 0 1
i h g
f e d
c b a
(
(
(

i h g
f e d
c b a
(

f e d
c b a
1 0
0 1
(

f e d
c b a
(
(
(

1 0 0
0 1 0
0 0 1
f e d
c b a
(

f e d
c b a
=
=
=
7/9/2013
Inverse of a Square Matrix
Let M be a square matrix of order n and I be the
identity matrix of order n. If there exists a matrix M
-1

such that
M
-1
M = M M
-1
= I
Then M
-1
is called the multiplicative inverse of M, or
the inverse of M .
7/9/2013
Example 6:
Find M
-1
, where M =

(

4 3
2 1
7/9/2013
Example 6:- solution
Let
(

s r
q p
MM
-1
=
(

4 3
2 1
(

s r
q p
MM
-1
=
(

1 0
0 1
Thus,
(

+ +
+ +
s q r p
s q r p
4 3 4 3
2 2
=
(

1 0
0 1
M
-1
=
i.e.
0 4 3
1 2
= +
= +
r p
r p
and
1 4 3
0 2
= +
= +
s q
s q
Solving the linear system, we have
2 = p 1 = q
,
2
3
= r
and
2
1
= s
Thus,
(

2
1
2
3
1 2
M
-1
=
,
7/9/2013
Example 7:
Find N
-1
, if any, where N =
(

4 2
2 1
7/9/2013
Example 7:- solution
N
-1
=
(

s r
q p
NN
-1
=
(

4 2
2 1
(

s r
q p
NN
-1
=
(

1 0
0 1
Thus,
(

+ +
+ +
s q r p
s q r p
4 2 4 2
2 2
=
(

1 0
0 1
Let
i.e.
0 4 2
1 2
= +
= +
r p
r p
and
1 4 2
0 2
= +
= +
s q
s q
This linear system has no
solution, so N has no inverse.
7/9/2013
Example 8
Find A
-1
, where A =



(

d c
b a
7/9/2013
Example 8:- solution
i.e.
0
1
= +
= +
dr cp
br ap
and
1
0
= +
= +
ds cq
bs aq
Solve the first system
) ( 0
) ( 1
ii dr cp
i br ap

= +
= +
) (
) (
ii a
i c

) ( ) ( iii iv
bc ad
c
r
c bcr adr

=
=
A
-1
=
(

s r
q p
AA
-1
=
(

d c
b a
(

s r
q p
=
(

1 0
0 1
Thus,
(

+ +
+ +
ds cq dr cp
bs aq br ap
(

1 0
0 1
Let
=
substitute r into (ii)
bc ad
d
p
bc ad
c
d cp

=
=
|
.
|

\
|

+ 0
) ( 0
) (
iv adr acp
iii c bcr acp

= +
= +
7/9/2013
Example 8:- solution
solve the second system of equations similarly,
bc ad
b
q

=
and
bc ad
a
s

=
Thus,
(
(
(

bc ad
a
bc ad
c
bc ad
b
bc ad
d
A
1

(

=
a c
b d
bc ad
1
7/9/2013
Inverse of a 2 2 Matrix
If A =


then
(

d c
b a
(

a c
b d
bc ad
A
1
1

7/9/2013
Example 9
Find M
-1
, where M =


(
(
(

2 1 2
1 2 3
1 1 2
** Messy by hand but easily
solved on Excel/CAS calculator
(covered in Ch.2 lecture)
7/9/2013
Matrix Equations and
Systems of Linear
Equations
7/9/2013
Matrix Equation
If A is an n n matrix, then the linear system AX=B is a
system of n equations in n unknowns. Suppose A
-1

exists and we can multiply AX=B by A
-1
on both sides,
obtaining





X=A
-1
B is clearly a solution to the given linear system.
Thus, if A is nonsingular, we have a unique solution.
Matrices that have inverses are called nonsingular matrices
B A X
B A IX
B A X A A
B A AX A
1
1
1 1
1 1
) (
) (



=
=
=
=
7/9/2013
Example 10:
Use matrix inverse method to solve the system

1 2 2
1 2 3
2 2
3 2 1
3 2 1
3 2 1
= + +
= + +
= + +
x x x
x x x
x x x
7/9/2013
Example 10:- solution
Write the linear system in the form AX=B, then
(
(
(

2 1 2
1 2 3
1 1 2
B =
(
(
(

1
1
2
(
(
(

=
3
2
1
x
x
x
X
A
-1
=
(
(
(


1 0 1
1 2 4
1 1 3
B A X
1
=
, thus,
(
(
(

=
(
(
(

(
(
(


=
(
(
(

1
9
6
1
1
2
1 0 1
1 2 4
1 1 3
3
2
1
x
x
x

6
1
= x , 9
2
= x
and 1
3
= x
A =
Excel/calculator gives:
7/9/2013
Example 11:
Use matrix inverse methods to solve each of the
following systems

a.


b.
10 2
20 2 3
30 3 2
3 2 1
3 2 1
3 2 1
= + +
= +
= + +
x x x
x x x
x x x
14 2
8 2 3
12 3 2
3 2 1
3 2 1
3 2 1
= + +
= +
= + +
x x x
x x x
x x x
7/9/2013
Example 11:- solution
A =
(
(
(

1 1 2
1 2 3
3 1 2
Calculate A
-1
using Excel or calculator (such
skills will be taught in lecture)

7/9/2013
Example 11:- solution
B A X
1
=
a.
(
(
(

=
(
(
(

(
(
(


=
(
(
(

10
60
30
10
20
30
0
2
1
2
1
2
1
2
11
2
5
2
7
2
3
3
2
1
x
x
x
30
1
= x
,
60
2
= x
and
10
3
= x
b.
(
(
(

=
(
(
(

(
(
(


=
(
(
(

1
31
23
14
8
12
0
2
1
2
1
2
1
2
11
2
5
2
7
2
3
3
2
1
x
x
x
23
1
= x 31
2
= x
and
1
3
= x
,


We will find
(
(
(

2
1
2
1
2
11
2
5
2
7
2
3
1
0
2
1
A

Das könnte Ihnen auch gefallen