Integers and matrices (slides)
-
Upload
pocong-makenon -
Category
Education
-
view
67 -
download
2
Transcript of Integers and matrices (slides)
Properties of IntegersTheorem: 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 + 02ยฉ 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 NumbersDefinition: 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 NumbersAlgorithm 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 FactorizationTheorem: 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 DivisorDefinition:
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 Algorithmgcd ๐๐, ๐๐ = 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 Algorithmgcd ๐๐, ๐๐ = 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 MultipleDefinition:
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 MultipleTheorem: 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,๐๐ = 32. ๐๐ = 64,๐๐ = 373. ๐๐ = 3, ๐๐ = 12
โข Write each integer as a product of powers of primes:828, 1666, 1781
โข Find the gcd(๐๐, ๐๐) and lcm(๐๐, ๐๐):
1. ๐๐ = 60, ๐๐ = 1002. ๐๐ = 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
MatricesDefinition: A matrix is a rectangular array of numbers in ๐๐ horizontal rows and ๐๐ vertical columns:
๐๐ =
๐๐11 ๐๐12๐๐21 ๐๐22 โฏ
๐๐1๐๐๐๐2๐๐
โฎ โฎ๐๐๐๐1 ๐๐๐๐2 โฏ ๐๐๐๐๐๐
Definition: The ๐๐th row of ๐๐ is [๐๐๐๐1 ๐๐๐๐2 โฏ๐๐๐๐๐๐], 1 โค ๐๐ โค ๐๐,
and the ๐๐th column of ๐๐ is
๐๐1๐๐๐๐2๐๐โฎ๐๐๐๐๐๐
, 1 โค ๐๐ โค ๐๐.
16ยฉ S. Turaev, CSC 1700 Discrete Mathematics
MatricesDefinition: 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 50 โ1 2 ,๐๐ = 2 6
3 6 ,๐๐ = 1 0 0 ,๐๐ =111
17ยฉ S. Turaev, CSC 1700 Discrete Mathematics
MatricesDefinition: A square matrix ๐๐ = [๐๐๐๐๐๐] is called a diagonal matrix if ๐๐๐๐๐๐ = 0 for all ๐๐ โ ๐๐.
Example:
๐ ๐ = 2 00 6 ,๐๐ =
1 0 00 3 00 0 โ3
,๐๐ =0 0 00 3 00 0 0
Definition: A ๐๐ ร ๐๐ matrix ๐๐ = [๐๐๐๐๐๐] is called zero matrix, denoted by ๐๐, if ๐๐๐๐๐๐ = 0 for all 1 โค ๐๐ โค ๐๐, 1 โค ๐๐ โค ๐๐.
18ยฉ S. Turaev, CSC 1700 Discrete Mathematics
MatricesDefinition: 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 โ83 3 0โ2 9 โ3
, ๐๐ =4 5 30 โ3 25 0 โ2
19ยฉ S. Turaev, CSC 1700 Discrete Mathematics
MatricesTheorem:
๐๐ + ๐๐ = ๐๐ + ๐๐
๐๐ + ๐๐ + ๐๐ = ๐๐ + (๐๐ + ๐๐)
๐๐ + ๐๐ = ๐๐ + ๐๐ = ๐๐
20ยฉ S. Turaev, CSC 1700 Discrete Mathematics
MatricesDefinition: If ๐๐ = [๐๐๐๐๐๐] is ๐๐ ร ๐๐ matrix and ๐๐ = [๐๐๐๐๐๐] are ๐๐ ร ๐๐ matrix, then the product of ๐๐ and ๐๐, denotes by ๐๐๐๐ is the ๐๐ ร ๐๐ matrix ๐๐ = [๐๐๐๐๐๐] defined by
๐๐๐๐๐๐ = ๐๐๐๐1๐๐1๐๐ + ๐๐๐๐2๐๐2๐๐ + โฏ๐๐๐๐๐๐๐๐๐๐๐๐
for all 1 โค ๐๐ โค ๐๐, 1 โค ๐๐ โค ๐๐.
Example: Find ๐๐๐๐ if
๐๐ =1 0 โ83 3 0โ2 9 โ3
, ๐๐ =4 5 30 โ3 25 0 โ2
21ยฉ S. Turaev, CSC 1700 Discrete Mathematics
MatricesTheorem:
๐๐(๐๐๐๐) = ๐๐๐๐ ๐๐
๐๐ ๐๐ + ๐๐ = ๐๐๐๐ + ๐๐๐๐
๐๐ + ๐๐ ๐๐ = ๐๐๐๐ + ๐๐๐๐
22ยฉ S. Turaev, CSC 1700 Discrete Mathematics
MatricesDefinition: A ๐๐ ร ๐๐ diagonal matrix:
๐๐๐๐ =
1 00 1 โฏ 0
0โฎ โฎ
0 0 โฏ 1is called the identity matrix of order ๐๐.
Theorem: For any ๐๐ ร ๐๐ matrix ๐๐ and positive integer ๐๐,
๐๐๐๐๐๐ = ๐๐๐๐๐๐ = ๐๐
๐๐๐๐ = ๐๐ โ ๐๐ โ โฏ โ ๐๐๐๐
, ๐๐0 = ๐๐๐๐.
23ยฉ S. Turaev, CSC 1700 Discrete Mathematics
MatricesDefinition: If ๐๐ = [๐๐๐๐๐๐] is ๐๐ ร ๐๐ matrix, then the ๐๐ ร ๐๐matrix ๐๐๐๐ = [๐๐๐๐๐๐๐๐ ], where ๐๐๐๐๐๐๐๐ = ๐๐๐๐๐๐, for all 1 โค ๐๐ โค ๐๐, 1 โค ๐๐ โค ๐๐, is called the transpose of ๐๐.
Example: Find ๐๐๐๐ and ๐๐๐๐ if
๐๐ =1 0 โ83 3 0โ2 9 โ3
, ๐๐ = 2 โ3 56 1 3
24ยฉ S. Turaev, CSC 1700 Discrete Mathematics
MatricesTheorem:
๐๐๐๐ ๐๐ = ๐๐
๐๐ + ๐๐ ๐๐ = ๐๐๐๐ + ๐๐๐๐
๐๐๐๐ ๐๐ = ๐๐๐๐๐๐๐๐
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 OperationsDefinition: 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 OperationsExample: Compute ๐๐ โจ ๐๐ and ๐๐ โง ๐๐ if
๐๐ =1 0 10 1 11 1 00 0 0
, ๐๐ =1 1 01 0 10 0 11 1 0
27ยฉ S. Turaev, CSC 1700 Discrete Mathematics
Boolean Matrix OperationsDefinition: 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 OperationsExample: Compute ๐๐โ๐๐ if
๐๐ =1 0 10 1 11 1 0
, ๐๐ =1 1 01 0 10 0 1
29ยฉ S. Turaev, CSC 1700 Discrete Mathematics
Boolean Matrix OperationsTheorem:
๐๐ โจ ๐๐ = ๐๐ โจ ๐๐
๐๐ โง ๐๐ = ๐๐ โง ๐๐
๐๐ โจ ๐๐ โจ ๐๐ = ๐๐ โจ (๐๐ โจ ๐๐)
๐๐ โง ๐๐ โง ๐๐ = ๐๐ โง (๐๐ โง ๐๐)
๐๐ โง ๐๐ โจ ๐๐ = ๐๐ โง ๐๐ โจ ๐๐ โง ๐๐
๐๐ โจ ๐๐ โง ๐๐ = ๐๐ โจ ๐๐ โง (๐๐ โจ ๐๐)
๐๐โ๐๐ โ ๐๐ = ๐๐โ (๐๐โ ๐๐)30ยฉ S. Turaev, CSC 1700 Discrete Mathematics