0% found this document useful (0 votes)
20 views

Lesson1 3

The document introduces matrices and discusses different ways to define matrix multiplication. It defines row and column vectors of a matrix and shows that the product of a row vector and column vector yields a 1x1 matrix. It then presents formulas for the product of two matrices AB in terms of the rows of A and columns of B. The document proves these formulas and discusses properties of matrix operations like addition and multiplication that are similar to numeric operations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Lesson1 3

The document introduces matrices and discusses different ways to define matrix multiplication. It defines row and column vectors of a matrix and shows that the product of a row vector and column vector yields a 1x1 matrix. It then presents formulas for the product of two matrices AB in terms of the rows of A and columns of B. The document proves these formulas and discusses properties of matrix operations like addition and multiplication that are similar to numeric operations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Introduction to Matrices

Rochana Meegaskumbura
Engineering Mathematics

University of Peradeniya

July 11, 2020

Rochana Meegaskumbura Matrices 1/18


The matrix product in a different way

There is another way to restate our above definition of a


product of two matrices. First, one more notation:

Rochana Meegaskumbura Matrices 2/18


The matrix product in a different way

There is another way to restate our above definition of a


product of two matrices. First, one more notation:
Definition
Let A be an n × m-matrix.
(a) If i ∈ {1, 2, . . . , n}, then rowi A will denote the i-th row of
A. This is a row vector of size m (that is, a 1 × m-matrix), and
is formally defined as

(Ai,y )1≤x≤1, 1≤y≤m = Ai,1 Ai,2 · · · Ai,m

(notice how i is kept fixed but y is ranging from 1 to m here).

Rochana Meegaskumbura Matrices 2/18


Definition
(b) If j ∈ {1, 2, . . . , m}, then colj A will denote the j-th column
of A. This is a column vector of size n (that is, an
n × 1-matrix), and is formally defined as
 
A1,j
 A2,j 
(Ax,j )1≤x≤n, 1≤y≤1 =  .  .
 
 .. 
An,j

Rochana Meegaskumbura Matrices 3/18


Definition
(b) If j ∈ {1, 2, . . . , m}, then colj A will denote the j-th column
of A. This is a column vector of size n (that is, an
n × 1-matrix), and is formally defined as
 
A1,j
 A2,j 
(Ax,j )1≤x≤n, 1≤y≤1 =  .  .
 
 .. 
An,j

Example
 
a b c 
If A = , then row2 A = d e f and
d e f
 
b
col2 A = .
e

Rochana Meegaskumbura Matrices 3/18


Now, we observe that if R is a row vector of some size m, and if
C is a column vector of size m, then RC is a 1 × 1-matrix.
More precisely: The product of a row vector
 
c1
  c2 
r1 r2 · · · rm and a column vector  .  is given by
 
 . .
cm
 
c1
 c2  
r1 r2 · · · rm = r1 c1 + r2 c2 + · · · + rm cm .
 
 ..
 . 
cm
(1)

Rochana Meegaskumbura Matrices 4/18


We shall often equate a 1 × 1-matrix with its (unique) entry; so
the equality (1) rewrites as
 
c1
 c2 

r1 r2 · · · rm  .  = r1 c1 + r2 c2 + · · · + rm cm . (2)
 .. 
cm

Now lets look at a collection of formulas for the product of two


matrices. They are all pretty straightforward to obtain
(essentially, they are the definition of the product viewed from
different angles), but they are helpful when it comes to
manipulating products:

Rochana Meegaskumbura Matrices 5/18


Proposition

Let n ∈ N, m ∈ N and p ∈ N. Let A be an n × m-matrix. Let B


be an m × p-matrix.

Rochana Meegaskumbura Matrices 6/18


Proposition

Let n ∈ N, m ∈ N and p ∈ N. Let A be an n × m-matrix. Let B


be an m × p-matrix.
Proposition
(a) For every i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}, we have

(AB)i,j = Ai,1 B1,j + Ai,2 B2,j + · · · + Ai,m Bm,j .

Rochana Meegaskumbura Matrices 6/18


Proposition

Let n ∈ N, m ∈ N and p ∈ N. Let A be an n × m-matrix. Let B


be an m × p-matrix.
Proposition
(a) For every i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}, we have

