Download presentation
Presentation is loading. Please wait.
1
1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 4 Properties of the Integers
2
2 Well-Ordering Principle ( 良序原理 ) Every nonempty subset A of + = {1,2,…} contains a smallest element. Note: A can be finite or infinite. Some sets are not well-ordered: : A= , : A=(0,1) It is the basis of a prove technique -- Mathematical Induction.
3
3 Principal of Mathematical Induction Let S(n) denote an open mathematical statement that involves one or more occurrences of the variable n +. (a) If S(1) is true; and (b) If S(k) is true for some particular k +, then S(k+1) is true; then S(n) is true for all n +.
4
4 Proof of Theorem 4.1 Proof by contradiction: Define the set F = { m | S(m) does not hold} +. If F is non-empty, then F must have a smallest element m (well-ordering of + ), with S(m). Because we know that S(1), it must hold that m>1. Because m is the smallest value, it must hold that S(m–1), which contradicts our proof for all k + : S(k) S(k+1). Thus F has to be empty. Therefore, S holds for all +. #
5
5 Principal of Strong Form Mathematical Induction Let S(n) denote an open mathematical statement that involves one or more occurrences of the variable n +. Let n 0, n 1 + with n 0 n 1. (a) If S(n 0 ), S(n 0 +1), S(n 0 +2), …, S(n 1 -1), and S(n 1 ) are true; and (b) If whenever S(n 0 ), S(n 0 +1), …, S(k-1),and S(k) are true for some particular k +, where k n 1, then the statement S(k+1) is also true; Then S(n) is true for all n n 0.
6
6 Mathematical Induction If we want to prove a property P(n) for all n +, we can do that in the following inductive way: Basis step: Prove it for n=1: does P(1) hold? Inductive step: Assuming that P(1), P(2), …, P(k) holds for some k +, prove P(k+1). By the structure of +, this proves it for all n: P(1) holds, hence P(2), hence P(3), et cetera.
7
7 Example of Induction Show that n! 2 n-1, for n +. Proof. Induction Basis. n = 1 1! 2 1-1 = 1. Inductive step. Assume that i! 2 i-1, for i = 1, 2, …, k. (k+1)! = (k+1) k!. Then (k+1)! = (k+1) k! (k+1) 2 k-1 2 2 k-1 = 2 k. Therefore, the assertion is true. #
8
8 More Example of Induction For every n + where n 14, prove S(n) : n can be written as a sum of 3’s and/or 8’s. Proof. Induction Basis. n = 14 n = 3 + 3 + 8. n = 15 n = 3 + 3 + 3 + 3 + 3. n = 16 n = 8 + 8. Inductive step. Assume that S(14), S(15), …, S(k) are true for some k + where k 16. k+1 = (k-2) + 3. S(k+1) is true. Thus, S(n) is true for all n 14. #
9
9 Recursive Definition Fibonacci sequence: 0,1,1,2,3,5,8,13,21,… It is sequence number A000045 in The On-Line Encyclopedia of Integer Sequences at http://www.research.att.com/~njas/sequences/index.html Recursive base. F 0 = 0, F 1 = 1. Recursive process. F n = F n-1 + F n-2, n 2. Explicit formula: For large n, it grows like F n ≈ 0.447214 1.61803 n. This (1+√5)/2 ≈ 1.61803 is the Golden Ratio.
10
10 Fibonacci in Nature Shape of shells: Golden ratio: Perfect shape : total height / navel height = 1.618
11
11 Property of Fibonacci Observation. Conjecture.
12
12 Property of Fibonacci Proof. Induction Basis. Inductive step. Assume that for some k + where k 1. #
13
13 Other Sequences Harmonic sequence: Lucas sequence:
14
14 More Sequences Binomial sequence: Eulerian sequence:
15
15 Number System Binary digits: 0 and 1, called bits. Review of decimal system: Example: 45,238 is equal to 8ones8 x 1 =8 3tens3 x 10 = 30 2 hundreds2 x 100 = 200 5thousands5 x 1000 = 5000 4ten thousands4 x 10000 = 40000
16
16 From Binary to Decimal The number 1101011 is equivalent to 1 one1 x2 0 =1 1 two1x2 1 = 2 0 four0x2 2 =0 1 eight1x2 3 =8 0 sixteen0x2 4 = 0 1 thirty-two1x2 5 = 32 1 sixty-four1x2 6 = 64 107 in decimal base
17
17 From Decimal to Binary The number 73 10 is equivalent to 73 = 2 x 36 + remainder 1 36 = 2 x 18 + remainder 0 18 = 2 x 9 + remainder 0 9 = 2 x 4 + remainder 1 4 = 2 x 2 + remainder 0 2 = 2 x 1 + remainder 0 73 10 = 1001001 2 (write the remainders in reverse order preceded by the quotient 1)
18
18 Adding Binary Numbers Example: add 100101 2 + 110011 2 1 1 1 carry ones 100101 2 +110011 2 1011000 2
19
19 Hexadecimal Number System Decimal system 0123456789101112131415 0123456789ABCDEF Hexadecimal system
20
20 Hexadecimal to Decimal The hexadecimal number 3A0B 16 is 11 x 16 0 =11 0 x 16 1 = 0 10 x 16 2 = 2560 3 x 16 3 = 12288 14859 10
21
21 Two’s Complement One’s complement: Replace each 0(1) in the binary representation by 1(0). 100101 011010 Two’s complement: Add 1 to one’s complement. 011010 + 1 011011
22
22 Subtraction 33 - 15 33 = 00100001 2, 15 = 00001111 2 -15 = 11110001 2 00100001 2 +11110001 2 (1)00010010 2 = 18
23
23 More Subtraction 15 - 33 33 = 00100001 2, 15 = 00001111 2 -33 = 11011111 2 00001111 2 +11011111 2 11101110 2 Two’s complement 00010010 2 = 18 15 – 33 = -18.
24
24 Divisibility of Integers Let x,y Z and y 0, x is a multiple of y if and only if there exist and integer m Z such that x = y m. We also say y divides x or y is a divisor of x. Notation: y|x.
25
25 Division Properties For all a,b,c,x,y,z Z: a) 1|a and a|0 b) [(a|b) and (b|a)] a = ±b c) [(a|b) and (b|c)] a|c d) a|b a|bx for all x e) x = y + z, a|x and a|y a|z, a|y and a|z a|x f) [(a|b) and (a|c)] a|(bx+cy) bx+cy is a linear combination of b and c. g) a|c i, c j Z, for 1 ≤ i ≤ n a|(c 1 x 1 +c 2 x 2 + … + c n x n ) for all x j Z.
26
26 Proof of (f) f) [(a|b) and (a|c)] a|(bx+cy). Proof. a|b Let b = ma for some m Z. a|c Let c = na for some n Z. bx+cy = xma+yna = a(xm+yn) a| (bx+cy). #
27
27 Division Algorithm Let a,b Z and b>0, there exist unique q,r Z with 0≤r<b, such that a = qb + r. We call a the dividend, b the divisor, q the quotient, and r the remainder.
28
28 Primes An integer p>1 is prime if and only if its two positive divisors are 1 and p. An integer n>1 that is not prime is composite. The first primes are: 2,3,5,7,11,… Euclid: there are infinitely many primes. Prime factorization is unique for each n {2,3,4,…}.
29
29 Property of Composite Integers Lemma 4.1 If n Z + is composite, then there is a prime p such that p|n. Proof. Let S be the set of all composite integers that have no prime divisors. Assume S is not empty. Let m be the least member of S. m is composite m 1,m 2 [m = m 1 m 2 ]. p [p|m 1 ], where p is prime. p| m 1 m 2 p|m. #
30
30 Infinitely Many Primes Theorem 4.4 There is an infinite number of primes. Proof. Assume there are finite primes p 1, p 2, …,p k. Consider N = p 1 p 2 … p k + 1. N must be a composite. By Lemma 4.1, p i [p i | N]. However p i N for 1 i k. #
31
31 Property of Composite Integers If n Z + is composite, then there is a prime p such that p|n and. Proof. n is composite n 1,n 2 Z + [n = n 1 n 2 ]. Assume and. n 1 n 2 > n. Without loss of generality, we assume By Lemma 4.1, a prime p [p | n 1 ]. p|n and. #
32
32 Common Divisor For a,b , a positive integer c is said to be a common divisor of a and b if c|a and c|b. The greatest common divisor c, denoted by gcd(a,b), is the common divisor of a and b such that for any common divisor d of a and b satisfies d|c. Examples: gcd(121,33) = 11; gcd(6,35)=1, gcd(8,16)=8.
33
33 Uniqueness of GCD For all a,b Z +, there exists a unique c Z + that is the greatest common divisor of a and b. Proof. Given a,b Z +, let S = {as+bt | s,t , as+bt>0}. We claim that the smallest element c S is gcd(a,b). c S x,y Z [c = ax + by]. Assume c a. a = qc + r, q N,r Z +, 1 r < c. r = a – qc = a – q(ax+by) = (1-qx)a – (qy)b. r S contradicts to that c is the smallest in S. Thus, c|a. Similarly, c|b. If d Z and d|a and d|b, then d|c. (Rule (f)) #
34
34 Properties of GCD For all a,b +, gcd(a,b) is the smallest positive integer we can write as a linear combination of a and b. Integers a and b are called relatively prime when gcd(a,b) = 1. That is, x,y [ax + by = 1]. Examples: gcd(42,70) = 14 x,y [42x + 70y = 14] x,y [3x + 5y = 1] x = 2-5k, y = -1+3k. (Infinite solutions.) Theorem 4.8 If a,b,c +, the Diophantine equation ax+by=c has an integer solution iff gcd(a,b)|c.
35
35 Euclidean Algorithm Let a,b +. gcd(a,b) is calculated by setting r 0 = a, r 1 = b, and applying the division algorithm n times as follows: r 0 = q 1 r 1 + r 2,0<r 2 <r 1 r 1 = q 2 r 2 + r 3,0<r 3 <r 2 … r i = q i+1 r i+1 + r i+2,0<r i+2 <r i+1 … r n-2 = q n-1 r n-1 + r n,0<r n <r n-1 r n–1 = q n r n.gcd(a,b)=r n
36
36 Correctness of Euclidean Alg. Goal: gcd(a,b) = r n. step 1. c [c|a and c|b] c|r n. step 2. r n |a and r n |b. Proof. Let c be a positive integer such that c|r 0 and c|r 1. r 0 = q 1 r 1 + r 2 c|r 2 c|r 1 and c|r 2 and r 1 = q 2 r 2 + r 3 c|r 3 … c|r n-2 and c|r n-1 and r n-2 = q n-1 r n-1 + r n c|r n. r n–1 = q n r n r n |r n-1 r n |r n-1 and r n-2 = q n-1 r n-1 + r n r n |r n-2 … r n |r 1 and r n |r 0. #
37
37 Least Common Multiple For a,b,c +, c is a common multiple of a and b if a|c and b|c. Furthermore, c is the least common multiple of a,b, denotd by lcm(a,b), is the smallest of all common multiples of a and b. The lcm(a,b) always exists and it is unique. For any common multiple d of a and b, lcm(a,b)|d. For all a,b +, a b=gcd(a,b) lcm(a,b).
38
38 Prime Divisor If a,b + and p is a prime, then p|ab p|a or p|b. Proof. p|a finished. p a gcd(p,a) = 1 (p is a prime) x,y [px + ay = 1] (p)bx + (ab)y = b p|p and p|ab p|b. # If a i + for all 1 i n. If p is a prime and p|a 1 a 2 …a n, then p|a i for some 1 i n.
39
39 Irrrational Number is irrational. Proof. (Aristotle,384-322 B.C.) Assume = a / b, for some a,b + and gcd(a,b)=1. 2 = a 2 / b 2 2b 2 = a 2 2|a 2 2|a Let a = 2c. 2b 2 = a 2 = 4c 2 b 2 = 2c 2 2|b gcd(a,b) 2. Thus, is irrational. #
40
40 Prime Factoring Prime factoring of 980220 is 2 2 3 5 17 31 2. The number of positive divisors of 980220 is (2+1)(1+1)(1+1)(1+1)(2+1) = 72. Let m = 2 2 3 5 17 31 2, n = 2 3 7 5 2 31. gcd(m,n) = 2 2 5 31 lcm(m,n) = 2 3 3 5 2 7 17 31 2.
41
41 Uniqueness of Prime Factoring Every integer n > 1 can be written as a product of primes uniquely. (The Fundamental Theorem of Arithmetic) Proof. Existence. Assume m is the smallest integer not expressible as a product of primes. m is not a prime m 1,m 2 + [m = m 1 m 2 ] m 1,m 2 < m m 1 and m 2 can be written as products of primes m can be written as a product of primes.
42
42 Uniqueness of Prime Factoring Uniquness. Basis step: n = 2 can be uniquely written as a product of primes. Inductive step: Assuming that 2, 3, …, n-1 can be uniquely written as products of primes. Suppose, where p 1 | n p 1 | p 1 | q j for some 1 j r p 1 = q 1 by contradiction. (p 1 < p e = q 1 < q j = p 1 ) By induction, n can be uniquely written as a product of primes. #
43
43 Brainstorm 題目源自 1981 年柏林「德國邏輯思考學院」的考題改編, 98% 的測試者無法解題,國內某家半導體設計公司曾以此題目招 考員工, 題目如下 : 有五位小姐排成一列 ; 所有的小姐穿的衣 服顏色都不一樣 ; 所有的小姐姓也不同 ; 所有的小姐都養不同 的寵物, 喝不同的飲料, 吃不同的水果. 錢小姐穿紅色的衣服 ; 翁小姐養了一隻狗 ; 陳小姐喝茶 ; 穿綠衣服的站在穿白衣服的左邊 ; 穿綠衣服的小姐喝咖啡 ; 吃西瓜的小姐養鳥 ; 穿黃衣服的小姐吃柳丁 ; 站在中間的小姐喝 牛奶 ; 趙小姐站在最左邊 ; 吃橘子的小姐站在養貓的隔壁 ; 養魚的 小姐隔壁吃柳丁 ; 吃蘋果的小姐喝香檳 ; 江小姐吃香蕉 ; 趙小姐站 在穿藍衣服的隔壁 ; 只喝開水的小姐站在吃橘子的隔壁。 問題:請問那位小姐養蛇 ?
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.