SlideShare a Scribd company logo
FUNDAMENTALS
Properties of Integers
Theorem: If 𝑛𝑛 and 𝑚𝑚 are integers and 𝑛𝑛 > 0, we can
uniquely write 𝑚𝑚 = 𝑞𝑞 ⋅ 𝑛𝑛 + 𝑟𝑟 for integers 𝑞𝑞 and 𝑟𝑟 with
0 ≤ 𝑟𝑟 < 𝑛𝑛.
𝑟𝑟 = 𝑚𝑚 mod 𝑛𝑛
Example:
 𝑛𝑛 = 3, 𝑚𝑚 = 16: 16 = 5 ⋅ 3 + 1
 𝑛𝑛 = 10, 𝑚𝑚 = 3: 3 = 0 ⋅ 10 + 3
 𝑛𝑛 = 5, 𝑚𝑚 = −11: −11 = (−3) ⋅ 5 + 4
 𝑛𝑛 = 5, 𝑚𝑚 = 10: 10 = 2 ⋅ 5 + 0
2© S. Turaev, CSC 1700 Discrete Mathematics
Properties of Integers
 If 𝑟𝑟 = 0, then 𝑚𝑚 = 𝑞𝑞 ⋅ 𝑛𝑛, i.e., 𝑚𝑚 is a multiple of 𝑛𝑛. We
write 𝑛𝑛|𝑚𝑚.
 If 𝑟𝑟 ≠ 0, then 𝑚𝑚 is not a multiple of 𝑛𝑛. We write 𝑛𝑛 ∤ 𝑚𝑚.
Theorem:
 If 𝑎𝑎|𝑏𝑏 and 𝑎𝑎|𝑐𝑐, then 𝑎𝑎|(𝑏𝑏 + 𝑐𝑐).
 If 𝑎𝑎|𝑏𝑏 and 𝑎𝑎|𝑐𝑐, then 𝑎𝑎|(𝑏𝑏 − 𝑐𝑐).
 If 𝑎𝑎|𝑏𝑏 and 𝑎𝑎|𝑐𝑐, then 𝑎𝑎|(𝑏𝑏𝑏𝑏).
 If 𝑎𝑎|𝑏𝑏 and 𝑏𝑏|𝑐𝑐, then 𝑎𝑎|𝑐𝑐.
3© S. Turaev, CSC 1700 Discrete Mathematics
Prime Numbers
Definition: A positive integer 𝑝𝑝 > 1 is called prime, if the
only positive integers that divide 𝑝𝑝 are 𝑝𝑝 and 1.
Example: 2, 3, 5, 7, 11, 13, … are prime.
4© S. Turaev, CSC 1700 Discrete Mathematics
Is 1 prime?
Prime Numbers
Algorithm for determining if an integer 𝑛𝑛 > 1 is prime:
Step 1: Check if 𝑛𝑛 is 2. if so, 𝑛𝑛 is prime. If not, proceed to
Step 2: Check if 2|𝑛𝑛. if so, 𝑛𝑛 isn’t prime. If not, proceed to
Step 3: Compute the largest integer 𝑘𝑘 ≤ 𝑛𝑛; proceed to
Step 4: Check if 𝑑𝑑|𝑛𝑛 where 𝑑𝑑 is any odd number in (1, 𝑘𝑘].
If 𝑑𝑑|𝑛𝑛, then 𝑛𝑛 isn’t prime; otherwise it is prime.
5© S. Turaev, CSC 1700 Discrete Mathematics
Prime Factorization
Theorem: Every positive integer 𝑛𝑛 > 1 can be written
uniquely as
𝑛𝑛 = 𝑝𝑝1
𝑘𝑘1
𝑝𝑝2
𝑘𝑘2
⋯ 𝑝𝑝𝑠𝑠
𝑘𝑘𝑠𝑠
where
 𝑝𝑝1 < 𝑝𝑝2 < ⋯ < 𝑝𝑝𝑠𝑠 are distinct prime numbers that
divide 𝑛𝑛,
 the 𝑘𝑘’s are positive integers giving the number of
times each prime occurs as a factor of 𝑛𝑛.
Example: 9 = 3 ⋅ 3 = 32, 36 =, 100 =
6© S. Turaev, CSC 1700 Discrete Mathematics
Greatest Common Divisor
Definition:
 If 𝑎𝑎, 𝑏𝑏 and 𝑘𝑘 are in ℤ+, and 𝑘𝑘|𝑎𝑎 and 𝑘𝑘|𝑏𝑏, we say that
𝑘𝑘 is a common divisor of 𝑎𝑎 and 𝑏𝑏.
 If 𝑑𝑑 is the largest such 𝑘𝑘, 𝑑𝑑 is called the greatest
common divisor of 𝑎𝑎 and 𝑏𝑏, and we write 𝑑𝑑 =
gcd(𝑎𝑎, 𝑏𝑏).
Example:
 the common divisors of 12 and 30: 1, 2, 3, 6.
gcd 12,30 = 6
 gcd 17,95 = 1 (relatively prime numbers)
7© S. Turaev, CSC 1700 Discrete Mathematics
Euclidean Algorithm
 Suppose 𝑎𝑎 > 𝑏𝑏 > 0. We can write
𝑎𝑎 = 𝑘𝑘𝑘𝑘 + 𝑟𝑟
where 𝑘𝑘 ∈ ℤ+
and 0 ≤ 𝑟𝑟 < 𝑏𝑏.
 If a number 𝑛𝑛 divides 𝑎𝑎 and 𝑏𝑏, then it must divide 𝑟𝑟,
since 𝑟𝑟 = 𝑎𝑎 − 𝑘𝑘𝑘𝑘. Thus,
gcd 𝑎𝑎, 𝑏𝑏 = gcd(𝑏𝑏, 𝑎𝑎 mod 𝑏𝑏)
8© S. Turaev, CSC 1700 Discrete Mathematics
Euclidean Algorithm
gcd 𝑎𝑎, 𝑏𝑏 = gcd(𝑏𝑏, 𝑎𝑎 mod 𝑏𝑏)
divide 𝑎𝑎 by 𝑏𝑏: 𝑎𝑎 = 𝑘𝑘1 𝑏𝑏 + 𝑟𝑟1 0 ≤ 𝑟𝑟1 < 𝑏𝑏
divide 𝑏𝑏 by 𝑟𝑟1: 𝑏𝑏 = 𝑘𝑘2 𝑟𝑟1 + 𝑟𝑟2 0 ≤ 𝑟𝑟2 < 𝑟𝑟1
divide 𝑟𝑟1 by 𝑟𝑟2: 𝑟𝑟1 = 𝑘𝑘3 𝑟𝑟2 + 𝑟𝑟3 0 ≤ 𝑟𝑟3 < 𝑟𝑟2
…
divide 𝑟𝑟𝑛𝑛−2 by 𝑟𝑟𝑛𝑛−1: 𝑟𝑟𝑛𝑛−2 = 𝑘𝑘𝑛𝑛 𝑟𝑟𝑛𝑛−1 + 𝑟𝑟𝑛𝑛 0 ≤ 𝑟𝑟𝑛𝑛 < 𝑟𝑟𝑛𝑛−1
divide 𝑟𝑟𝑛𝑛−1 by 𝑟𝑟𝑛𝑛: 𝑟𝑟𝑛𝑛−1 = 𝑘𝑘𝑛𝑛+1 𝑟𝑟𝑛𝑛 + 𝑟𝑟𝑛𝑛+1 0 ≤ 𝑟𝑟𝑛𝑛+1 < 𝑟𝑟𝑛𝑛
𝑎𝑎 > 𝑏𝑏 > 𝑟𝑟1 > 𝑟𝑟2 > 𝑟𝑟3 > ⋯
9© S. Turaev, CSC 1700 Discrete Mathematics
Euclidean Algorithm
gcd 𝑎𝑎, 𝑏𝑏 = gcd(𝑏𝑏, 𝑎𝑎 mod 𝑏𝑏)
𝑎𝑎 > 𝑏𝑏 > 𝑟𝑟1 > 𝑟𝑟2 > 𝑟𝑟3 > ⋯ > 𝑟𝑟𝑛𝑛+1 = 0
𝑟𝑟𝑛𝑛−1 = 𝑘𝑘𝑛𝑛+1 𝑟𝑟𝑛𝑛 : 𝑟𝑟𝑛𝑛 𝑟𝑟𝑛𝑛−1, 𝑟𝑟𝑛𝑛 𝑟𝑟𝑛𝑛−2, … , 𝑟𝑟𝑛𝑛 𝑟𝑟2, 𝑟𝑟𝑛𝑛 𝑟𝑟1, 𝑟𝑟𝑛𝑛|𝑏𝑏, 𝑟𝑟𝑛𝑛|𝑎𝑎
gcd 𝑎𝑎, 𝑏𝑏 =
gcd 𝑏𝑏, 𝑟𝑟1 = gcd 𝑟𝑟1, 𝑟𝑟2 = ⋯ = gcd 𝑟𝑟𝑛𝑛−1, 𝑟𝑟𝑛𝑛 = 𝑟𝑟𝑛𝑛
Example: Compute gcd(123, 36)
10© S. Turaev, CSC 1700 Discrete Mathematics
Least Common Multiple
Definition:
 If 𝑎𝑎, 𝑏𝑏 and 𝑘𝑘 are in ℤ+, and 𝑎𝑎|𝑘𝑘 and 𝑏𝑏|𝑘𝑘, we say that