(AB)i,j = Ai,1 B1,j + Ai,2 B2,j + · · · + Ai,m Bm,j .

(b) For every i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}, the (i, j)-th
entry of AB equals the product of the i-th row of A and the
j-th column of B. In formulas:

(AB)i,j = rowi A · colj B (3)

for every i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p} (where the


expression rowi A · colj B should be read as (rowi A) · (colj B)).

Rochana Meegaskumbura Matrices 6/18


Proposition continued

(c) For every i ∈ {1, 2, . . . , n}, we have

rowi (AB) = (rowi A) · B.

Rochana Meegaskumbura Matrices 7/18


Proposition continued

(c) For every i ∈ {1, 2, . . . , n}, we have

rowi (AB) = (rowi A) · B.

(d) For every j ∈ {1, 2, . . . , p}, we have

colj (AB) = A · colj B.

Rochana Meegaskumbura Matrices 7/18


Proposition continued

(c) For every i ∈ {1, 2, . . . , n}, we have

rowi (AB) = (rowi A) · B.

(d) For every j ∈ {1, 2, . . . , p}, we have

colj (AB) = A · colj B.

Proposition (c) says that if A and B are two matrices (for


which AB makes sense), then each row of AB equals the
corresponding row of A multiplied by B.

Rochana Meegaskumbura Matrices 7/18


Proposition continued

(c) For every i ∈ {1, 2, . . . , n}, we have

rowi (AB) = (rowi A) · B.

(d) For every j ∈ {1, 2, . . . , p}, we have

colj (AB) = A · colj B.

Proposition (c) says that if A and B are two matrices (for


which AB makes sense), then each row of AB equals the
corresponding row of A multiplied by B. Similarly, Proposition
(d) says that each column of AB equals A multiplied by the
corresponding column of B. These are fairly simple
observations, but they are surprisingly useful.

Rochana Meegaskumbura Matrices 7/18


proof

Proof of Proposition (a) By the definition of AB, we have

AB = (Ai,1 B1,j + Ai,2 B2,j + · · · + Ai,m Bm,j )1≤i≤n, 1≤j≤p .

Rochana Meegaskumbura Matrices 8/18


proof

Proof of Proposition (a) By the definition of AB, we have

AB = (Ai,1 B1,j + Ai,2 B2,j + · · · + Ai,m Bm,j )1≤i≤n, 1≤j≤p .

In other words,

(AB)i,j = Ai,1 B1,j + Ai,2 B2,j + · · · + Ai,m Bm,j (4)

for every i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}. This proves


Proposition (a).

Rochana Meegaskumbura Matrices 8/18


proof

(b) Now, let us prove Proposition (b). It is clearly enough to


prove (3) (because all the other statements of Proposition (b)
are just restatements of (3)). So let’s do this. Let
i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}. Then,

rowi A = Ai,1 Ai,2 · · · Ai,m and (5)
 
B1,j
 B2,j 
colj B =  .  . (6)
 
 .. 
Bm,j

Rochana Meegaskumbura Matrices 9/18


Hence,

 
B1,j
 B2,j 
rowi A · colj B = Ai,1 Ai,2 · · · Ai,m
 
 .. 
 . 
Bm,j
= Ai,1 B1,j + Ai,2 B2,j + · · · + Ai,m Bm,j .

Comparing this with (4), we obtain (AB)i,j = rowi A · colj B.


Thus, we have proven (3). Hence, Proposition (b) is proven.
Similarly the Proposition (c) and (d) can be proved.

Rochana Meegaskumbura Matrices 10/18


Properties of Matrix Operations

The operations of adding, scaling and multiplying matrices, in


many aspects, “behave almost as nicely as numbers”.
Specifically, they satisfy a bunch of laws that numbers satisfy:
Let n ∈ N and m ∈ N. Then:
(a) We have A + B = B + A for any two n × m-matrices A and
B. (This is called “commutativity of addition”.)

Rochana Meegaskumbura Matrices 11/18


Properties of Matrix Operations

The operations of adding, scaling and multiplying matrices, in


