2.6 Matrices: Matrix Equality
2.6 Matrices: Matrix Equality
2.6 Matrices
A matrix is a rectangular array of numbers. A matrix with m rows and n columns is called an
m × n matrix.
1 2 3
4 5 6
7 8 9 is a 4 × 3 matrix.
10 11 12
We specify an element of the matrix with mi,j where the element is at row i and column j. For
example, m2,3 = 6.
Matrix Equality
Matrices are equal if and only if they have the same number of rows, the same number of columns,
and the same elements at every index.
Matrix Addition
We can only perform matrix addition if the matrices have the same dimensions. To express the
addition of two matrices, A and B, we write A + B = [ai,j + bi,j ]. Then simply add the values at
corresponding indices.
1 2 3 9 8 7 (1 + 9) (2 + 8) (3 + 7) 10 10 10
4 5 6 + 6 5 4 = (4 + 6) (5 + 5) (6 + 4) = 10 10 10
7 8 9 3 2 1 (7 + 3) (8 + 2) (9 + 1) 10 10 10
Matrix Multiplication
If A and B are matrices, we can write AB to denote their multiplication. Matrix multiplication is
not commutative (AB 6= BA).
We can only multiply matrices if and only if the first matrix has the same number of columns as
the number of rows in the second matrix.
AB = C
A is an i × k matrix
B is an k × j matrix
The result C is an i × j matrix
Ci,j = (ai,1 b1,j ) + (ai,2 b2,j ) + (ai,2 b2,j ) + . . . + (ai,k bk,j )
1 2 5 6 (1 · 5 + 2 · 7) (1 · 6 + 2 · 8) 19 22
= =
3 4 7 8 (3 · 5 + 4 · 7) (3 · 6 + 4 · 8) 43 50
1
ICS 141: Discrete Mathematics I (Fall 2014)
Identity Matrix
The identity matrix is a n × n square matrix where the main diagonal consist of all ones and zeros
elsewhere.
1 0 ... 0
0 1 . . . 0
In = .. .. . . ..
. . . .
0 0 ... 1
Inverse Matrix
For a square matrix A, the inverse written as A−1 . If A is multiplied by A−1 , then the result is the
identity matrix. AA−1 = A−1 A = In . Note that not all square matrices have an inverse.
Power of Matrices
Square matrices can be multiplied by themselves repeatedly because they have the same number
of rows and columns. An n × n matrix A raised to the positive integer k is defined as
Ak = AAA . . . A
A0 = I
Transpose of Matrices
The Transpose of A, denoted by At , is obtained by turning all the rows into columns and vice
versa.
Zero-One Matrices
2.6 pg 184 # 3
Find AB if
2 1 0 4
a) A = ,B =
3 2 1 3
2 1 0 4 (2 · 0 + 1 · 1) (2 · 4 + 1 · 3) 1 11
= =
3 2 1 3 (3 · 0 + 2 · 1) (3 · 4 + 2 · 3) 2 18
2
ICS 141: Discrete Mathematics I (Fall 2014)
1 −1
3 2 −1
b) A = 0 1 , B =
1 0 3
2 3
1 −1 (1 · 3 + (−1) · 1) (1 · 2 + (−1) · 0) (1 · (−1) + (−1) · 3)
0 1 3 2 −1 = (0 · 3 + 1 · 1) (0 · 2 + 1 · 0) (0 · (−1) + 1 · 3)
1 0 3
2 3 (2 · 3 + 3 · 1) (2 · 2 + 3 · 0) (2 · (−1) + 3 · 3)
2 2 −4
= 1 0 3
9 4 7
2.6 pg 185 # 15
Let
1 1
A=
0 1
Find a formula for An , whenever n is a positive integer.
2 1 1 1 1 1 2
A = AA = =
0 1 0 1 0 1
1 1 1 2 1 3
A3 = AA2 = =
0 1 0 1 0 1
1 1 1 3 1 4
A4 = AA3 = =
0 1 0 1 0 1
..
.
n n−1 1 1 1 n−1 1 n
A = AA = =
0 1 0 1 0 1
2.6 pg 185 # 19
−b ad − bc −ab + ba
d
a b ad − bc ad − bc ad − bc ad − bc 1 0
AA−1 = a = cd − cd −bc + ad = 0 1
−c
c d
ad − bc ad − bc ad − bc ad − bc
3
ICS 141: Discrete Mathematics I (Fall 2014)
−b ad − bc db − bd
d
− bc ad − bc a b ad − bc ad − bc 1 0
A−1 A = ad−c = −ca −bc + ad = 0 1
a c d + ac
ad − bc ad − bc ad − bc ad − bc
Extra Problem
Let
1 1 1 3
A = 2 0 4 6
1 1 3 7
What is At ?
1 2 1
1 0 1
At =
1
4 3
3 6 7
2.6 pg 185 # 27
1 0 1 0 1 1
Let A = 1 1 0 and B = 1 0 1 Find
0 0 1 1 0 1
a) A ∨ B
1 0 1 0 1 1 1 1 1
1 1 0 ∨ 1 0 1 = 1 1 1
0 0 1 1 0 1 1 0 1
b) A ∧ B
1 0 1 0 1 1 0 0 1
1 1 0 ∧ 1 0 1 = 1 0 0
0 0 1 1 0 1 0 0 1
c) A B
1 0 1 0 1 1
1 1 0 1 0 1
0 0 1 1 0 1
(1 ∧ 0) ∨ (0 ∧ 1) ∨ (1 ∧ 1) (1 ∧ 1) ∨ (0 ∧ 0) ∨ (1 ∧ 0) (1 ∧ 1) ∨ (0 ∧ 1) ∨ (1 ∧ 1)
= (1 ∧ 0) ∨ (1 ∧ 1) ∨ (0 ∧ 1) (1 ∧ 1) ∨ (1 ∧ 0) ∨ (0 ∧ 0) (1 ∧ 1) ∨ (1 ∧ 1) ∨ (0 ∧ 1)
(0 ∧ 0) ∨ (0 ∧ 1) ∨ (1 ∧ 1) (0 ∧ 1) ∨ (0 ∧ 0) ∨ (1 ∧ 0) (0 ∧ 1) ∨ (0 ∧ 1) ∨ (1 ∧ 1)
1 1 1
= 1 1 1
1 0 1