𝑘𝑘 is a common multiple of 𝑎𝑎 and 𝑏𝑏.
 If 𝑐𝑐 is the smallest such 𝑘𝑘, 𝑐𝑐 is called the least
common multiple of 𝑎𝑎 and 𝑏𝑏, and we write 𝑐𝑐 =
lcm(𝑎𝑎, 𝑏𝑏).
Example:
 the common multiples of 2 and 3: 6, 12, 18, 24, …
lcm 2,3 = 6.
11© S. Turaev, CSC 1700 Discrete Mathematics
Least Common Multiple
Theorem: if 𝑎𝑎, 𝑏𝑏 ∈ ℤ+, then
gcd(𝑎𝑎, 𝑏𝑏) ⋅ lcm 𝑎𝑎, 𝑏𝑏 = 𝑎𝑎 ⋅ 𝑏𝑏.
Proof: Use prime factorizations of 𝑎𝑎 and 𝑏𝑏.
Example: Let 𝑎𝑎 = 540 and 𝑏𝑏 = 504. Find gcd and lcm.
12© S. Turaev, CSC 1700 Discrete Mathematics
Exercises
• Write 𝑚𝑚 as 𝑞𝑞𝑞𝑞 + 𝑟𝑟, with 0 ≤ 𝑟𝑟 < 𝑛𝑛:
1. 𝑚𝑚 = 20, 𝑛𝑛 = 3
2. 𝑚𝑚 = 64, 𝑛𝑛 = 37
3. 𝑚𝑚 = 3, 𝑛𝑛 = 12
• Write each integer as a product of powers of primes:
828, 1666, 1781
• Find the gcd(𝑎𝑎, 𝑏𝑏) and lcm(𝑎𝑎, 𝑏𝑏):
1. 𝑎𝑎 = 60, 𝑏𝑏 = 100
2. 𝑎𝑎 = 77, 𝑏𝑏 = 128
13© S. Turaev, CSC 1700 Discrete Mathematics
Representation of Integers (Reading)
• 3245 means the sum of 3 times 103, 2 times 102, 4
times 10 and 5:
3245 = 3 ⋅ 103 + 2 ⋅ 102 + 4 ⋅ 10 + 5 ⋅ 100
• The base 10 expansion or decimal expansion of 3245
• 10 is called the base of the expansion.
Example:
56893 =
14© S. Turaev, CSC 1700 Discrete Mathematics
Representation of Integers (Reading)
Theorem: if 𝑏𝑏 ∈ ℤ+, then every positive integer 𝑛𝑛 can be
uniquely expressed in the form
𝑛𝑛 = 𝑑𝑑𝑘𝑘 ⋅ 𝑏𝑏𝑘𝑘 + 𝑑𝑑𝑘𝑘−1 ⋅ 𝑏𝑏𝑘𝑘−1 + ⋯ 𝑑𝑑1 ⋅ 𝑏𝑏 + 𝑑𝑑0
where 0 ≤ 𝑑𝑑𝑖𝑖 < 𝑏𝑏, 𝑖𝑖 = 1,2, … , 𝑘𝑘, and 𝑑𝑑𝑘𝑘 ≠ 0.
The sequence 𝑑𝑑𝑘𝑘 𝑑𝑑𝑘𝑘−1 ⋯ 𝑑𝑑1 𝑑𝑑0 (more explicitly,
𝑑𝑑𝑘𝑘 𝑑𝑑𝑘𝑘−1 ⋯ 𝑑𝑑1 𝑑𝑑0 𝑏𝑏) is called the base 𝑏𝑏 expansion of 𝑛𝑛.
Example: Find the base 2, 3, 4 representations of 173.
Example: Find the decimal expansion of 100111 2.
15© S. Turaev, CSC 1700 Discrete Mathematics
Matrices
Definition: A matrix is a rectangular array of numbers in
𝑚𝑚 horizontal rows and 𝑛𝑛 vertical columns:
𝐀𝐀 =
𝑎𝑎11 𝑎𝑎12
𝑎𝑎21 𝑎𝑎22
⋯
𝑎𝑎1𝑛𝑛
𝑎𝑎2𝑛𝑛
⋮ ⋮
𝑎𝑎 𝑚𝑚1 𝑎𝑎 𝑚𝑚𝑚 ⋯ 𝑎𝑎 𝑚𝑚𝑚𝑚
Definition: The 𝑖𝑖th row of 𝐀𝐀 is [𝑎𝑎𝑖𝑖 𝑖 𝑎𝑎𝑖𝑖 𝑖 ⋯ 𝑎𝑎𝑖𝑖 𝑖𝑖], 1 ≤ 𝑖𝑖 ≤ 𝑚𝑚,
and the 𝑗𝑗th column of 𝐀𝐀 is
𝑎𝑎1𝑗𝑗
𝑎𝑎2𝑗𝑗
⋮
𝑎𝑎𝑛𝑛𝑛𝑛
, 1 ≤ 𝑗𝑗 ≤ 𝑛𝑛.
16© S. Turaev, CSC 1700 Discrete Mathematics
Matrices
Definition: We say that 𝐀𝐀 is 𝑚𝑚 by 𝑛𝑛, written 𝑚𝑚 × 𝑛𝑛. If
𝑚𝑚 = 𝑛𝑛, we say 𝐀𝐀 is a square matrix of order 𝑛𝑛. The
elements 𝑎𝑎11, 𝑎𝑎22, … , 𝑎𝑎𝑛𝑛𝑛𝑛 form main diagonal of 𝐀𝐀.
Definition: We refer to the element 𝑎𝑎𝑖𝑖𝑖𝑖 in the 𝑖𝑖th row and
𝑗𝑗th column of 𝐀𝐀 as the (𝑖𝑖, 𝑗𝑗) entry of 𝐀𝐀. We denote the
matrix 𝐀𝐀 by [𝑎𝑎𝑖𝑖𝑖𝑖], for short.
Example:
𝐀𝐀 =
2 3 5
0 −1 2
, 𝐁𝐁 =
2 6
3 6
, 𝐂𝐂 = 1 0 0 , 𝐃𝐃 =
1
1
1
17© S. Turaev, CSC 1700 Discrete Mathematics
Matrices
Definition: A square matrix 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] is called a diagonal
matrix if 𝑎𝑎𝑖𝑖𝑖𝑖 = 0 for all 𝑖𝑖 ≠ 𝑗𝑗.
Example:
𝐅𝐅 =
2 0
0 6
, 𝐆𝐆 =
1 0 0
0 3 0
0 0 −3
, 𝐇𝐇 =
0 0 0
0 3 0
0 0 0
Definition: A 𝑚𝑚 × 𝑛𝑛 matrix 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] is called zero matrix,
denoted by 𝟎𝟎, if 𝑎𝑎𝑖𝑖𝑖𝑖 = 0 for all 1 ≤ 𝑖𝑖 ≤ 𝑚𝑚, 1 ≤ 𝑗𝑗 ≤ 𝑛𝑛.
18© S. Turaev, CSC 1700 Discrete Mathematics
Matrices
Definition: Two 𝑚𝑚 × 𝑛𝑛 matrices 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] and 𝐁𝐁 = [𝑏𝑏𝑖𝑖𝑖𝑖]
are said to be equal if 𝑎𝑎𝑖𝑖𝑖𝑖 = 𝑏𝑏𝑖𝑖𝑖𝑖 for all 𝑖𝑖 and 𝑗𝑗.
Definition: If 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] and 𝐁𝐁 = [𝑏𝑏𝑖𝑖𝑖𝑖] are 𝑚𝑚 × 𝑛𝑛 matrices,
then the sum of 𝐀𝐀 and 𝐁𝐁, denoted by 𝐀𝐀 + 𝐁𝐁, is the matrix
𝐂𝐂 = [𝑐𝑐𝑖𝑖𝑖𝑖] defined by 𝑐𝑐𝑖𝑖𝑖𝑖 = 𝑎𝑎𝑖𝑖𝑖𝑖 + 𝑏𝑏𝑖𝑖𝑖𝑖 for all 1 ≤ 𝑖𝑖 ≤ 𝑚𝑚,
1 ≤ 𝑗𝑗 ≤ 𝑛𝑛.
Example: Find 𝐀𝐀+ 𝐁𝐁 if
𝐀𝐀 =
1 0 −8
3 3 0
−2 9 −3
, 𝐁𝐁 =
4 5 3
0 −3 2
5 0 −2
19© S. Turaev, CSC 1700 Discrete Mathematics
Matrices
Theorem:
 𝐀𝐀 + 𝐁𝐁 = 𝐁𝐁 + 𝐀𝐀
 𝐀𝐀 + 𝐁𝐁 + 𝐂𝐂 = 𝐀𝐀 + (𝐁𝐁 + 𝐂𝐂)
 𝐀𝐀 + 𝟎𝟎 = 𝟎𝟎 + 𝐀𝐀 = 𝐀𝐀