many aspects, “behave almost as nicely as numbers”.
Specifically, they satisfy a bunch of laws that numbers satisfy:
Let n ∈ N and m ∈ N. Then:
(a) We have A + B = B + A for any two n × m-matrices A and
B. (This is called “commutativity of addition”.)
(b) We have A + (B + C) = (A + B) + C for any three
n × m-matrices A, B and C. (This is called “associativity of
addition”.)

Rochana Meegaskumbura Matrices 11/18


Properties of Matrix Operations

The operations of adding, scaling and multiplying matrices, in


many aspects, “behave almost as nicely as numbers”.
Specifically, they satisfy a bunch of laws that numbers satisfy:
Let n ∈ N and m ∈ N. Then:
(a) We have A + B = B + A for any two n × m-matrices A and
B. (This is called “commutativity of addition”.)
(b) We have A + (B + C) = (A + B) + C for any three
n × m-matrices A, B and C. (This is called “associativity of
addition”.)
(c1 ) We have λ (A + B) = λA + λB for any number λ and any
two n × m-matrices A and B.

Rochana Meegaskumbura Matrices 11/18


Properties of Matrix Operations

The operations of adding, scaling and multiplying matrices, in


many aspects, “behave almost as nicely as numbers”.
Specifically, they satisfy a bunch of laws that numbers satisfy:
Let n ∈ N and m ∈ N. Then:
(a) We have A + B = B + A for any two n × m-matrices A and
B. (This is called “commutativity of addition”.)
(b) We have A + (B + C) = (A + B) + C for any three
n × m-matrices A, B and C. (This is called “associativity of
addition”.)
(c1 ) We have λ (A + B) = λA + λB for any number λ and any
two n × m-matrices A and B.
(c2 ) We have λ (µA) = (λµ) A and (λ + µ) A = λA + µA for
any numbers λ and µ and any n × m-matrix A.

Rochana Meegaskumbura Matrices 11/18


Properties of Matrix Operations

The operations of adding, scaling and multiplying matrices, in


many aspects, “behave almost as nicely as numbers”.
Specifically, they satisfy a bunch of laws that numbers satisfy:
Let n ∈ N and m ∈ N. Then:
(a) We have A + B = B + A for any two n × m-matrices A and
B. (This is called “commutativity of addition”.)
(b) We have A + (B + C) = (A + B) + C for any three
n × m-matrices A, B and C. (This is called “associativity of
addition”.)
(c1 ) We have λ (A + B) = λA + λB for any number λ and any
two n × m-matrices A and B.
(c2 ) We have λ (µA) = (λµ) A and (λ + µ) A = λA + µA for
any numbers λ and µ and any n × m-matrix A.
(c3 ) We have 1A = A for any n × m-matrix A.

Rochana Meegaskumbura Matrices 11/18


Properties of Matrix Operations

Let furthermore p ∈ N. Then:


(d) We have A (B + C) = AB + AC for any n × m-matrix A
and any two m × p-matrices B and C. (This is called “left
distributivity”.)

Rochana Meegaskumbura Matrices 12/18


Properties of Matrix Operations

Let furthermore p ∈ N. Then:


(d) We have A (B + C) = AB + AC for any n × m-matrix A
and any two m × p-matrices B and C. (This is called “left
distributivity”.)
(e) We have (A + B) C = AC + BC for any two n × m-matrices
A and B and any m × p-matrix C. (This is called “right
distributivity”.)

Rochana Meegaskumbura Matrices 12/18


Properties of Matrix Operations

Let furthermore p ∈ N. Then:


(d) We have A (B + C) = AB + AC for any n × m-matrix A
and any two m × p-matrices B and C. (This is called “left
distributivity”.)
(e) We have (A + B) C = AC + BC for any two n × m-matrices
A and B and any m × p-matrix C. (This is called “right
distributivity”.)
(f ) We have λ (AB) = (λA) B = A (λB) for any number λ, any
n × m-matrix A and any m × p-matrix B.

Rochana Meegaskumbura Matrices 12/18


Properties of Matrix Operations

Let furthermore p ∈ N. Then:


