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

Lesson 5

This document provides an introduction to matrices and matrix operations including: - Matrices can represent data and relationships between sets. - Operations include addition, multiplication, and taking powers of matrices. - Matrix multiplication is not commutative. - The transpose of a matrix switches the rows and columns.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views

Lesson 5

This document provides an introduction to matrices and matrix operations including: - Matrices can represent data and relationships between sets. - Operations include addition, multiplication, and taking powers of matrices. - Matrix multiplication is not commutative. - The transpose of a matrix switches the rows and columns.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Lesson 5-Matrices

By the end of this lesson, students should be able to;


• Use matrices to represent data
• Perform matrix operations

5.1 Using Matrices to Represent Data


Matrices are used throughout discrete mathematics to express relationships between elements
in sets. For instance, matrices will be used in model of communications networks and
transportation systems.

A matrix is a rectangular array of numbers. A matrix with m rows and n columns is called an
m  n matrix.
A matrix that has the same number of rows as columns is called a square matrix.
Two matrices are equal, if they have the same number of rows and same number of columns
and the corresponding entries in every position are equal.

 Plural of matrix is matrices.


Example 5.1.1
The matrix
1 0 1 
1 2 3 is a 2  3 matrix.
 

 a11 a12 ... a1n 


a 
 21 a22 ... a2n 
Let A    . Then A is a n  m matrix with n rows and m columns.
 
 an1 an2 ... anm 
 

1
The ith row of A is the 1 n matrix  ai1 ai 2 ain  . The jth column of A is the n1

 a1 j 
 
 a2 j  th
matrix   . The (i, j) element or entry of A is the element aij .
 
 anj 

5.2 Matrix Arithmetic


5.2.1 Matrix Addition

Let A  aij  and B  bij  be n  m matrices. The sum of A and B, is the n  m matrix that

has aij  bij as its (i, j)th element. Thus A  B  aij  bij  .

Example 5.2.1
1 0 4 1 3 5 

A  1 2 2   B   2 2 3
 0 2 3  2 3 0 
0 3 9 
A  B  1 0 1
2 5 3

5.2.2 Matrix Multiplication


Let A be an m  k matrix and B be a k  n matrix. The product of A and B, is the m  n
matrix that with its (i, j)th entry equal to the sum of the products of the corresponding
elements from the ith row of A and jth column of B. Thus
AB  cij where cij  ai1b1 j  ai 2b2 j   aik bkj

 a11 a12 ... a1n   b11 b12 ... a1n   c11 c12 ... c1n 
a  b  c 
 21 a22 ... a2n   21 b22 ... b2n   21 c22 ... c2n 
Let A    and B    . AB   
     
am1 am2 ... amk  bk1 bk 2 ... bkn  cm1 cm2 ... cmn 
     

where

2
c11  a11b11  a12b21  a13b31  a1k bk1
c12  a11b12  a12b22  a13b32  a1k bk 2
c13  a11b13  a12b23  a13b33  a1k bk 3

cmn  am1b1n  am2b2n  am3b3n  amk bkn

Example 5.2.2

1 3 3
3 1 4
A  B  4 1 2  . Find AB.
1 2 3  23 2 4 1 33
Solution:
AB should be a 2  3 matrix.
c11  (3)(1)  (1)(4)  (4)(2)  15
c12  (3)(3)  (1)(1)  (4)(4)  24
c13  (3)(3)  (1)(2)  (4)(1)  3
c21  (1)(1)  (2)(4)  (3)(2)  13
c22  (1)(3)  (2)(1)  (3)(4)  7
c23  (1)(3)  (2)(2)  (3)(1)  10
15 24  3 
Thus AB   
13 7 10

 Matrix multiplication is not commutative. That is if A and B are two matrices, it is not
necessarily true that AB and BA are the same.

Example 5.2.3
1 1 2 1
A  B  1 1 . Does AB  BA ?
2 1  
Solution :
3 2   4 3
AB    and BA   .
5 3  3 2
Hence AB  BA

3
5.2.3 Algorithm for Matrix Multiplication
The below algorithm computes the product of two matrices, where A is an m  k matrix and

B is a k  n matrix. The product C  cij  is the m  n matrix.

Algorithm 1: Matrix Multiplication


Procedure matrix multiplication
for i :=1 to m
for j:=1 to n
begin
cij := 0
for q:=1 to k
cij := cij+aiqbqj
end
{C=[cij] is the product of A and B}

Example 5.2.4
How many additions of integers and multiplications of integers are used by Algorithm 1 to
multiply two n  n matrices?
Solution:
There are n2 entries in the product of A and B. To find each entry requires a total of n
multiplications and n-1 additions. Hence a total of n3 multiplications and n2 (n-1) additions
are used.

Self-Assessment Exercises:

1 3 0  1 1 2 3 
1. Let A  1 2 2  B  1 0 3 1  . Find AB .
2 1 1 3 2 0 2

2. Let A be a 3  4 matrix, B be a 4  5 matrix and C be a 4 4 matrix. Determine


which of the following products are defined and find the size of those that are defined.
a) AB b) BA c) AC
d) CA e) BC f) CB

4
5.2.4 Transpose and Powers of Matrices

The identity matrix of size n is given by


1 0 ... 0
0 1 ... 0
 
In   
 
0 0 ... 1 
 
nn

If A is a square matrix of size n, (rows=columns=n) then In A  AIn  A

Powers of matrices
If A is a n  n square matrix,

A0  I n , Ar  AAA A
r times

Let A  aij  be an m  n matrix. The transpose of A , denoted by At is the n  m matrix

obtained by interchanging the rows and columns of A.


1 4 
1 2 3 
Ex: A  A  2 5
t
 4 5 6 3 6 

A square matrix A is called symmetric if A  At .


 1 1 1
Ex: A   1 2 0  is a symmetric matrix since A  At
1 0 5 

5
Zero-One matrices
A matrix with entries that are either 0 or 1 is called a zero-one matrix.
This arithmetic is based on the Boolean operations and which operate on pairs of bits,
defined by
1 if b1  b2  1
b1  b2  
0 otherwise

1 if b1  1 or b2  1
b1  b2  
0 otherwise

Let A  aij  and B  bij  be m  n zero-one matrices. The join of A and B is the zero-one

matrix with (i, j) th entry aij  bij . The join of A and B is denoted by A  B . The meet of A and

B is the zero-one matrix with (i, j) th entry aij  bij . The meet of A and B is denoted by A  B .

Example 5.2.4
Find the join and meet of the zero-one matrices
1 0 1  0 1 0 
A  , B  1 1 0 
0 1 0   
Solution:
We find that the join of A and B is
1  0 0  1 1  0 1 1 1 
A B    
0  1 1  1 0  0 1 1 0

The meet of A and B is


1  0 0  1 1  0 0 0 0
A B    
0  1 1  1 0  0  0 1 0 

6
Self-Assessment Exercises:
1. Let A and B be two n  n matrices. Show that

a) ( A  B)t  At  Bt
b) ( A  B)t  Bt At
c) ( At )t  A

1 0 1  0 1 1
2. Let A  1 1 0  , B  1 0 1
0 0 1 1 0 1

Find a) A  B b) A  B c) A3

Suggested Reading:
Chapter 3: Section 3.8, Kenneth Rosen, (2011) Discrete Mathematics and Its Applications, 7th
Edition, McGraw-Hill Education

You might also like