20© S. Turaev, CSC 1700 Discrete Mathematics
Matrices
Definition: If 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] is 𝑚𝑚 × 𝑝𝑝 matrix and 𝐁𝐁 = [𝑏𝑏𝑖𝑖𝑖𝑖] are
𝑝𝑝 × 𝑛𝑛 matrix, then the product of 𝐀𝐀 and 𝐁𝐁, denotes by
𝐀𝐀𝐀𝐀 is the 𝑚𝑚 × 𝑛𝑛 matrix 𝐂𝐂 = [𝑐𝑐𝑖𝑖𝑖𝑖] defined by
𝑐𝑐𝑖𝑖𝑖𝑖 = 𝑎𝑎𝑖𝑖 𝑖 𝑏𝑏1𝑗𝑗 + 𝑎𝑎𝑖𝑖2 𝑏𝑏2𝑗𝑗 + ⋯ 𝑎𝑎𝑖𝑖 𝑝𝑝 𝑏𝑏𝑝𝑝𝑗𝑗
for all 1 ≤ 𝑖𝑖 ≤ 𝑚𝑚, 1 ≤ 𝑗𝑗 ≤ 𝑛𝑛.
Example: Find 𝐀𝐀𝐁𝐁 if
𝐀𝐀 =
1 0 −8
3 3 0
−2 9 −3
, 𝐁𝐁 =
4 5 3
0 −3 2
5 0 −2
21© S. Turaev, CSC 1700 Discrete Mathematics
Matrices
Theorem:
 𝐀𝐀(𝐁𝐁𝐁𝐁) = 𝐀𝐀𝐀𝐀 𝐂𝐂
 𝐀𝐀 𝐁𝐁 + 𝐂𝐂 = 𝐀𝐀𝐀𝐀 + 𝐀𝐀𝐀𝐀
 𝐀𝐀 + 𝐁𝐁 𝐂𝐂 = 𝐀𝐀𝐀𝐀 + 𝐁𝐁𝐁𝐁
22© S. Turaev, CSC 1700 Discrete Mathematics
Matrices
Definition: A 𝑛𝑛 × 𝑛𝑛 diagonal matrix:
𝐈𝐈𝑛𝑛 =
1 0
0 1
⋯
0
0
⋮ ⋮
0 0 ⋯ 1
is called the identity matrix of order 𝑛𝑛.
Theorem: For any 𝑛𝑛 × 𝑛𝑛 matrix 𝐀𝐀 and positive integer 𝑝𝑝,
 𝐈𝐈𝑛𝑛 𝐀𝐀 = 𝐀𝐀𝐈𝐈𝑛𝑛 = 𝐀𝐀
 𝐀𝐀𝑝𝑝
= 𝐀𝐀 ⋅ 𝐀𝐀 ⋅ ⋯ ⋅ 𝐀𝐀
𝑝𝑝
, 𝐀𝐀0
= 𝐈𝐈𝑛𝑛.
23© S. Turaev, CSC 1700 Discrete Mathematics
Matrices
Definition: If 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] is 𝑚𝑚 × 𝑛𝑛 matrix, then the 𝑛𝑛 × 𝑚𝑚
matrix 𝐀𝐀𝑇𝑇 = [𝑎𝑎𝑖𝑖𝑖𝑖
𝑇𝑇
], where 𝑎𝑎𝑖𝑖𝑖𝑖
𝑇𝑇
= 𝑎𝑎𝑗𝑗𝑗𝑗, for all 1 ≤ 𝑖𝑖 ≤ 𝑚𝑚,
1 ≤ 𝑗𝑗 ≤ 𝑛𝑛, is called the transpose of 𝐀𝐀.
Example: Find 𝐀𝐀𝑇𝑇 and 𝐁𝐁𝑇𝑇 if
𝐀𝐀 =
1 0 −8
3 3 0
−2 9 −3
, 𝐁𝐁 =
2 −3 5
6 1 3
24© S. Turaev, CSC 1700 Discrete Mathematics
Matrices
Theorem:
 𝐀𝐀𝑇𝑇 𝑇𝑇
= 𝐀𝐀
 𝐀𝐀 + 𝐁𝐁 𝑇𝑇 = 𝐀𝐀𝑇𝑇 + 𝐁𝐁𝑇𝑇
 𝐀𝐀𝐁𝐁 𝑇𝑇 = 𝐁𝐁𝑇𝑇 𝐀𝐀𝑇𝑇
