CH 3-Number Theory and Matrices
CH 3-Number Theory and Matrices
CH 3-Number Theory and Matrices
01/18/22 1
Module #9 – Number Theory
Section 3.4: The Integers and
Division
Division:
Let a, b Z with a 0.
• a |b “a divides b”.
We say that “a is a factor of b”, “a is a divisor of
b”, and “b is a multiple of a”.
• a does not divide b is denoted by a | b.
• We can express a | b using the quantifier
c (b = ac), Domain = Z.
3 12 True, but 3 7 False.
01/18/22 2
Module #9 – Number Theory
Examples:
3 12 and 3 9 3 (12 + 9) 3 21 (21 ÷ 3 = 7)
2 6 2 (6 × 3) 2 18 (18 ÷ 2 = 9)
4 8 and 8 64 4 64 (64 ÷ 4 = 16)
01/18/22 3
Module #9 – Number Theory
01/18/22 4
Module #9 – Number Theory
Examples
• What are the quotient and remainder when 101 is
divided by 11?
101 = 11 × 9 + 2,
q = 101 div 11 = 9, r = 101 – 11 × 9 = 2 = 101 mod 9
• What are the quotient and the remainder when −11
is divided by 3?
−11 = 3 × (−4) + 1 , q = −4 , r = 1
11
q 11 div 3 3.6 4
3
• Note: r 11 (4) 3 1 11 mod 3
Examples
• Find a and b if :
2a + b = 46 mod 7 and a + 2b = 47 div 9.
46 = 6 × 7 + 4 and 47 = 5 × 9 + 2
46 mod 7 = 4 and 47 div 9 = 5
2a + b = 4 (1) and a + 2b = 5 (2)
(1) – 2 (2): -3b = -6
b = 2 and a = 1.
01/18/22 6
Module #9 – Number Theory
01/18/22 7
Module #9 – Number Theory
01/18/22 8
Module #9 – Number Theory
Theorem
01/18/22 9
Module #9 – Number Theory
01/18/22 10
Module #9 – Number Theory
Example 1
01/18/22 11
Module #9 – Number Theory
Example 2
01/18/22 12
Module #9 – Number Theory
Example 3
01/18/22
Module #9 – Number Theory
Discrete Mathematics
Matrices
01/18/22 14
Module #9 – Number Theory
01/18/22 15
Module #9 – Number Theory
Matrix Equality
3 2 3 2 0
1 6 1 6 0
01/18/22 16
Module #9 – Number Theory
am1 am 2 amn
01/18/22 17
Module #9 – Number Theory
Matrix Sums
• The sum A + B of two matrices A, B (which must
have the same number of rows, and the same
number of columns) is the matrix given by adding
corresponding elements.
• A + B = [aij + bij]
2 6 7 5 9 1
0 8 4 1 4 9
1 2 3 6 4 8
01/18/22 18
Module #9 – Number Theory
Matrix Products
For an mk matrix A and a kn matrix B, the
product AB is the mn matrix:
k
AB C [cij ] aip b pj
p 1
i.e. The element (i, j ) of AB is given by the vector
dot product of the ith row of A and the jth column
of B (considered as vectors).
0 1 1 0
0 1 1 1 0 5 1
2 0 3 2 0 2 0
3 2 11 3
1 0 3
1
2×3 3×4 2×4
01/18/22 20
Module #9 – Number Theory
Identity Matrices
• The identity matrix of order n, In , is the order-n
matrix with 1’s along the upper-left to lower-right
diagonal and 0’s everywhere else.
• A In = A
1 0 0
1 if i j 0 1
0
I n
0 if i j
0 0 1
01/18/22 21
Module #9 – Number Theory
Powers of Matrices
Matrix Transposition
2 0
2 1 3
A A 1 1
T
0 1 2 3 2
01/18/22 23
Module #9 – Number Theory
Symmetric Matrices
• A square matrix A is symmetric if and only if AT
= A.
• Which is symmetric?
A B C
1 1 2 1 3 3 0 1
1 1 1 0 2 1
0 1
1 1 3 1 2 1 1 2
01/18/22 24
Module #9 – Number Theory
Zero-One Matrices
01/18/22 25
Module #9 – Number Theory
Example
1 0 1 0 1 0
A= B =
0 1 0 1 1 0
1 1 1
• The join between A and B is A B =
1 1 0
0 0 0
• The meet between A and B is A B = 0 1 0
01/18/22 26
Module #9 – Number Theory
Boolean Products
01/18/22 27
Module #9 – Number Theory
Boolean Powers
k times
01/18/22 28
Module #9 – Number Theory
Example
1 0
0 1 1 0
Let A = 1 and B = 0 1 1
1
0
(1 1) (0 0) (1 1) (0 1) (1 0) (0 1)
A⊙B = (0 1) (1 0) (0 1) (1 1) (0 0) (1 1)
(1 1) (0 0) (1 1) (0 1) (1 0) (0 1)
1 1 0
0 1 1
1 1 0
01/18/22 29