Professional Documents
Culture Documents
Lecture 3
Lecture 3
Lecture 3 – 2016/2017
Idrissa S. A.
Dot Product
The dot product or inner product of the vectors
T
a = a1 a2 . . . an and b = b1 b2 . . . bn is defined as
n
X
a.b = a1 b1 + a2 b2 + . . . + an bn = ai bi
i=i
Example 1
2
3
The dot product of u = 1 −2 3 4 and v=
−2 is
u.v = 1 × 2 + −2 × 3 + 3 × −2 + 4 × 1 = −6
Matrix Multiplication
If A = [aij ] is an m × p matrix and B = [bij ] is an p × n, then the product
of A and B, denoted by AB, is the m × n matrix C = [cij ], defined by
It says the i,j th element of AB is the dot product of the ith row,
rowi (A), and the jth column, colj (B) of B
Matrix Multiplication
a11 a12 ...
a1p
a21 a22 ...
a2p
b11 b12 . . . b1j . . . b1n
.. .. .. b
. . . 21 b22 . . . b2j . . . b2n
.. .. ..
..
ai1 ai2 . . . aip . . . .
.. .. .. b
. . . p1 b p2 . . . b pj . . . bpn
am1 am2 . . . amp
c11 c12 . . . c1n
c21 c22 . . . c2n
= .
.. ..
.. . cij .
cm1 cm2 . . . cmn
Pp
=⇒ cij = rowi (A).colj (B) = k=1 aik bkj
Example 2
−2 5
1 2 −1
Let A = and B = 4 −3. Find AB
3 1 4
2 1
Solution
row1 (A).col1 (B) row1 (A).col2 (B)
AB =
row2 (A).col1 (B) row2 (A).col2 (B)
(1)(−2) + (2)(4) + (−1)(2) (1)(5) + (2)(−3) + (−1)(1)
=
(3)(−2) + (1)(4) + (4)(2) (3)(5) + (1)(−3) + (4)(1)
4 −2
=
6 16
Example 3
1 −2 3 1 4
Let A = 4 2 1 and B = 3 −1. Compute
0 1 −2 −2 2
1 the (3, 2) entry of AB
Example 4
Given any
two non zero
matrices
whose product is a zero matrix.
1 2 4 −6
A= , B=
2 4 −2 3
Note: AB = 0 does not imply A = 0 or B = 0
Example 5
1 2 2 1 −2 7
If A = , B= , C=
2 4 3 2 5 −1
8 5
Then AB = AC = , but B 6= C
16 10
a11 c1 + a12 c2 + . . . + a1n cn a11 a12 a1n
a21 c1 + a22 c2 + . . . + a2n cn a21 a22 a2n
=c1 .. + c2 .. + . . . + cn ..
..
. . . .
am1 c1 + am2 c2 + . . . + amn cn am1 am2 amn
=c1 col1 (A) + c2 col2 (A) + . . . + cn coln (A)
Linear combination!
Example 5
Repeat example 3 above to verify the results
1 −2 3 12
col2 (AB) = Acol2 (B) = 4 4 − 1 2 + 2 1 = 16
0 1 −2 −5
Ap = A.A.A
| {z. . . A}
p factors
Power zero
If A is n × n, we also define A0 = In
Power rules
For nonnegative integers p and q
1 Ap Aq = Ap+q
2 (Ap )q = Apq
3 (AB)p 6= Ap B p for square matrix in general
ISA MT127 – Linear Algebra I Lecture 3 – 2016/2017
Matrix properties
Theorem (properties of matrix addition)
Let A, B, C and D be m × n matrices
1 A + B = B + A (commutative property)
2 A + (B + C ) = (A + B) + C (associative property)
3 There is a unique m × n matrix O such that A + O = A for any
m × n matrix A. The matrix O is called the m × n additive identity
or zero matrix.
4 For each m × n matrix A, there is a unique matrix D such that
A+D =O
A + (−A) = O
Proof
We are going to prove part 1 and 3. The rest are left as exercise
Proof:
1) Let A = [aij ] and B = [bij ] be m × n matrices, then
Im A = AIn = A
Proof
Let us prove part 3. Let A and B be m × n matrices, and C be n × p.
First observe that (A + B)C and AC + BC are both m × p.
We only need to show equality of corresponding entries.
Let Q = A + B, where Q = [qij ],
(A + B)C = QC , the rsth entry of QC is given by
n
X n
X n
X n
X
qrk cks = (ark + brk )cks = ark cks + brk cks
k=1 k=1 k=1 k=1
= AC + BC
Theorem
If A and B are m × n matrices and C is an n × p matrix, then:
1 (A + B)T = AT + B T
2 (AC )T = C T AT
3 (AT )T = A
Proof
We prove part 2. First observe that both (AC )T and C T AT are p × m
matrices.
We then need to show equality of corresponding entries.
The ijth element of (AC )T is the jith element of AC , (AC )T is
n
X
ajk cki
k=1
Proof cont.
The ijth element of C T AT is the dot product of
(AC )T = C T AT