Lecture9 Math 102

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

MATH 102

University of Alberta

Lecture 9
§6.1 Matrix Operations

(uAlberta) MATH 102 Lecture 9 1 / 21


Definitions
1 A matrix is a rectangular array of numbers. The numbers in the array
are called entries.
2 If a matrix has m rows and n columns, then it is an m × n matrix.
3 A matrix with the same number of rows and columns is a square
matrix.
4 The entry in the i th row and j th column is denoted by aij
5 An m × 1 matrix is called a column vector and a 1 × n matrix is
called a row vector.
6 Two matrices are equal if they are the same size and their
corresponding entries are equal.
7 The general form of a m × n matrix M is
 
a11 a12 ... a1n
 a21 a22 ... a2n 
M= .
 
.. .. ..
 ..

. . . 
am1 am2 . . . amn
(uAlberta) MATH 102 Lecture 9 2 / 21
(uAlberta) MATH 102 Lecture 9 3 / 21
Transpose of a matrix
If A is an m × n matrix, then the transpose of A denoted AT is the n × m
matrix obtained by interchanging the rows and columns of A.

Illustration

(uAlberta) MATH 102 Lecture 9 4 / 21


Trace of a matrix
If A is an n × n square matrix, then the trace of A denoted tr(A) is the
sum of the entries on the main diagonal of A. That is,

tr(A) = a11 + a22 + · · · + ann

Illustration

(uAlberta) MATH 102 Lecture 9 5 / 21


Addition and scalar multiplication of matrices
If A and B are matrices of the same size, then A + B (and A − B )
are obtained by adding (and subtracting) corresponding entries.
To multiply a matrix by a scalar is to multiply each entry in the
matrix by the scalar.

Illustration

(uAlberta) MATH 102 Lecture 9 6 / 21


Notations
A = [aij ] denotes the matrix whose ij th entry is aij where as (A)ij denotes
the ij th entry of A.
It follows for matrices A and B that
1 (AT )ij = (A)ji

2 (A + B)ij = (A)ij + (B)ij

3 (cA)ij = c(A)ij for scalar c.


Pn
4 tr(A) = i=1 (A)ii = (A)11 + (A)22 + · · · + (A)nn

(uAlberta) MATH 102 Lecture 9 7 / 21


Matrix multiplication
If A is an m × r matrix and B is an r × n matrix, then AB is the m × n
matrix whose ij th entry is obtained by the dot product of the i th row of A
and the j th column of B.

Illustration

(uAlberta) MATH 102 Lecture 9 8 / 21


Example
 
4 2  
2 0 2
Let A = 3 −2 and B =
 
0 1 −2
0 −1

Find the size of AB and the size of BA and compute AB and BA.

Solution

(uAlberta) MATH 102 Lecture 9 9 / 21


(uAlberta) MATH 102 Lecture 9 10 / 21
Remark
1 (AB)ij = (A)i1 (B)1j + (A)i2 (B)2j + · · · + (A)r 1 (B)rj
2 If B = [→

c1 → −
c2 . . . →

cn ] where the → −
cj ’s are the column vectors of B,
then
AB = [A→ −
c1 A→−c2 . . . A→

cn ]
→ − 
r1
−→
 r2 
If A =  . , where the → −

3 ri ’s are the row vectors of A, then
. .

r→m
→− 
r1 B
→− 
 r2 B 
AB =  . 
 .. 

r→B m

4 (AB)ij = →

ri · →

cj

(uAlberta) MATH 102 Lecture 9 11 / 21


(uAlberta) MATH 102 Lecture 9 12 / 21
Example
 
3 −4  
5 0
Let A = 4 0 and B =

4 −2
1 −5
Find the 3rd row of AB. Find the 2nd column of AB.

(uAlberta) MATH 102 Lecture 9 13 / 21


(uAlberta) MATH 102 Lecture 9 14 / 21
Definition
If A1 , A2 , . . . , Ar are matrices of the same size, and c1 , c2 , . . . , cr are
scalars, then an expression of the form c1 A1 + c2 A2 + · · · + cr Ar is called a
linear combination of A1 , A2 , . . . , Ar with coefficients c1 , c2 , . . . , cr .

Illustration

(uAlberta) MATH 102 Lecture 9 15 / 21


Consider the following linear system:

a11 x1 + a12 x2 + · · · + a1n xn = b1


a21 x1 + a22 x2 + · · · + a2n xn = b2
.. ..
.=.
am1 x1 + am2 x2 + · · · + amn xn = bm

where x1 , x2 , ..., xn are variables and the aij ’s and the bi ’s are constants.
We can write the system as matrix multiplication as follow:

Ax = b

where
     
a11 a12 ... a1n x1 b1
 a21 a22 ... a2n   x2   b2 
A= . , x =  . , b =  . 
     
.. .. ..
 .. . . .  ..  .. 
am1 am2 . . . amn xn bn
(uAlberta) MATH 102 Lecture 9 16 / 21
Remark
Notice that b can be written as a linear combination of the columns of A.

(uAlberta) MATH 102 Lecture 9 17 / 21


Example
Write the following systems as a product of matrices. Also write b as
linear combination of A.
1

2x − y =4
x + 5y =2
1
−x + y = − 2
2
2

2x + 5y − 6z = − 2
7x − 5y + z =12
x + 5y − 4z =0

Solution

(uAlberta) MATH 102 Lecture 9 18 / 21


(uAlberta) MATH 102 Lecture 9 19 / 21
Example
Find all →

x that satisfy the homogeneous equation
   
2 1 7 0
−1 3 4 → −
x = 0

1 1 5 0

Solution

(uAlberta) MATH 102 Lecture 9 20 / 21


(uAlberta) MATH 102 Lecture 9 21 / 21

You might also like