(d) We have A (B + C) = AB + AC for any n × m-matrix A
and any two m × p-matrices B and C. (This is called “left
distributivity”.)
(e) We have (A + B) C = AC + BC for any two n × m-matrices
A and B and any m × p-matrix C. (This is called “right
distributivity”.)
(f ) We have λ (AB) = (λA) B = A (λB) for any number λ, any
n × m-matrix A and any m × p-matrix B.
Finally, let q ∈ N. Then:
(g) We have A (BC) = (AB) C for any n × m-matrix A, any
m × p-matrix B and any p × q-matrix C. (This is called
“associativity of multiplication”.)

Rochana Meegaskumbura Matrices 12/18


Non-Properties of Matrices

1. If A and B are matrices, then it can happen that AB is


well-defined (i.e., A has as many columns as B has rows)
but BA is not (i.e., B does not 
have as many columns as A
a 
has rows). For example, if A =  b  and B = x y ,
c
then AB is well-defined but BA is not.
2. If A and B are matrices such that both AB and BA
well-defined, then AB and BA might still have different
dimensions. Namely, if A is an n × m-matrix and B is an
m × n-matrix, then AB is an n × n-matrix, but BA is an
m × m-matrix. So comparing AB and BA makes no sense
unless n = m.
3. Even if AB and BA are of the same dimensions, they can
still be distinct.

Rochana Meegaskumbura Matrices 13/18


   
1 1 1 0
For example, if A = and B = = AT , then
0 1 1 1
   
2 1 1 1
AB = whereas BA = .
1 1 1 2

Rochana Meegaskumbura Matrices 14/18


Multiplication in summation notation
Using the summation sign, we can rewrite the product AB of
two matrices A and B more nicely:
Let n ∈ N, m ∈ N and p ∈ N. Let A be an n × m-matrix. Let B
be an m × p-matrix. Then,
m
X
(AB)i,j = Ai,k Bk,j for all i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}
k=1

Proof of Proposition .
For all i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}, we have

(AB)i,j = Ai,1 B1,j + Ai,2 B2,j + · · · + Ai,m Bm,j (by Previous res
m
X
= Ai,k Bk,j
k=1

Rochana Meegaskumbura Matrices 15/18


Here we will prove Proposition on Matrix Properties
P (d),
illustrating the use and manipulation of the sign.P(which is
simple enough that you can easily checkP it without signs, but
is nevertheless worth proving using P
the sign just to
demonstrate how to work with the sign):

Proof of Proposition on matrix properties (d).


Let A be an n × m-matrix. Let B and C be two m × p-matrices.
We shall show that (A (B + C))i,j = (AB + AC)i,j for all
i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}. Once this is proven, this
will entail that corresponding entries of the two n × p-matrices
A (B + C) and AB + AC are equal; and thus, these two
matrices have to be equal.
Then the summation notation on matrix multiplication yields
m
X
(AB)i,j = Ai,k Bk,j (7)
k=1

Rochana Meegaskumbura Matrices 16/18


for all i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}.
Summation notation (applied to C instead of B) yields
m
X
(AC)i,j = Ai,k Ck,j (8)
k=1

for all i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}.


Finally, Summation notation (applied to B + C instead of B)
yields

Rochana Meegaskumbura Matrices 16/18


Finally, Proposition on summation (applied to B + C instead of
B) yields
m
X m
X
(A (B + C))i,j = Ai,k (B + C)k,j = Ai,k (Bk,j + Ck,j )
| {z }
k=1 k=1
| {z }
=Bk,j +Ck,j =Ai,k Bk,j +Ai,k Ck,j
(since matrices are
added entry by entry)
m
X m
X m
X
= (Ai,k Bk,j + Ai,k Ck,j ) = Ai,k Bk,j + Ai,k Ck,j
k=1
|k=1 {z } |k=1 {z }
=(AB)i,j =(AC)i,j
(by (7)) (by (8))

by Proposition summation notation, applied t
Ai,k Bk,j and Ai,k Ck,j instead of p, q, ak an
= (AB)i,j + (AC)i,j
 
again because matrices
= (AB + AC)i,j
are added entry by entry

Rochana Meegaskumbura Matrices 17/18


for all i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , p}. In other words,
each entry of the n × p-matrix A (B + C) equals the
corresponding entry of AB + AC. Thus, the matrix A (B + C)
equals AB + AC. This proves Proposition Matrix of properties
part (d).

Rochana Meegaskumbura Matrices 18/18

You might also like