discrete mathematics
play

Discrete Mathematics -- Chapter 4: Properties of the Ch t 4 P ti - PowerPoint PPT Presentation

Discrete Mathematics -- Chapter 4: Properties of the Ch t 4 P ti f th Integers: Mathematical Induction Hung-Yu Kao ( ) Department of Computer Science and Information Engineering, N National Cheng Kung University l Ch K U


  1. Discrete Mathematics -- Chapter 4: Properties of the Ch t 4 P ti f th Integers: Mathematical Induction Hung-Yu Kao ( 高宏宇 ) Department of Computer Science and Information Engineering, N National Cheng Kung University l Ch K U

  2. Outline � 4.1 The Well-Ordering Principle: Mathematical Induction Induction � 4.2 Recursive Definitions � 4.3 The Division Algorithm: Prime Numbers h i i i l i h i b � 4.4 The Greatest Common Divisor: The Euclidean Algorithm � 4 5 The fundamental Theorem of Arithmetic � 4.5 The fundamental Theorem of Arithmetic 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – CH4 CH4 2

  3. 自然 數 � 自然 數 要適合五點( Peano axioms) : � 有一起始自然 數 0 。 � 有一起始自然 數 0 � 任一自然 數 a 必有後繼,記作 a +1 。 � 0 並非任何自然 數 的後繼 � 0 並非任何自然 數 的後繼。 � 不 同的自然 數 有 不 同的後繼。 � ( 數 學歸納公設)有一與自然 數 有關的命題。設此 ( 數 學歸納公設)有一與自然 數 有關的命題 設此 命題對 0 成 立 ,而當對任一自然 數 成 立 時,則對其 後繼亦成 立 後繼亦成 立 ,則此命題對所有自然 數 皆成 立 。 則此命題對所有自然 數 皆成 立 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – CH4 CH4 3

  4. 4.1 The Well-Ordering Principle: g p Mathematical Induction The Well-Ordering Principle : Every nonempty subset of Z + � contains a smallest element. Z + is well ordered + = ∈ ∈ > > = ∈ ∈ ≥ ≥ ( ) ( ) Z Z { { Ζ Ζ | | 0 0 } } { { Z Z | | 1 1 } } x x x x x x x x The Principle of Mathematical Induction : Let S ( n ) denote an � open mathematical statement that involves one or more occurrences of the variable n , which represents a positive integer. f th i bl hi h t iti i t If S (1) is true; and (basis step) a) If whenever S ( k ) is true, then S ( k +1) is true. (inductive step) w e eve S ( k ) s ue, e S ( k ) s ue. ( duc ve s ep) b) b) + ∈ Z then S ( n ) is true for all n Using quantifiers � ∧ ∀ ≥ ⇒ + ⇒ ∀ ≥ [ [ ( ( ) ) [ [ [ [ ( ( ) ) ( ( 1 )]]] )]]] ( ( ) ) S n k n S k S k n n S n 0 0 0 0 0 0 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – CH4 CH4 4

  5. 4.1 The Well-Ordering Principle: Mathematical Induction P( n 0 ) P( n 0 +1 ) P( n 0 +2 ) . . . 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – CH4 CH4 5

  6. Why Induction Works � More rigorously the validity of a proof by mathematical induction relies � More rigorously, the validity of a proof by mathematical induction relies on the well-ordering of Z + . � Let S be a statement for which we have proven that S(1) holds and for p ( ) all n ∈ Z + we have S(n) ⇒ S(n+1). Claim: S(n) holds for all n ∈ Z + � Proof by contradiction : Define the set F ⊆ Z + of values for which S does not hold: F = { m | S(m) does not hold}. � If F is non-empty, then F must have a smallest element (well-ordering of If F is non empt then F must have a smallest element ( ell ordering of Z + ), let this number be z with ¬ S(z). Because we know that S(1), it must hold that z>1. Because z is the smallest value, it must hold that S(z–1), which contradicts our proof for all n ∈ Z + : S(n) ⇒ S(n+1). hi h di f f ll + ( ) ( ) � Contradiction: F has to be empty: S holds for all Z + . 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – CH4 CH4 6

  7. The Well-Ordering Principle: g p Mathematical Induction + + ( 1 ) n n Ex 4.1 : For any ∈ n = + + + ⋅ ⋅ ⋅ + = ∑ Z , 1 2 3 � n i n = 1 i 2 Proof � + ( ( 1 1 ) ) n n = + + + ⋅ ⋅ ⋅ + = ∑ n Let ( ) : 1 2 3 S n i n = 1 i 2 × + 1 ( 1 1 ) 1 = = ∑ (i) ( ) ( ( 1 ) ) : 1 S i = = 1 1 i i 2 2 + ( 1 ) k k k = ∑ (ii) Assume ( ) is true, i.e., S k i = 1 i 2 + + 1 1 + = + + + ⋅ ⋅ ⋅ + + + ∑ ∑ k k (iii) (iii) Then Th ( ( 1 1 ) ) : 1 1 2 2 3 3 ( ( 1 1 ) ) S S k k i i k k k k = 1 i + ( 1 ) k k 1 = + + = + + ∑ ( ) ( 1 ) ( 1 ) i k k = 1 i 2 + + ( 1 )( 2 ) k k = 2 n i ∑ ∑ ∈ + + = + + + + + + ⋅ ⋅ ⋅ + + = 2 + + + + try t Z Z , 1 1 2 2 3 3 2 2 n i n n n n n 2 = 1 i 2009 Spring 2009 Spring Discrete Mathematics – Discrete Mathematics – CH4 CH4 7

  8. The Well-Ordering Principle: g p Mathematical Induction Ex 4.3 : Among the 900 three-digit integers (100 to 999), where the � integer is the same whether it is read from left to right or from right to left are called palindromes Without actually determining all of these left, are called palindromes. Without actually determining all of these three-digit palindromes, we would like to determine their sum. Solution � = + + = + The typical palindrome : 100 10 101 10 aba a b a a b ⎛ ∑ ⎞ 9 9 9 9 ⎜ ⎜ = + ∑ ∑ ∑ ∑ ∑ ∑ ∑ ( ( 101 10 ) ) aba a b ⎜ ⎜ ⎝ ⎠ = = = = 1 0 1 0 a b a b ⎡ ⎤ 9 9 9 [ [ ] ] = + = + ⋅ ∑ ∑ ∑ 10 ( ( 101 ) ) 10 1010 10 45 a b a ⎢ ⎢ ⎥ ⎥ ⎣ ⎣ ⎦ ⎦ = = = 1 0 1 a b a 9 = + ⋅ = ∑ 1010 9 450 49 , 500 a = 1 a 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – CH4 CH4 8

  9. The Well-Ordering Principle: g p Mathematical Induction = + = + + = + + + 1 2 1 2 3 1 2 3 4 t t t Ex 4.5 ⋅ 1 2 2 3 4 � = = 1 t 1 2 ⋅ ⋅ 2 3 ⋅ 4 5 = = 3 4 = = = = 3 10 6 2 2 For triangular number 2 � t i =1+2+…+ i = i ( i +1)/2 t =1+2+ + i = i ( i +1)/2 We want a formula for the sum � of the first n triangular numbers. P Proof f � n n n + + + + ( 1 ) ( 1 )( 2 1 ) ( 1 ) i i n n n n n 1 1 1 = = = = 2 + + = = + + ∑ ∑ ∑ ∑ ∑ ∑ ( ( ) ) [ [ ] ] [ [ ] ] t t i i i i i 2 2 2 6 2 2 = = = 1 1 1 i i i + + ( 1 )( 2 ) Ex 4.4 prove it n n n = 6 6 100 ( 101 )( 102 ) ∴ + + + = = ... 171 , 700 t t t 1 2 100 6 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – CH4 CH4 9

  10. The Well-Ordering Principle: g p Mathematical Induction Ex 4.5 � Consider pseudocode procedures (comparisons) � Procedure 1: n additions and n multiplications (additionally, counter i) P d 1 dditi d lti li ti ( dditi ll t i) � Procedure 2: 2 additions, 3 multiplications, and 1 division � procedure SumOfSquares2 procedure SumOfSquares1 begin begin begin sum:= n * (n+1) * (2 * n+1)/6 ( 1) (2 1)/6 sum:= 0 end for i:= 1 to n do sum := sum + i 2 end 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – CH4 CH4 10

  11. The Well-Ordering Principle: g p Mathematical Induction 4 n n 2 -7 4 n n 2 -7 Ex 4.8 n n � 2 − 1 4 -6 5 20 18 ≥ ≥ < < � For For 6 6 , , 4 4 ( ( 7 7 ). ). n n n n n n 2 8 -3 2 8 -3 6 24 29 6 24 29 Solution � 3 12 2 7 28 42 4 16 9 8 32 57 2*6+1=13 ≥ 4 < 2 − ≥ ( ) : 4 ( 7 ), 6 S k k k k + + = + < 2 − + < 2 − + + ( ( 1 ) ) : 4 ( ( 1 ) ) 4 4 ( ( 7 ) ) 4 ( ( 7 ) ) ( ( 2 1 ) ) S k k k k k k ⇒ + < 2 − + + = + 2 − 4 ( 1 ) ( 7 ) ( 2 1 ) ( 1 ) 7 k k k k ∴ ( ) is true . S n 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – CH4 CH4 11

  12. The Well-Ordering Principle: g p Mathematical Induction 1 1 1 = = + ⋅ ⋅⋅ = + + ⋅ ⋅ ⋅ + 1 , 1 , , 1 � Ex 4.9 : Harmonic numbers H H H 1 2 2 2 n n n = + − ∑ For all n, ( 1 ) H n H n j j n j = 1 � Proof 1 ∑ = = = + − Verify ( 1 ) : 1 ( 1 1 ) 1 S H H H 1 1 j = 1 j j k ∑ = + − Assume ( ) true : ( 1 ) S k H k H k j k = 1 j + 1 1 k k k k ∑ ∑ + = + = + − + Verify ( 1 ) : [ ( 1 ) ] S k H H H k H k H + + 1 1 j j k k k = = 1 1 j j = + + − + + (k (k 1) 1) H H k k H H + 1 k k 1 = + − − + (k 1)[ ] H k H + 1 + + 1 k 1 k k = = + + − + + (k (k 2) 2) ( ( 1 1 ) ) H H k k k + 1 ∴ ( ) is true . S n 2009 Spring 2009 Spring Discrete Mathematics – Discrete Mathematics – CH4 CH4 12

Recommend


More recommend