1. Matrices - 03 CSC1001 Discrete Mathematics 1
CHAPTER
āđāļĄāļāļĢāļīāļāļāđ
3 (Matrices)
1 Introduction to Matrices
1. Definition of Matrices
Matrices are used throughout discrete mathematics to express relationships between elements in sets.
Matrices will be used in models of communications networks and transportation systems. Many algorithms will
be developed that use these matrix models.
Definition 1
A matrix is a rectangular array of numbers. A matrix with m rows and n columns is called an m à n matrix.
The plural of matrix is matrices. A matrix with the same number of rows as columns is called square. We
use boldface uppercase letters to represent matrices.
Definition 2
Two matrices are equal if they have the same number of rows and the same number of columns and the
corresponding entries in every position are equal.
Example 1 (4 points) Define a size of m à n matrix.
âĄ1 2 3âĪ
âĒ1 3âĨ
âĒ 2 âĨ âĄâ 3 5 7 âĪ
1) âĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶ 2) âĒ 9 â 7 â 6âĨ âĶâĶâĶâĶâĶâĶâĶâĶ.âĶâĶâĶâĶâĶâĶ
âĒ4 5 6âĨ âĢ âĶ
âĒ âĨ
âĢ4 5 6âĶ
âĄ0 0âĪ
âĒ0 âĄ1 1 1 1 1âĪ
âĒ 0âĨ
âĨ âĒ1 1 1 1 1âĨ
3) âĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶ.. 4) âĒ âĨ âĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶ...
âĒ0 0âĨ
âĒ âĨ âĒ1 1 1 1 1âĨ
âĢ âĶ
âĢ0 0âĶ
Example 2 (4 points) Is matrix equal or not? why?
âĄ1 2 3âĪ âĄ1 2 3 0âĪ
1) A = âĒ4 B= âĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶ..
âĢ 5 6âĨ
âĶ
âĒ4
âĢ 5 6 0âĨâĶ
âĄ1 2 3âĪ âĄ1 5 3âĪ
2) A = âĒ4 B= âĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶ
âĢ 5 6âĨ
âĶ
âĒ4
âĢ 2 6âĨ
âĶ
âĄ1 2 3âĪ âĄ1 2 3âĪ
3) A = âĒ4 B= âĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶ
âĢ 5 6âĨ
âĶ
âĒ4
âĢ 5 6âĨ
âĶ
âĄ0 0 1âĪ âĄ0 0 0âĪ
4) A = âĒ0 B= âĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶâĶ
âĢ 0 0âĨ
âĶ
âĒ1
âĢ 0 0âĨ
âĶ
āļĄāļŦāļēāļ§āļīāļāļĒāļēāļĨāļąāļĒāļĢāļēāļāļ āļąāļāļŠāļ§āļāļŠ āļļāļāļąāļāļāļē (āļ āļēāļāļāļēāļĢāļĻāļķāļāļĐāļēāļāļĩāđ 2/2555) āđāļĢāļĩāļĒāļāđāļĢāļĩāļĒāļāđāļāļĒ āļ.āļ§āļāļĻāđāļĒāļĻ āđāļāļīāļāļĻāļĢāļĩ
2. 2 CSC1001 Discrete Mathematics 03 - Matrices
Definition 3
Let m and n be positive integers and let
⥠a11 a12 L a 1n âĪ
âĒa a 22 L a 2n âĨ
A= âĒ 21 âĨ
âĒ M M M M âĨ
âĒ âĨ
âĢa m1 am2 L a mn âĶ
⥠a1 j âĪ
âĒa âĨ
The ith row of A is the 1 à n matrix [ai1 ai 2 L ain ] . The j th column of A is the m à 1 matrix âĒ 2jâĨ
âĒ M âĨ
âĒ âĨ
âĒ a mj âĨ
âĢ âĶ
The (i, j )th element or entry of A is the element aij , that is, the number in the ith row and j th column of A.
A convenient shorthand notation for expressing the matrix A is to write A = [aij], which indicates that A is
the matrix with its (i, j )th element equal to aij.
Example 3 (8 points) Let A is 5 Ã 4 matrix
âĄ1 3 5 7âĪ
âĒ2 4 6 8âĨ
âĒ âĨ
A= âĒ0 1 0 1âĨ
âĒ âĨ
âĒ1 2 3 4âĨ
âĒ5
âĢ 6 7 8âĨ
âĶ
1) Write W is 1 Ã 4 matrix at the 3rd row of A 2) Write X is 1 Ã 4 matrix at the 5th row of A
3) Write Y is 5 Ã 1 matrix at the 4th column of A 4) Write Z is 5 Ã 1 matrix at the 1st column of A
2. Matrix Arithmetic
Definition 4
Let A = [aij] and B = [bij] be m à n matrices. The sum of A and B, denoted by A + B, is the m à n matrix
that has aij + bij as its (i, j )th element. In other words, A + B = [aij + bij].
āļĄāļŦāļēāļ§āļīāļāļĒāļēāļĨāļąāļĒāļĢāļēāļāļ āļąāļāļŠāļ§āļāļŠ āļļāļāļąāļāļāļē (āļ āļēāļāļāļēāļĢāļĻāļķāļāļĐāļēāļāļĩāđ 2/2555) āđāļĢāļĩāļĒāļāđāļĢāļĩāļĒāļāđāļāļĒ āļ.āļ§āļāļĻāđāļĒāļĻ āđāļāļīāļāļĻāļĢāļĩ
3. Matrices - 03 CSC1001 Discrete Mathematics 3
Example 4 (10 points) Let A and B be m à n matrices. Find A + B
âĄ1 2 3âĪ
A= âĒ4
âĢ 5 6âĨ
âĶ
âĄ1 5 3âĪ
B= âĒ4
âĢ 2 6âĨ
âĶ
Example 5 (10 points) Let A and B be m à n matrices. Find 3A + B
âĄâ 1 â 2 â 3 â 4âĪ
A= âĒ1 2 3 4âĨ
âĒ âĨ
âĒ0
âĢ 2 4 6âĨâĶ
âĄ2 5 â7 1 âĪ
B= âĒâ 1 9 4 â 1âĨ
âĒ âĨ
âĒ 1 â 11
âĢ 7 0âĨ
âĶ
Example 6 (10 points) Let A and B be m à n matrices. Find A - 2B
âĄâ 1 2 â 3 4 âĪ
âĒ0 8 3 4âĨ
A= âĒ âĨ
âĒ 2 â6 5 7âĨ
âĒ âĨ
âĢâ 1 â 6 5 â 3âĶ
âĄ0 5 6 1âĪ
âĒ 2 1 1 9âĨ
B= âĒ âĨ
âĒ 3 â1 â 4 2 âĨ
âĒ âĨ
âĢâ 2 â 7 0 â 1âĶ
Example 7 (10 points) Let A be m à n matrix. Prove that A + A + A = 3A
âĄ1 2 3âĪ
A= âĒ0 3 1 âĨ
âĒ âĨ
âĒ 2 3 2âĨ
âĢ âĶ
Definition 5
Let A be an m à k matrix and B be a k à n matrix. The product of A and B, denoted by AB, is the m à n
matrix with its (i, j )th entry equal to the sum of the products of the corresponding elements from the ith row
of A and the jth column of B. In other words, if AB = [cij ], then cij = ai1b1j + ai2b2j + âĶ +aikbkj .
āļĄāļŦāļēāļ§āļīāļāļĒāļēāļĨāļąāļĒāļĢāļēāļāļ āļąāļāļŠāļ§āļāļŠ āļļāļāļąāļāļāļē (āļ āļēāļāļāļēāļĢāļĻāļķāļāļĐāļēāļāļĩāđ 2/2555) āđāļĢāļĩāļĒāļāđāļĢāļĩāļĒāļāđāļāļĒ āļ.āļ§āļāļĻāđāļĒāļĻ āđāļāļīāļāļĻāļĢāļĩ
4. 4 CSC1001 Discrete Mathematics 03 - Matrices
Figure: The Product of A = [aij ] and B = [bij ]
Example 8 (10 points) Let A be m à k matrix and B be k à n matrix. Find AB
âĄ2 2 â3 1 âĪ
âĄ2 1 5âĪ âĒâ 1 2
A= âĒ 4 7 2âĨ B= âĒ 5 2âĨâĨ
âĢ âĶ âĒ 3 â 3 4 â 5âĨ
âĢ âĶ
Example 9 (10 points) Let A be m à k matrix and B be k à n matrix. Find AB
⥠2 â1 4 âĪ
âĒ â 1 2 â 2âĨ
âĒ âĨ âĄ2 1âĪ
A= âĒ 3 â3 4 âĨ B= âĒâ 1 3 âĨ
âĒ âĨ âĒ âĨ
âĒ5 2 2âĨ âĒ 2 â 3âĨ
âĢ âĶ
âĒ 6 â1 3 âĨ
âĢ âĶ
Example 10 (10 points) Let A be m à k matrix and B be k à n matrix. Find AB
âĄâ 1 0 âĪ
⥠2 2 3âĪ âĒ 1 â 2âĨ
A= âĒ 3 4 4âĨ B= âĒ âĨ
âĢ âĶ âĒ3 0âĨ
âĢ âĶ
āļĄāļŦāļēāļ§āļīāļāļĒāļēāļĨāļąāļĒāļĢāļēāļāļ āļąāļāļŠāļ§āļāļŠ āļļāļāļąāļāļāļē (āļ āļēāļāļāļēāļĢāļĻāļķāļāļĐāļēāļāļĩāđ 2/2555) āđāļĢāļĩāļĒāļāđāļĢāļĩāļĒāļāđāļāļĒ āļ.āļ§āļāļĻāđāļĒāļĻ āđāļāļīāļāļĻāļĢāļĩ
5. Matrices - 03 CSC1001 Discrete Mathematics 5
Example 11 (10 points) Let A and B be n à n matrices. Prove that AB â BA
âĄ1 2 3âĪ âĄ 2 0 0âĪ
A= âĒ0 3 1 âĨ B= âĒ1 2 1 âĨ
âĒ âĨ âĒ âĨ
âĒ 2 3 2âĨ
âĢ âĶ âĒ 5 2 4âĨ
âĢ âĶ
Example 12 (20 points) Let A, B and C be m à n matrices. Find (A + 2B)(3C)
âĄ1 2 1 2âĪ âĄ4 5 1 2âĪ âĄ 2 â 1âĪ
âĒ3 4 0 4âĨ âĒ2 2 2 1âĨ âĒ0 2âĨ
A= âĒ âĨ B= âĒ âĨ C= âĒ âĨ
âĒ2 6 7 3âĨ âĒ1 4 2 1âĨ âĒâ 2 1 âĨ
âĒ âĨ âĒ âĨ âĒ âĨ
âĢ1 2 2 1âĶ âĢ8 9 4 2âĶ âĢ 3 4âĶ
āļĄāļŦāļēāļ§āļīāļāļĒāļēāļĨāļąāļĒāļĢāļēāļāļ āļąāļāļŠāļ§āļāļŠ āļļāļāļąāļāļāļē (āļ āļēāļāļāļēāļĢāļĻāļķāļāļĐāļēāļāļĩāđ 2/2555) āđāļĢāļĩāļĒāļāđāļĢāļĩāļĒāļāđāļāļĒ āļ.āļ§āļāļĻāđāļĒāļĻ āđāļāļīāļāļĻāļĢāļĩ
6. 6 CSC1001 Discrete Mathematics 03 - Matrices
3. Transposes and Powers of Matrices
Definition 6
The identity matrix of order n is the n à n matrix In = [Îīij ], where Îīij = 1 if i = j and Îīij = 0 if i â j . Hence
âĄ1 0 L 0âĪ
âĒ0 âĄ1 0 0 âĪ
âĒ 1 L 0âĨ
âĨ âĒ0 1 0 âĨ
In = for example I3 = âĒ âĨ
âĒM M O MâĨ
âĒ âĨ âĒ0 0 1 âĨ
âĢ âĶ
âĢ0 0 L 1âĶ
Theorem 1
Multiplying a matrix by an appropriately sized identity matrix does not change this matrix. In other words,
when A is an m à n matrix, we have AIn = ImA = A
Theorem 2
Powers of square matrices can be defined. When A is an n à n matrix, we have A0 = In , Ar = AAAâĶA
r times
Example 13 (5 points) Show identity matrix I1, I2 and I4
Example 14 (10 points) Let A be m à n matrix. Prove that AIn = ImA = A
⥠2 2 3âĪ
A= âĒ 3 4 4âĨ
âĢ âĶ
Example 15 (10 points) Let A be n à n matrix. Find A3
âĄ1 2âĪ
A= âĒ3 1 âĨ
âĢ âĶ
āļĄāļŦāļēāļ§āļīāļāļĒāļēāļĨāļąāļĒāļĢāļēāļāļ āļąāļāļŠāļ§āļāļŠ āļļāļāļąāļāļāļē (āļ āļēāļāļāļēāļĢāļĻāļķāļāļĐāļēāļāļĩāđ 2/2555) āđāļĢāļĩāļĒāļāđāļĢāļĩāļĒāļāđāļāļĒ āļ.āļ§āļāļĻāđāļĒāļĻ āđāļāļīāļāļĻāļĢāļĩ
7. Matrices - 03 CSC1001 Discrete Mathematics 7
Definition 7
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. In other words, if At = [bij], then bij = aji for i = 1, 2, âĶ , n and
j = 1, 2, âĶ , m.
Definition 8
A square matrix A is called symmetric if A = At .
Thus A = [aij] is symmetric if aij = aji for all i and j with 1 âĪ i âĪ n and 1 âĪ j âĪ n.
Figure: A Symmetric Matrix or Square Matrix
Example 16 (5 points) Let A be m à n matrix. Find At
⥠2 2 3âĪ
A= âĒ 3 4 4âĨ
âĢ âĶ
Example 17 (5 points) Let A be m à n matrix. Find At
⥠2 â 1âĪ
âĒ0 2âĨ
A= âĒ âĨ
âĒâ 2 1 âĨ
âĒ âĨ
âĢ 3 4âĶ
Example 18 (5 points) Let A be m à n matrix. Find At
âĄ1 2 3âĪ
A= âĒ0 3 1 âĨ
âĒ âĨ
âĒ 2 3 2âĨ
âĢ âĶ
āļĄāļŦāļēāļ§āļīāļāļĒāļēāļĨāļąāļĒāļĢāļēāļāļ āļąāļāļŠāļ§āļāļŠ āļļāļāļąāļāļāļē (āļ āļēāļāļāļēāļĢāļĻāļķāļāļĐāļēāļāļĩāđ 2/2555) āđāļĢāļĩāļĒāļāđāļĢāļĩāļĒāļāđāļāļĒ āļ.āļ§āļāļĻāđāļĒāļĻ āđāļāļīāļāļĻāļĢāļĩ
8. 8 CSC1001 Discrete Mathematics 03 - Matrices
Example 19 (5 points) Let A be m à n matrix. Show that A is a square matrix.
âĄ1 2 3 1âĪ
âĒ2 2 0 5âĨ
A= âĒ âĨ
âĒ3 0 3 0âĨ
âĒ âĨ
âĢ1 5 0 2âĶ
Example 20 (5 points) Let A be m à n matrix. Show that A is not a square matrix.
âĄ0 1 0 1âĪ
âĒ0 0 0 0âĨ
A= âĒ âĨ
âĒ1 1 0 1âĨ
âĒ âĨ
âĢ0 1 1 0âĶ
Example 21 (5 points) Let A be m à n matrix. Is A a square matrix? why?
âĄ1 0 1 1âĪ
âĒ0 1 0 1âĨ
A= âĒ âĨ
âĒ1 0 0 1âĨ
âĒ âĨ
âĢ1 1 1 1âĶ
4. ZeroâOne Matrices
A matrix all of whose entries 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 = b 2 = 1
b1 â§ b 2 = âĻ
âĐ0, otherwise
â§1, if b1 = 1 or b 2 = 1
b1 âĻ b 2 = âĻ
âĐ0, otherwise
Definition 9
Let A = [aij] and B = [bij] be m à n zeroâone matrices. Then 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 22 (5 points) Let A and B be m à n zeroâone matrices. Find A âĻ B
âĄ1 0 1 1âĪ âĄ0 1 0 1âĪ
âĒ0 1 0 1âĨ âĒ0 0 0 0âĨ
A= âĒ âĨ B= âĒ âĨ
âĒ1 0 0 1âĨ âĒ1 1 0 1âĨ
âĒ âĨ âĒ âĨ
âĢ1 1 1 1âĶ âĢ0 1 1 0âĶ
āļĄāļŦāļēāļ§āļīāļāļĒāļēāļĨāļąāļĒāļĢāļēāļāļ āļąāļāļŠāļ§āļāļŠ āļļāļāļąāļāļāļē (āļ āļēāļāļāļēāļĢāļĻāļķāļāļĐāļēāļāļĩāđ 2/2555) āđāļĢāļĩāļĒāļāđāļĢāļĩāļĒāļāđāļāļĒ āļ.āļ§āļāļĻāđāļĒāļĻ āđāļāļīāļāļĻāļĢāļĩ
9. Matrices - 03 CSC1001 Discrete Mathematics 9
Example 23 (5 points) Let A and B be m à n zeroâone matrices. Find A âĻ B
âĄ1 0 0âĪ âĄ1 0 0âĪ
âĒ0 1 1âĨ âĒ1 1 1âĨ
A= âĒ âĨ B= âĒ âĨ
âĒ0 1 1âĨ âĒ1 1 1âĨ
âĒ âĨ âĒ âĨ
âĢ0 0 1âĶ âĢ1 0 0âĶ
Example 24 (5 points) Let A and B be m à n zeroâone matrices. Find A â§ B
âĄ1 0 1 1âĪ âĄ1 1 0 1âĪ
âĒ1 1 0 0âĨ âĒ0 0 0 0âĨ
A= âĒ âĨ B= âĒ âĨ
âĒ1 0 0 0âĨ âĒ1 0 1 1âĨ
âĒ âĨ âĒ âĨ
âĢ1 0 1 1âĶ âĢ0 0 1 0âĶ
Example 25 (5 points) Let A and B be m à n zeroâone matrices. Find A â§ B
âĄ1 0 0âĪ âĄ1 0 0âĪ
âĒ0 1 1âĨ âĒ1 1 1âĨ
A= âĒ âĨ B= âĒ âĨ
âĒ0 1 1âĨ âĒ1 1 1âĨ
âĒ âĨ âĒ âĨ
âĢ0 0 1âĶ âĢ1 0 0âĶ
Example 26 (10 points) Let A, B and C be m à n zeroâone matrices. Find A âĻ (B â§ C)
âĄ1 0 1 1âĪ âĄ1 1 0 1âĪ âĄ0 1 0 1âĪ
âĒ1 1 0 0âĨ âĒ0 0 0 0âĨ âĒ0 0 0 0âĨ
A= âĒ âĨ B= âĒ âĨ C= âĒ âĨ
âĒ1 0 0 0âĨ âĒ1 0 1 1âĨ âĒ1 1 0 1âĨ
âĒ âĨ âĒ âĨ âĒ âĨ
âĢ1 0 1 1âĶ âĢ0 0 1 0âĶ âĢ0 1 1 0âĶ
Definition 10
Let A = [aij] be an m à k zeroâone matrix and B = [bij] be a k à n zeroâone matrix. Then the Boolean
product of A and B, denoted by A . B, is the m à n matrix with (i, j)th entry cij where
cij = (ai1 â§ b1j) âĻ (ai2 â§ b2j) âĻ âĶ âĻ (aik â§ bkj)
āļĄāļŦāļēāļ§āļīāļāļĒāļēāļĨāļąāļĒāļĢāļēāļāļ āļąāļāļŠāļ§āļāļŠ āļļāļāļąāļāļāļē (āļ āļēāļāļāļēāļĢāļĻāļķāļāļĐāļēāļāļĩāđ 2/2555) āđāļĢāļĩāļĒāļāđāļĢāļĩāļĒāļāđāļāļĒ āļ.āļ§āļāļĻāđāļĒāļĻ āđāļāļīāļāļĻāļĢāļĩ
10. 10 CSC1001 Discrete Mathematics 03 - Matrices
Example 27 (10 points) Let A be m à k zeroâone matrix and B be k à n zeroâone matrix. Find A . B
âĄ1 0 0 1 âĪ
âĄ1 1 0âĪ âĒ1 1 0 0 âĨ
A= âĒ1 0 0âĨ B= âĒ âĨ
âĢ âĶ âĒ0 0 0 1 âĨ
âĢ âĶ
Example 28 (10 points) Let A be m à k zeroâone matrix and B be k à n zeroâone matrix. Find A . B
âĄ0 1 1âĪ âĄ0 1 1 1 1 âĪ
A= âĒ0 0 1âĨ B= âĒ1 0 0 0 0 âĨ
âĒ âĨ âĒ âĨ
âĒ1 1 1âĨ
âĢ âĶ âĒ0 0 0 1 1 âĨ
âĢ âĶ
Example 29 (10 points) Let A be m à k zeroâone matrix and B be k à n zeroâone matrix. Find A . B
âĄ1 0 âĪ
âĄ1 1 1 âĪ âĒ0 1 âĨ
A= âĒ0 0 0 âĨ B= âĒ âĨ
âĢ âĶ âĒ1 1 âĨ
âĢ âĶ
āļĄāļŦāļēāļ§āļīāļāļĒāļēāļĨāļąāļĒāļĢāļēāļāļ āļąāļāļŠāļ§āļāļŠ āļļāļāļąāļāļāļē (āļ āļēāļāļāļēāļĢāļĻāļķāļāļĐāļēāļāļĩāđ 2/2555) āđāļĢāļĩāļĒāļāđāļĢāļĩāļĒāļāđāļāļĒ āļ.āļ§āļāļĻāđāļĒāļĻ āđāļāļīāļāļĻāļĢāļĩ