Uploaded by Pavanasutha Srilaxsmi

Matrices & Matrix Operations: Linear Algebra

advertisement
Matrices
Matrix Operations
MAT111 LINEAR ALGEBRA
LEE See Keong
Universiti Sains Malaysia
26 March 2024
Matrices
Matrix Operations
Course requirements
Textbook & Reference Book:
Linear Algebra and Its Applications, 6th edition, by David C.
Lay, Stephen R. Lay & Judi J. McDonald
Elementary Linear Algebra - Applications Version, 12th edition,
by Howard Anton, Chris Rorres & Anton Kaul
Matrices
Matrix Operations
Course requirements
Topics to be covered:
• Matrices
• System of Linear Equations
• Real (& Complex) Vector Spaces over a Field
• Inner Product Spaces
• Linear Transformations
• Diagonalization
Test dates: 02 May 2024, 20 June 2024
Matrices
Matrix Operations
Course requirements
Tutorial slots: (Room 204)
• Monday 8:00am - 8:50am (G31 Room 204)
• Monday 9:00am - 9:50am (G31 Room 204 and Room 105)
• Tuesday 9:00am - 9:50am (G31 Room 204)
• Tuesday 2:00pm - 2:50pm (G31 Room 204)
• Thursday 8:00am - 8:50am (G31 Room 204)
Matrices
Matrix Operations
Matrices and Matrix Operations
Matrices
Matrix Operations
Recap
Question: How do you solve these simultaneous equations?
x − y + 2z = 5
2x − 2y + 4z = 10
3x − 3y + 6z = 15
Question: How about solving these simultaneous equations?
r + 3s − 2t + 2v = 0
2r + 6s − 5t − 2u + 4v − 3w = 1
5t + 10u + 15w = 5
2r + 6s + 8u + 4v + 18w = 6
Matrices
Matrix Operations
Matrices
Definition
A matrix is a rectangular array of numbers. The numbers in
the array are called the entries of the matrix.


a11 a12 a13 · · · a1n
 a21 a22 a23 · · · a2n 


 ..
..
.. 
..
 .
. ···
.
. 

A=
 ai1 ai2 ai3 · · · ain 


 ..
..
..
.. 
.
.
 .
.
.
.
. 
am1 am2 am3 · · · amn
The entry at row i and column j is usually denoted by aij and
is called the (i, j)-entry of the matrix A.
Matrices
Matrix Operations
Matrices
Definition
The size of a matrix is described in terms of the number of
rows (horizontal lines) and columns (vertical lines) it contains.
If a matrix has m rows and n columns, then that matrix is said
to have size m by n (written m × n).
Notation: aij = (A)ij , A = [aij ]m×n = [aij ]
Example
The matrix


−1 2
A =  3 −4
0
0
is a 3 × 2 matrix. Its (2, 1)-entry and (3, 2)-entry are a21 = 3
and a32 = 0, respectively.
Matrices
Matrix Operations
Matrices
Definition
A 1 × n matrix is called a row vector or row matrix:
A = a11 a12 · · · a1n = c1 c2 · · · cn .
A m × 1 matrix is called a column vector or column matrix:

  
a11
r1
 a21   r2 

  
A =  .  =  . .
 ..   .. 
am1
rm
Matrices
Matrix Operations
Matrices
Definition
The diagonal entries in an m × n matrix A = [aij ] are a11 ,
a22 , a33 , . . . , and they form the main diagonal of A. Other
elements of A are called the off-diagonal entries of A.
A diagonal matrix is a square n × n matrix whose off-diagonal
entries are zero. An example is the n × n identity matrix


1 0 ··· 0
0 1 · · · 0


In =  . . .
.
. . ... 
 .. ..

0 0 ···
1
An m × n matrix whose entries are all zero is called a zero
matrix. We also denote this matrix by 0 or just 0.
Matrices
Matrix Operations
Matrices
Definition
A square matrix in which all the entries above the main
diagonal are zero is called a lower triangular matrix.
An upper triangular matrix is a square matrix in which all
the entries below the main diagonal are zero.