Definition: A matrix 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] is called symmetric if
𝑨𝑨𝑇𝑇=𝐀𝐀.
Definition: if 𝐀𝐀 and 𝐁𝐁 are 𝑛𝑛 × 𝑛𝑛 matrices, we say 𝐁𝐁 is the
inverse of 𝐀𝐀 if 𝐀𝐀𝐁𝐁 = 𝐈𝐈𝑛𝑛.
25© S. Turaev, CSC 1700 Discrete Mathematics
Boolean Matrix Operations
Definition: A Boolean matrix is 𝑚𝑚 × 𝑛𝑛 matrix whose
entries are either zero or one.
Definition: Let 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] and 𝐁𝐁 = [𝑏𝑏𝑖𝑖𝑖𝑖] be 𝑚𝑚 × 𝑛𝑛 Boolean
matrices. We define 𝐀𝐀 ∨ 𝐁𝐁 = 𝐂𝐂 = [𝑐𝑐𝑖𝑖𝑖𝑖], the join of 𝐀𝐀 and
𝐁𝐁, by
𝑐𝑐𝑖𝑖𝑖𝑖 = 1 if 𝑎𝑎𝑖𝑖𝑖𝑖 = 1 or 𝑏𝑏𝑖𝑖𝑖𝑖 = 1, 𝑐𝑐𝑖𝑖𝑖𝑖 = 0 if 𝑎𝑎𝑖𝑖𝑖𝑖 = 𝑏𝑏𝑖𝑖𝑖𝑖 = 0,
and the meet of 𝐀𝐀 and 𝐁𝐁, by
𝑐𝑐𝑖𝑖𝑖𝑖 = 1 if 𝑎𝑎𝑖𝑖𝑖𝑖 = 𝑏𝑏𝑖𝑖𝑖𝑖 = 1, 𝑐𝑐𝑖𝑖𝑖𝑖 = 0 if 𝑎𝑎𝑖𝑖𝑖𝑖 = 0 or 𝑏𝑏𝑖𝑖𝑖𝑖 = 0.
26© S. Turaev, CSC 1700 Discrete Mathematics
Boolean Matrix Operations
Example: Compute 𝐀𝐀 ∨ 𝐁𝐁 and 𝐀𝐀 ∧ 𝐁𝐁 if
𝐀𝐀 =
1 0 1
0 1 1
1 1 0
0 0 0
, 𝐁𝐁 =
1 1 0
1 0 1
0 0 1
1 1 0
27© S. Turaev, CSC 1700 Discrete Mathematics
Boolean Matrix Operations
Definition: Let 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] be an 𝑚𝑚 × 𝑝𝑝 Boolean matrix and
𝐁𝐁 = [𝑏𝑏𝑖𝑖𝑖𝑖] be a 𝑝𝑝 × 𝑛𝑛 Boolean matrix. The Boolean
product of 𝐀𝐀 and 𝐁𝐁, denoted by 𝐀𝐀 ⊙ 𝐁𝐁, is the 𝑚𝑚 × 𝑛𝑛
matrix 𝐂𝐂 = [𝑐𝑐𝑖𝑖𝑖𝑖] defined by
 𝑐𝑐𝑖𝑖𝑖𝑖 = 1 if 𝑎𝑎𝑖𝑖𝑖𝑖 = 1 and 𝑏𝑏𝑖𝑖𝑖𝑖 = 1, for some 1 ≤ 𝑘𝑘 ≤ 𝑝𝑝,
 𝑐𝑐𝑖𝑖𝑖𝑖 = 0 otherwise.
28© S. Turaev, CSC 1700 Discrete Mathematics
Boolean Matrix Operations
Example: Compute 𝐀𝐀 ⊙ 𝐁𝐁 if
𝐀𝐀 =
1 0 1
0 1 1
1 1 0
, 𝐁𝐁 =
1 1 0
1 0 1
0 0 1
29© S. Turaev, CSC 1700 Discrete Mathematics
Boolean Matrix Operations
Theorem:
 𝐀𝐀 ∨ 𝐁𝐁 = 𝐁𝐁 ∨ 𝐀𝐀
 𝐀𝐀 ∧ 𝐁𝐁 = 𝐁𝐁 ∧ 𝐀𝐀
 𝐀𝐀 ∨ 𝐁𝐁 ∨ 𝐂𝐂 = 𝐀𝐀 ∨ (𝐁𝐁 ∨ 𝐂𝐂)
 𝐀𝐀 ∧ 𝐁𝐁 ∧ 𝐂𝐂 = 𝐀𝐀 ∧ (𝐁𝐁 ∧ 𝐂𝐂)
 𝐀𝐀 ∧ 𝐁𝐁 ∨ 𝐂𝐂 = 𝐀𝐀 ∧ 𝐁𝐁 ∨ 𝐀𝐀 ∧ 𝐂𝐂
 𝐀𝐀 ∨ 𝐁𝐁 ∧ 𝐂𝐂 = 𝐀𝐀 ∨ 𝐁𝐁 ∧ (𝐀𝐀 ∨ 𝐂𝐂)
 𝐀𝐀 ⊙ 𝐁𝐁 ⊙ 𝐂𝐂 = 𝐀𝐀 ⊙ (𝐁𝐁 ⊙ 𝐂𝐂)
30© S. Turaev, CSC 1700 Discrete Mathematics

More Related Content

PPTX
Recursion DM
PPT
Mathematical induction
PDF
Recurrence relations
PPTX
Number system conversion
PPT
Set in discrete mathematics
PPT
Minimization of DFA
PPT
Introduction to homography
PDF
Lecture-2(2): Number System & Conversion
Recursion DM
Mathematical induction
Recurrence relations
Number system conversion
Set in discrete mathematics
Minimization of DFA
Introduction to homography
Lecture-2(2): Number System & Conversion

What's hot (20)

PDF
Intro to Discrete Mathematics
PPSX
Basic of number system
PPT
Number theory
PPTX
LECTURE 2: PROPOSITIONAL EQUIVALENCES
PPTX
A presentation on differencial calculus
PPTX
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
PPTX
Differential equations
PPTX
number theory.ppt
PPT
Number Systems
PDF
Math induction principle (slides)
PPT
Regular expressions-Theory of computation
PPT
Graph isomorphism
PPTX
Asymptotic notations
PPTX
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
PPTX
Mathematical induction
PPTX
Pigeon hole principle
PPT
Combinatorics
PPTX
Normal forms
PPT
DESIGN AND ANALYSIS OF ALGORITHMS
PPTX
Ordinary differential equations
Intro to Discrete Mathematics
Basic of number system
Number theory
LECTURE 2: PROPOSITIONAL EQUIVALENCES
A presentation on differencial calculus
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
Differential equations
number theory.ppt
Number Systems
Math induction principle (slides)
Regular expressions-Theory of computation
Graph isomorphism
Asymptotic notations
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
Mathematical induction
Pigeon hole principle
Combinatorics
Normal forms
DESIGN AND ANALYSIS OF ALGORITHMS
Ordinary differential equations
Ad

Similar to Integers and matrices (slides) (20)

PPTX
MATRICES-MATHED204.pptx
PPT
Iss lecture 3
PPTX
AC-Unit1.pptx CRYPTOGRAPHIC NNNNFOR ALL
PPTX
Number theoryตัวจริง
PPTX
Number theoryตัวจริง
PPTX
CMSC 56 | Lecture 17: Matrices
PDF
Metrix[1]
PPT
Per5_matrix multiplication
PPT
Module - III.pptssssssssssssssssssssssssssssssssssssssssssssssss
PDF
Proof Techniques
PPTX
Mathematical_background_on_Blockchain__GenerativeAI.pptx
PPTX
Nbvtalkatbzaonencryptionpuzzles
PPTX
Nbvtalkatbzaonencryptionpuzzles
PPT
Ini adalah ppt yang sangat baik untuk memahami tb
PDF
Matrices & Determinants
PPTX
PPT
ADVANCED ALGORITHMS-UNIT-3-Final.ppt
PPT
MFCS-17.ppt
PDF
Book linear
PDF
Daa chapter8
MATRICES-MATHED204.pptx
Iss lecture 3
AC-Unit1.pptx CRYPTOGRAPHIC NNNNFOR ALL
Number theoryตัวจริง
Number theoryตัวจริง
CMSC 56 | Lecture 17: Matrices
Metrix[1]
Per5_matrix multiplication
Module - III.pptssssssssssssssssssssssssssssssssssssssssssssssss
Proof Techniques
Mathematical_background_on_Blockchain__GenerativeAI.pptx
Nbvtalkatbzaonencryptionpuzzles
Nbvtalkatbzaonencryptionpuzzles
Ini adalah ppt yang sangat baik untuk memahami tb
Matrices & Determinants
ADVANCED ALGORITHMS-UNIT-3-Final.ppt
MFCS-17.ppt
Book linear
Daa chapter8
Ad