a11 0 · · ·
0
a11 a12 · · · a1n
 a21 a22 · · ·
 0 a22 · · · a2n 
0 




 ..
 ..
..
.. 
..
.. 
..
..
 .


.
.
.
.
.
.
. 
an1 an2 · · ·
ann
0
0
···
ann
Matrices
Matrix Operations
Equal matrices
Definition
Two matrices A and B are said to be equal if they have the
same size and their corresponding entries are equal.
Namely, if A = [aij ]m×n and B = [bij ]r×s , then A = B if (and
only if) m = r, n = s and aij = bij for all i and j.
Example
Let
1 2
A=
,
3 4
1 −2
B=
,
3 4
1 2 3
C=
,
3 4 5
1 2
D=
.
3 4
Then only A equals to D and all the other matrices are not
equal. We may write A = D, A 6= B, B 6= C, C 6= D.
Matrices
Matrix Operations
Matrix Operation - Sums
Definition
If A and B are matrices of same size, then the sum A + B is
the matrix whose size is the same as A and B and each of its
entries is the sum of the corresponding entries in A and B.
Namely, if A = [aij ]m×n and B = [bij ]m×n , then
A + B = [aij ] + [bij ] = [aij + bij ].
Example
Let
1 2
A=
,
3 4
1 −2
B=
,
3 4
1 2 3
C=
.
3 4 5
Then A + C is undefined and
1 + 1 2 + (−2)
2 0
A+B =
=
.
3+3
4+4
6 8
Matrices
Matrix Operations
Matrix Operation - Scalar Multiples
Definition
If A is a matrix and r is a real scalar (any real number), then
the scalar multiple rA is the matrix whose each entry is r
times the corresponding
entry in A. That is, if A = [aij ], then
rA = r [aij ] = [raij ].
Example
Let
1 3
B=
.
−2 4
Then
2(1) 2(3)
2 6
1 3
1 3
2B =
=
=
+
= B + B.
2(−2) 2(4)
−4 8
−2 4
−2 4
Matrices
Matrix Operations
Matrix Operations - Sum and Scalar Multiples
Theorem
Let A, B and C be matrices of the same size, and let r and s be
scalars. Then
(a) A + B = B + A
(b) (A + B) + C = A + (B + C)
(c) A + 0 = A
(d) rA = A
· · + A}
| + ·{z
r
(e) rA = Ar
(f) r(A + B) = rA + rB
(g) (r + s)A = rA + sA
(h) r(sA) = (rs)A
Proof.
The proof for (h) is given, The rest are left as exercises.
Let A = [aij ]. Then
r(sA) = r [s(aij )] = r s[aij ] = (rs)[aij ] = (rs)A.
Matrices
Matrix Operations
Matrix Operation - Differences
Definition
Let A be a matrix. Then −A is the matrix defined by
−A = (−1)A.
That is, if A = [aij ], then −A = [−aij ].
If B is a matrix having same size as A, then A − B is defined by
A − B = A + (−1)B.
Matrices
Matrix Operations
Matrix Operation - Multiplication
Recap: Given


1 −2 −1
4
A = 2 4
0 −1 5


2 3 −1
and B =  1 0 3  ,
−3 5 2
then


3
−2 −9
AB =  −4 26 18 
−16 25 7


8 9
5
and BA = 1 −5 14 .
7 24 33
Question: How do we determine these products AB and BA?
Matrices
Matrix Operations
Matrix Operation - Multiplication
Definition
Let A and B be two matrices. The product AB of A and B is
(well-)defined if the number of columns in A is the same as the
number of rows in B.
Definition (Product of vectors)
Let A be an m × 1 column vector and B be a 1 × n row vector.
If m = n, the product BA of B and A is a 1 × 1 matrix given
by
 
a11
 .  BA = b11 · · · b1n  ..  = b11 a11 + b12 a21 + · · · + b1n an1 .
an1
Matrices
Matrix Operations
Matrix Operation - Multiplication
Example
Let
 
1
A = 2
3
and
B= 4 5 6 .
Then
 
1
BA = 4 5 6 2 = (4)(1) + (5)(2) + (6)(3)
3
= 32
= 32.
Matrices
Matrix Operations
Matrix Operation - Multiplication
Definition (Product of vectors)
Let A be an m × 1 column vector and B be a 1 × n row vector.
The product AB of A and B is an m × n matrix given by




a11 b11 a11 b12 · · · a11 b1n
a11


 ..   a21 b11 a21 b12 · · · a21 b1n 
AB =  .  b11 · · · b1n =  .
..
.. 
..
 ..
.
.
. 
am1
am1 b11 am1 b12 · · · am1 b1n
= Ab11 Ab21 · · · Ab1n .
Matrices
Matrix Operations
Matrix Operation - Multiplication
Definition (Product of a matrix and a vector)
Let A be an m × n matrix and B be a n × 1 column vector.
The product AB of A and B is an m × 1 matrix given by

 n
X



a1k bk1  
a11 a12 · · · a1n   
a 1 b1


b
 
 k=1
 a21 a21 · · · a2n  11
  a 2 b1 

  ..  
..
,
=
AB =  .
=




.
.
.
.
.
..
..
.. 
··· 
 n

 ..

X
bn1
a m b1

am1 am2 · · · amn
amk bk1 
k=1


 
a1
b11
 a2 
 
 .. 
where A =  .  and b1 =  . .
 .. 
b1n
am
Matrices
Matrix Operations
Matrix Operation - Multiplication
Definition (Product of matrices)
If the product AB is defined, then the (i, j)-entry of AB is the
sum of the products of corresponding entries from row i of A
and column j of B. In particular, if A is an m × n matrix and
B is an n × p matrix, then
(AB)ij = ai1 b1j + ai2 b2j + · · · + ain bnj .
and
Matrices
Matrix Operations
Matrix Operation - Multiplication
Definition
 n
X
a1k bk1


k=1
 n
X

a2k bk1

AB = 
 k=1

..

 n .
X

a b
n
X
k=1
n
X
k=1
n
X
mk k1
k=1
k=1
a1k bk2
···
a2k bk2
···
..
.
..
.
amk bk2 · · ·
n
X

a1k bkp 



a2k bkp 


k=1


..

.

n

X
a b 
k=1
n
X
mk kp
k=1
Remark: This is called the Row-Column method.
Matrices
Matrix Operations
Product of Matrices
Theorem
Let A be an m × n matrix, and B and C are n × p matrices.
(a) A(BC) = (AB)C
(b) A(B + C) = AB + AC
(c) (B + C)A = BA + CA,
(d) r(AB) = (rA)B = A(rB)
for any scalar r
(e) Im A = A = AIn
Remark:
1. In general, AB 6= BA.
2. AB = AC does not imply B = C.
3. If AB is a zero matrix, it does not mean that A and B are
zero matrices.
Matrices
Matrix Operations
Product of Matrices
Proof.
The proof of (b) is given here. The proofs for the others are left
as exercises.
Write A = [aij ]m×n , B = [bij ]n×p and C = [cij ]n×p . Note that
both A(B + C) and AB + AC are m × p matrices (why?).
For any positive integers 1 ≤ i ≤ m and 1 ≤ j ≤ p,
n
X
A(B + C) ij =
aik (bkj + ckj )
k=1
=
n
X
k=1
aik bkj +
n
X
aik ckj
k=1
= (AB)ij + (AC)ij
Matrices
Matrix Operations
Power of a matrix
Definition
If A is an n × n matrix and k is a positive integer, then the
power Ak of A denotes the product of k copies of A and is
given by
Ak = A
· · A} .
| ·{z
k
Example
1 2
. Then
Let A =
3 4
1 2 1 2
7 10
A = AA =
=
.
3 4 3 4
15 22
2
Matrices
Matrix Operations
Example
Example
Let
A = a11


 
c
c
b
11
12
11
d11 d12




a12 , B = b21 , C = c21 c22 , D =
.
d21 d22
c31 c32
b31
Find the products, if it exists, for each of these: AB, BA, AD
and CD.
Download