More from IIUM (20)

PDF
How to use_000webhost
PDF
Chapter 2
PDF
Chapter 1
PDF
Kreydle internship-multimedia
PDF
03phpbldgblock
PDF
Chap2 practice key
PDF
Group p1
PDF
Tutorial import n auto pilot blogspot friendly seo
PDF
Visual sceneperception encycloperception-sage-oliva2009
PDF
03 the htm_lforms
PDF
Exercise on algo analysis answer
PDF
Redo midterm
PDF
Heaps
PDF
Report format
PDF
Edpuzzle guidelines
PDF
Final Exam Paper
PDF
Final Exam Paper
PDF
Group assignment 1 s21516
PDF
Avl tree-rotations
PDF
Week12 graph
How to use_000webhost
Chapter 2
Chapter 1
Kreydle internship-multimedia
03phpbldgblock
Chap2 practice key
Group p1
Tutorial import n auto pilot blogspot friendly seo
Visual sceneperception encycloperception-sage-oliva2009
03 the htm_lforms
Exercise on algo analysis answer
Redo midterm
Heaps
Report format
Edpuzzle guidelines
Final Exam Paper
Final Exam Paper
Group assignment 1 s21516
Avl tree-rotations
Week12 graph

Recently uploaded (20)

PDF
Classroom Observation Tools for Teachers
PDF
Pre independence Education in Inndia.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Cell Types and Its function , kingdom of life
PPTX
Lesson notes of climatology university.
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Pharma ospi slides which help in ospi learning
PDF
Complications of Minimal Access Surgery at WLH
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Cell Structure & Organelles in detailed.
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
master seminar digital applications in india
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Classroom Observation Tools for Teachers
Pre independence Education in Inndia.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
PPH.pptx obstetrics and gynecology in nursing
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Microbial diseases, their pathogenesis and prophylaxis
Cell Types and Its function , kingdom of life
Lesson notes of climatology university.
Supply Chain Operations Speaking Notes -ICLT Program
Pharma ospi slides which help in ospi learning
Complications of Minimal Access Surgery at WLH
2.FourierTransform-ShortQuestionswithAnswers.pdf
01-Introduction-to-Information-Management.pdf
Cell Structure & Organelles in detailed.
GDM (1) (1).pptx small presentation for students
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
master seminar digital applications in india
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx

Integers and matrices (slides)

  • 2. Properties of Integers Theorem: If 𝑛𝑛 and 𝑚𝑚 are integers and 𝑛𝑛 > 0, we can uniquely write 𝑚𝑚 = 𝑞𝑞 ⋅ 𝑛𝑛 + 𝑟𝑟 for integers 𝑞𝑞 and 𝑟𝑟 with 0 ≤ 𝑟𝑟 < 𝑛𝑛. 𝑟𝑟 = 𝑚𝑚 mod 𝑛𝑛 Example:  𝑛𝑛 = 3, 𝑚𝑚 = 16: 16 = 5 ⋅ 3 + 1  𝑛𝑛 = 10, 𝑚𝑚 = 3: 3 = 0 ⋅ 10 + 3  𝑛𝑛 = 5, 𝑚𝑚 = −11: −11 = (−3) ⋅ 5 + 4  𝑛𝑛 = 5, 𝑚𝑚 = 10: 10 = 2 ⋅ 5 + 0 2© S. Turaev, CSC 1700 Discrete Mathematics
  • 3. Properties of Integers  If 𝑟𝑟 = 0, then 𝑚𝑚 = 𝑞𝑞 ⋅ 𝑛𝑛, i.e., 𝑚𝑚 is a multiple of 𝑛𝑛. We write 𝑛𝑛|𝑚𝑚.  If 𝑟𝑟 ≠ 0, then 𝑚𝑚 is not a multiple of 𝑛𝑛. We write 𝑛𝑛 ∤ 𝑚𝑚. Theorem:  If 𝑎𝑎|𝑏𝑏 and 𝑎𝑎|𝑐𝑐, then 𝑎𝑎|(𝑏𝑏 + 𝑐𝑐).  If 𝑎𝑎|𝑏𝑏 and 𝑎𝑎|𝑐𝑐, then 𝑎𝑎|(𝑏𝑏 − 𝑐𝑐).  If 𝑎𝑎|𝑏𝑏 and 𝑎𝑎|𝑐𝑐, then 𝑎𝑎|(𝑏𝑏𝑏𝑏).  If 𝑎𝑎|𝑏𝑏 and 𝑏𝑏|𝑐𝑐, then 𝑎𝑎|𝑐𝑐. 3© S. Turaev, CSC 1700 Discrete Mathematics
  • 4. Prime Numbers Definition: A positive integer 𝑝𝑝 > 1 is called prime, if the only positive integers that divide 𝑝𝑝 are 𝑝𝑝 and 1. Example: 2, 3, 5, 7, 11, 13, … are prime. 4© S. Turaev, CSC 1700 Discrete Mathematics Is 1 prime?
  • 5. Prime Numbers Algorithm for determining if an integer 𝑛𝑛 > 1 is prime: Step 1: Check if 𝑛𝑛 is 2. if so, 𝑛𝑛 is prime. If not, proceed to Step 2: Check if 2|𝑛𝑛. if so, 𝑛𝑛 isn’t prime. If not, proceed to Step 3: Compute the largest integer 𝑘𝑘 ≤ 𝑛𝑛; proceed to Step 4: Check if 𝑑𝑑|𝑛𝑛 where 𝑑𝑑 is any odd number in (1, 𝑘𝑘]. If 𝑑𝑑|𝑛𝑛, then 𝑛𝑛 isn’t prime; otherwise it is prime. 5© S. Turaev, CSC 1700 Discrete Mathematics
  • 6. Prime Factorization Theorem: Every positive integer 𝑛𝑛 > 1 can be written uniquely as 𝑛𝑛 = 𝑝𝑝1 𝑘𝑘1 𝑝𝑝2 𝑘𝑘2 ⋯ 𝑝𝑝𝑠𝑠 𝑘𝑘𝑠𝑠 where  𝑝𝑝1 < 𝑝𝑝2 < ⋯ < 𝑝𝑝𝑠𝑠 are distinct prime numbers that divide 𝑛𝑛,  the 𝑘𝑘’s are positive integers giving the number of times each prime occurs as a factor of 𝑛𝑛. Example: 9 = 3 ⋅ 3 = 32, 36 =, 100 = 6© S. Turaev, CSC 1700 Discrete Mathematics
  • 7. Greatest Common Divisor Definition:  If 𝑎𝑎, 𝑏𝑏 and 𝑘𝑘 are in ℤ+, and 𝑘𝑘|𝑎𝑎 and 𝑘𝑘|𝑏𝑏, we say that 𝑘𝑘 is a common divisor of 𝑎𝑎 and 𝑏𝑏.  If 𝑑𝑑 is the largest such 𝑘𝑘, 𝑑𝑑 is called the greatest common divisor of 𝑎𝑎 and 𝑏𝑏, and we write 𝑑𝑑 = gcd(𝑎𝑎, 𝑏𝑏). Example:  the common divisors of 12 and 30: 1, 2, 3, 6. gcd 12,30 = 6  gcd 17,95 = 1 (relatively prime numbers) 7© S. Turaev, CSC 1700 Discrete Mathematics
  • 8. Euclidean Algorithm  Suppose 𝑎𝑎 > 𝑏𝑏 > 0. We can write 𝑎𝑎 = 𝑘𝑘𝑘𝑘 + 𝑟𝑟 where 𝑘𝑘 ∈ ℤ+ and 0 ≤ 𝑟𝑟 < 𝑏𝑏.  If a number 𝑛𝑛 divides 𝑎𝑎 and 𝑏𝑏, then it must divide 𝑟𝑟, since 𝑟𝑟 = 𝑎𝑎 − 𝑘𝑘𝑘𝑘. Thus, gcd 𝑎𝑎, 𝑏𝑏 = gcd(𝑏𝑏, 𝑎𝑎 mod 𝑏𝑏) 8© S. Turaev, CSC 1700 Discrete Mathematics
  • 9. Euclidean Algorithm gcd 𝑎𝑎, 𝑏𝑏 = gcd(𝑏𝑏, 𝑎𝑎 mod 𝑏𝑏) divide 𝑎𝑎 by 𝑏𝑏: 𝑎𝑎 = 𝑘𝑘1 𝑏𝑏 + 𝑟𝑟1 0 ≤ 𝑟𝑟1 < 𝑏𝑏 divide 𝑏𝑏 by 𝑟𝑟1: 𝑏𝑏 = 𝑘𝑘2 𝑟𝑟1 + 𝑟𝑟2 0 ≤ 𝑟𝑟2 < 𝑟𝑟1 divide 𝑟𝑟1 by 𝑟𝑟2: 𝑟𝑟1 = 𝑘𝑘3 𝑟𝑟2 + 𝑟𝑟3 0 ≤ 𝑟𝑟3 < 𝑟𝑟2 … divide 𝑟𝑟𝑛𝑛−2 by 𝑟𝑟𝑛𝑛−1: 𝑟𝑟𝑛𝑛−2 = 𝑘𝑘𝑛𝑛 𝑟𝑟𝑛𝑛−1 + 𝑟𝑟𝑛𝑛 0 ≤ 𝑟𝑟𝑛𝑛 < 𝑟𝑟𝑛𝑛−1 divide 𝑟𝑟𝑛𝑛−1 by 𝑟𝑟𝑛𝑛: 𝑟𝑟𝑛𝑛−1 = 𝑘𝑘𝑛𝑛+1 𝑟𝑟𝑛𝑛 + 𝑟𝑟𝑛𝑛+1 0 ≤ 𝑟𝑟𝑛𝑛+1 < 𝑟𝑟𝑛𝑛 𝑎𝑎 > 𝑏𝑏 > 𝑟𝑟1 > 𝑟𝑟2 > 𝑟𝑟3 > ⋯ 9© S. Turaev, CSC 1700 Discrete Mathematics
  • 10. Euclidean Algorithm gcd 𝑎𝑎, 𝑏𝑏 = gcd(𝑏𝑏, 𝑎𝑎 mod 𝑏𝑏) 𝑎𝑎 > 𝑏𝑏 > 𝑟𝑟1 > 𝑟𝑟2 > 𝑟𝑟3 > ⋯ > 𝑟𝑟𝑛𝑛+1 = 0 𝑟𝑟𝑛𝑛−1 = 𝑘𝑘𝑛𝑛+1 𝑟𝑟𝑛𝑛 : 𝑟𝑟𝑛𝑛 𝑟𝑟𝑛𝑛−1, 𝑟𝑟𝑛𝑛 𝑟𝑟𝑛𝑛−2, … , 𝑟𝑟𝑛𝑛 𝑟𝑟2, 𝑟𝑟𝑛𝑛 𝑟𝑟1, 𝑟𝑟𝑛𝑛|𝑏𝑏, 𝑟𝑟𝑛𝑛|𝑎𝑎 gcd 𝑎𝑎, 𝑏𝑏 = gcd 𝑏𝑏, 𝑟𝑟1 = gcd 𝑟𝑟1, 𝑟𝑟2 = ⋯ = gcd 𝑟𝑟𝑛𝑛−1, 𝑟𝑟𝑛𝑛 = 𝑟𝑟𝑛𝑛 Example: Compute gcd(123, 36) 10© S. Turaev, CSC 1700 Discrete Mathematics
  • 11. Least Common Multiple Definition:  If 𝑎𝑎, 𝑏𝑏 and 𝑘𝑘 are in ℤ+, and 𝑎𝑎|𝑘𝑘 and 𝑏𝑏|𝑘𝑘, we say that 𝑘𝑘 is a common multiple of 𝑎𝑎 and 𝑏𝑏.  If 𝑐𝑐 is the smallest such 𝑘𝑘, 𝑐𝑐 is called the least common multiple of 𝑎𝑎 and 𝑏𝑏, and we write 𝑐𝑐 = lcm(𝑎𝑎, 𝑏𝑏). Example:  the common multiples of 2 and 3: 6, 12, 18, 24, … lcm 2,3 = 6. 11© S. Turaev, CSC 1700 Discrete Mathematics
  • 12. Least Common Multiple Theorem: if 𝑎𝑎, 𝑏𝑏 ∈ ℤ+, then gcd(𝑎𝑎, 𝑏𝑏) ⋅ lcm 𝑎𝑎, 𝑏𝑏 = 𝑎𝑎 ⋅ 𝑏𝑏. Proof: Use prime factorizations of 𝑎𝑎 and 𝑏𝑏. Example: Let 𝑎𝑎 = 540 and 𝑏𝑏 = 504. Find gcd and lcm. 12© S. Turaev, CSC 1700 Discrete Mathematics
  • 13. Exercises • Write 𝑚𝑚 as 𝑞𝑞𝑞𝑞 + 𝑟𝑟, with 0 ≤ 𝑟𝑟 < 𝑛𝑛: 1. 𝑚𝑚 = 20, 𝑛𝑛 = 3 2. 𝑚𝑚 = 64, 𝑛𝑛 = 37 3. 𝑚𝑚 = 3, 𝑛𝑛 = 12 • Write each integer as a product of powers of primes: 828, 1666, 1781 • Find the gcd(𝑎𝑎, 𝑏𝑏) and lcm(𝑎𝑎, 𝑏𝑏): 1. 𝑎𝑎 = 60, 𝑏𝑏 = 100 2. 𝑎𝑎 = 77, 𝑏𝑏 = 128 13© S. Turaev, CSC 1700 Discrete Mathematics
  • 14. Representation of Integers (Reading) • 3245 means the sum of 3 times 103, 2 times 102, 4 times 10 and 5: 3245 = 3 ⋅ 103 + 2 ⋅ 102 + 4 ⋅ 10 + 5 ⋅ 100 • The base 10 expansion or decimal expansion of 3245 • 10 is called the base of the expansion. Example: 56893 = 14© S. Turaev, CSC 1700 Discrete Mathematics
  • 15. Representation of Integers (Reading) Theorem: if 𝑏𝑏 ∈ ℤ+, then every positive integer 𝑛𝑛 can be uniquely expressed in the form 𝑛𝑛 = 𝑑𝑑𝑘𝑘 ⋅ 𝑏𝑏𝑘𝑘 + 𝑑𝑑𝑘𝑘−1 ⋅ 𝑏𝑏𝑘𝑘−1 + ⋯ 𝑑𝑑1 ⋅ 𝑏𝑏 + 𝑑𝑑0 where 0 ≤ 𝑑𝑑𝑖𝑖 < 𝑏𝑏, 𝑖𝑖 = 1,2, … , 𝑘𝑘, and 𝑑𝑑𝑘𝑘 ≠ 0. The sequence 𝑑𝑑𝑘𝑘 𝑑𝑑𝑘𝑘−1 ⋯ 𝑑𝑑1 𝑑𝑑0 (more explicitly, 𝑑𝑑𝑘𝑘 𝑑𝑑𝑘𝑘−1 ⋯ 𝑑𝑑1 𝑑𝑑0 𝑏𝑏) is called the base 𝑏𝑏 expansion of 𝑛𝑛. Example: Find the base 2, 3, 4 representations of 173. Example: Find the decimal expansion of 100111 2. 15© S. Turaev, CSC 1700 Discrete Mathematics
  • 16. Matrices Definition: A matrix is a rectangular array of numbers in 𝑚𝑚 horizontal rows and 𝑛𝑛 vertical columns: 𝐀𝐀 = 𝑎𝑎11 𝑎𝑎12 𝑎𝑎21 𝑎𝑎22 ⋯ 𝑎𝑎1𝑛𝑛 𝑎𝑎2𝑛𝑛 ⋮ ⋮ 𝑎𝑎 𝑚𝑚1 𝑎𝑎 𝑚𝑚𝑚 ⋯ 𝑎𝑎 𝑚𝑚𝑚𝑚 Definition: The 𝑖𝑖th row of 𝐀𝐀 is [𝑎𝑎𝑖𝑖 𝑖 𝑎𝑎𝑖𝑖 𝑖 ⋯ 𝑎𝑎𝑖𝑖 𝑖𝑖], 1 ≤ 𝑖𝑖 ≤ 𝑚𝑚, and the 𝑗𝑗th column of 𝐀𝐀 is 𝑎𝑎1𝑗𝑗 𝑎𝑎2𝑗𝑗 ⋮ 𝑎𝑎𝑛𝑛𝑛𝑛 , 1 ≤ 𝑗𝑗 ≤ 𝑛𝑛. 16© S. Turaev, CSC 1700 Discrete Mathematics
  • 17. Matrices Definition: We say that 𝐀𝐀 is 𝑚𝑚 by 𝑛𝑛, written 𝑚𝑚 × 𝑛𝑛. If 𝑚𝑚 = 𝑛𝑛, we say 𝐀𝐀 is a square matrix of order 𝑛𝑛. The elements 𝑎𝑎11, 𝑎𝑎22, … , 𝑎𝑎𝑛𝑛𝑛𝑛 form main diagonal of 𝐀𝐀. Definition: We refer to the element 𝑎𝑎𝑖𝑖𝑖𝑖 in the 𝑖𝑖th row and 𝑗𝑗th column of 𝐀𝐀 as the (𝑖𝑖, 𝑗𝑗) entry of 𝐀𝐀. We denote the matrix 𝐀𝐀 by [𝑎𝑎𝑖𝑖𝑖𝑖], for short. Example: 𝐀𝐀 = 2 3 5 0 −1 2 , 𝐁𝐁 = 2 6 3 6 , 𝐂𝐂 = 1 0 0 , 𝐃𝐃 = 1 1 1 17© S. Turaev, CSC 1700 Discrete Mathematics
  • 18. Matrices Definition: A square matrix 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] is called a diagonal matrix if 𝑎𝑎𝑖𝑖𝑖𝑖 = 0 for all 𝑖𝑖 ≠ 𝑗𝑗. Example: 𝐅𝐅 = 2 0 0 6 , 𝐆𝐆 = 1 0 0 0 3 0 0 0 −3 , 𝐇𝐇 = 0 0 0 0 3 0 0 0 0 Definition: A 𝑚𝑚 × 𝑛𝑛 matrix 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] is called zero matrix, denoted by 𝟎𝟎, if 𝑎𝑎𝑖𝑖𝑖𝑖 = 0 for all 1 ≤ 𝑖𝑖 ≤ 𝑚𝑚, 1 ≤ 𝑗𝑗 ≤ 𝑛𝑛. 18© S. Turaev, CSC 1700 Discrete Mathematics
  • 19. Matrices Definition: Two 𝑚𝑚 × 𝑛𝑛 matrices 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] and 𝐁𝐁 = [𝑏𝑏𝑖𝑖𝑖𝑖] are said to be equal if 𝑎𝑎𝑖𝑖𝑖𝑖 = 𝑏𝑏𝑖𝑖𝑖𝑖 for all 𝑖𝑖 and 𝑗𝑗. Definition: If 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] and 𝐁𝐁 = [𝑏𝑏𝑖𝑖𝑖𝑖] are 𝑚𝑚 × 𝑛𝑛 matrices, then the sum of 𝐀𝐀 and 𝐁𝐁, denoted by 𝐀𝐀 + 𝐁𝐁, is the matrix 𝐂𝐂 = [𝑐𝑐𝑖𝑖𝑖𝑖] defined by 𝑐𝑐𝑖𝑖𝑖𝑖 = 𝑎𝑎𝑖𝑖𝑖𝑖 + 𝑏𝑏𝑖𝑖𝑖𝑖 for all 1 ≤ 𝑖𝑖 ≤ 𝑚𝑚, 1 ≤ 𝑗𝑗 ≤ 𝑛𝑛. Example: Find 𝐀𝐀+ 𝐁𝐁 if 𝐀𝐀 = 1 0 −8 3 3 0 −2 9 −3 , 𝐁𝐁 = 4 5 3 0 −3 2 5 0 −2 19© S. Turaev, CSC 1700 Discrete Mathematics
  • 20. Matrices Theorem:  𝐀𝐀 + 𝐁𝐁 = 𝐁𝐁 + 𝐀𝐀  𝐀𝐀 + 𝐁𝐁 + 𝐂𝐂 = 𝐀𝐀 + (𝐁𝐁 + 𝐂𝐂)  𝐀𝐀 + 𝟎𝟎 = 𝟎𝟎 + 𝐀𝐀 = 𝐀𝐀 20© S. Turaev, CSC 1700 Discrete Mathematics
  • 21. Matrices Definition: If 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] is 𝑚𝑚 × 𝑝𝑝 matrix and 𝐁𝐁 = [𝑏𝑏𝑖𝑖𝑖𝑖] are 𝑝𝑝 × 𝑛𝑛 matrix, then the product of 𝐀𝐀 and 𝐁𝐁, denotes by 𝐀𝐀𝐀𝐀 is the 𝑚𝑚 × 𝑛𝑛 matrix 𝐂𝐂 = [𝑐𝑐𝑖𝑖𝑖𝑖] defined by 𝑐𝑐𝑖𝑖𝑖𝑖 = 𝑎𝑎𝑖𝑖 𝑖 𝑏𝑏1𝑗𝑗 + 𝑎𝑎𝑖𝑖2 𝑏𝑏2𝑗𝑗 + ⋯ 𝑎𝑎𝑖𝑖 𝑝𝑝 𝑏𝑏𝑝𝑝𝑗𝑗 for all 1 ≤ 𝑖𝑖 ≤ 𝑚𝑚, 1 ≤ 𝑗𝑗 ≤ 𝑛𝑛. Example: Find 𝐀𝐀𝐁𝐁 if 𝐀𝐀 = 1 0 −8 3 3 0 −2 9 −3 , 𝐁𝐁 = 4 5 3 0 −3 2 5 0 −2 21© S. Turaev, CSC 1700 Discrete Mathematics
  • 22. Matrices Theorem:  𝐀𝐀(𝐁𝐁𝐁𝐁) = 𝐀𝐀𝐀𝐀 𝐂𝐂  𝐀𝐀 𝐁𝐁 + 𝐂𝐂 = 𝐀𝐀𝐀𝐀 + 𝐀𝐀𝐀𝐀  𝐀𝐀 + 𝐁𝐁 𝐂𝐂 = 𝐀𝐀𝐀𝐀 + 𝐁𝐁𝐁𝐁 22© S. Turaev, CSC 1700 Discrete Mathematics
  • 23. Matrices Definition: A 𝑛𝑛 × 𝑛𝑛 diagonal matrix: 𝐈𝐈𝑛𝑛 = 1 0 0 1 ⋯ 0 0 ⋮ ⋮ 0 0 ⋯ 1 is called the identity matrix of order 𝑛𝑛. Theorem: For any 𝑛𝑛 × 𝑛𝑛 matrix 𝐀𝐀 and positive integer 𝑝𝑝,  𝐈𝐈𝑛𝑛 𝐀𝐀 = 𝐀𝐀𝐈𝐈𝑛𝑛 = 𝐀𝐀  𝐀𝐀𝑝𝑝 = 𝐀𝐀 ⋅ 𝐀𝐀 ⋅ ⋯ ⋅ 𝐀𝐀 𝑝𝑝 , 𝐀𝐀0 = 𝐈𝐈𝑛𝑛. 23© S. Turaev, CSC 1700 Discrete Mathematics
  • 24. Matrices Definition: If 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] is 𝑚𝑚 × 𝑛𝑛 matrix, then the 𝑛𝑛 × 𝑚𝑚 matrix 𝐀𝐀𝑇𝑇 = [𝑎𝑎𝑖𝑖𝑖𝑖 𝑇𝑇 ], where 𝑎𝑎𝑖𝑖𝑖𝑖 𝑇𝑇 = 𝑎𝑎𝑗𝑗𝑗𝑗, for all 1 ≤ 𝑖𝑖 ≤ 𝑚𝑚, 1 ≤ 𝑗𝑗 ≤ 𝑛𝑛, is called the transpose of 𝐀𝐀. Example: Find 𝐀𝐀𝑇𝑇 and 𝐁𝐁𝑇𝑇 if 𝐀𝐀 = 1 0 −8 3 3 0 −2 9 −3 , 𝐁𝐁 = 2 −3 5 6 1 3 24© S. Turaev, CSC 1700 Discrete Mathematics
  • 25. Matrices Theorem:  𝐀𝐀𝑇𝑇 𝑇𝑇 = 𝐀𝐀  𝐀𝐀 + 𝐁𝐁 𝑇𝑇 = 𝐀𝐀𝑇𝑇 + 𝐁𝐁𝑇𝑇  𝐀𝐀𝐁𝐁 𝑇𝑇 = 𝐁𝐁𝑇𝑇 𝐀𝐀𝑇𝑇 Definition: A matrix 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] is called symmetric if 𝑨𝑨𝑇𝑇=𝐀𝐀. Definition: if 𝐀𝐀 and 𝐁𝐁 are 𝑛𝑛 × 𝑛𝑛 matrices, we say 𝐁𝐁 is the inverse of 𝐀𝐀 if 𝐀𝐀𝐁𝐁 = 𝐈𝐈𝑛𝑛. 25© S. Turaev, CSC 1700 Discrete Mathematics
  • 26. Boolean Matrix Operations Definition: A Boolean matrix is 𝑚𝑚 × 𝑛𝑛 matrix whose entries are either zero or one. Definition: Let 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] and 𝐁𝐁 = [𝑏𝑏𝑖𝑖𝑖𝑖] be 𝑚𝑚 × 𝑛𝑛 Boolean matrices. We define 𝐀𝐀 ∨ 𝐁𝐁 = 𝐂𝐂 = [𝑐𝑐𝑖𝑖𝑖𝑖], the join of 𝐀𝐀 and 𝐁𝐁, by 𝑐𝑐𝑖𝑖𝑖𝑖 = 1 if 𝑎𝑎𝑖𝑖𝑖𝑖 = 1 or 𝑏𝑏𝑖𝑖𝑖𝑖 = 1, 𝑐𝑐𝑖𝑖𝑖𝑖 = 0 if 𝑎𝑎𝑖𝑖𝑖𝑖 = 𝑏𝑏𝑖𝑖𝑖𝑖 = 0, and the meet of 𝐀𝐀 and 𝐁𝐁, by 𝑐𝑐𝑖𝑖𝑖𝑖 = 1 if 𝑎𝑎𝑖𝑖𝑖𝑖 = 𝑏𝑏𝑖𝑖𝑖𝑖 = 1, 𝑐𝑐𝑖𝑖𝑖𝑖 = 0 if 𝑎𝑎𝑖𝑖𝑖𝑖 = 0 or 𝑏𝑏𝑖𝑖𝑖𝑖 = 0. 26© S. Turaev, CSC 1700 Discrete Mathematics
  • 27. Boolean Matrix Operations Example: Compute 𝐀𝐀 ∨ 𝐁𝐁 and 𝐀𝐀 ∧ 𝐁𝐁 if 𝐀𝐀 = 1 0 1 0 1 1 1 1 0 0 0 0 , 𝐁𝐁 = 1 1 0 1 0 1 0 0 1 1 1 0 27© S. Turaev, CSC 1700 Discrete Mathematics
  • 28. Boolean Matrix Operations Definition: Let 𝐀𝐀 = [𝑎𝑎𝑖𝑖𝑖𝑖] be an 𝑚𝑚 × 𝑝𝑝 Boolean matrix and 𝐁𝐁 = [𝑏𝑏𝑖𝑖𝑖𝑖] be a 𝑝𝑝 × 𝑛𝑛 Boolean matrix. The Boolean product of 𝐀𝐀 and 𝐁𝐁, denoted by 𝐀𝐀 ⊙ 𝐁𝐁, is the 𝑚𝑚 × 𝑛𝑛 matrix 𝐂𝐂 = [𝑐𝑐𝑖𝑖𝑖𝑖] defined by  𝑐𝑐𝑖𝑖𝑖𝑖 = 1 if 𝑎𝑎𝑖𝑖𝑖𝑖 = 1 and 𝑏𝑏𝑖𝑖𝑖𝑖 = 1, for some 1 ≤ 𝑘𝑘 ≤ 𝑝𝑝,  𝑐𝑐𝑖𝑖𝑖𝑖 = 0 otherwise. 28© S. Turaev, CSC 1700 Discrete Mathematics
  • 29. Boolean Matrix Operations Example: Compute 𝐀𝐀 ⊙ 𝐁𝐁 if 𝐀𝐀 = 1 0 1 0 1 1 1 1 0 , 𝐁𝐁 = 1 1 0 1 0 1 0 0 1 29© S. Turaev, CSC 1700 Discrete Mathematics
  • 30. Boolean Matrix Operations Theorem:  𝐀𝐀 ∨ 𝐁𝐁 = 𝐁𝐁 ∨ 𝐀𝐀  𝐀𝐀 ∧ 𝐁𝐁 = 𝐁𝐁 ∧ 𝐀𝐀  𝐀𝐀 ∨ 𝐁𝐁 ∨ 𝐂𝐂 = 𝐀𝐀 ∨ (𝐁𝐁 ∨ 𝐂𝐂)  𝐀𝐀 ∧ 𝐁𝐁 ∧ 𝐂𝐂 = 𝐀𝐀 ∧ (𝐁𝐁 ∧ 𝐂𝐂)  𝐀𝐀 ∧ 𝐁𝐁 ∨ 𝐂𝐂 = 𝐀𝐀 ∧ 𝐁𝐁 ∨ 𝐀𝐀 ∧ 𝐂𝐂  𝐀𝐀 ∨ 𝐁𝐁 ∧ 𝐂𝐂 = 𝐀𝐀 ∨ 𝐁𝐁 ∧ (𝐀𝐀 ∨ 𝐂𝐂)  𝐀𝐀 ⊙ 𝐁𝐁 ⊙ 𝐂𝐂 = 𝐀𝐀 ⊙ (𝐁𝐁 ⊙ 𝐂𝐂) 30© S. Turaev, CSC 1700 Discrete Mathematics