Presentation is loading. Please wait.

Presentation is loading. Please wait.

Induction and Recursion §4.1 Mathematical Induction §4.2 Strong Induction and Well-Ordering §4.3 Recursive Definitions and Structural Inductions §4.4 Recursive.

Similar presentations


Presentation on theme: "Induction and Recursion §4.1 Mathematical Induction §4.2 Strong Induction and Well-Ordering §4.3 Recursive Definitions and Structural Inductions §4.4 Recursive."— Presentation transcript:

1 Induction and Recursion §4.1 Mathematical Induction §4.2 Strong Induction and Well-Ordering §4.3 Recursive Definitions and Structural Inductions §4.4 Recursive Algorithms 2009/101

2 2 Mathematical Induction (§4.1&2) A powerful technique for proving that a predicate P(n) is true for every natural number n, no matter how large. Based on a predicate-logic inference rule: P(0)  n  0 (P(n)  P(n+1))  n  0 P(n) “The First Principle of Mathematical Induction”

3 2009/103 The Well-Ordering Property The validity of the inductive inference rule can also be proved using the well-ordering property, which says: Every non-empty set of non-negative integers has a least (smallest) element. 良序性質在數論上非常有用。除法公式、最大公 因數的線性表示法等,皆可直接使用良序性質得 證之。下面我們將利用良序性質來證明數學歸納 法的有效性。

4 2009/104 Why the induction is valid? P(0)   n  0 (P(n)  P(n+1))  n  0 P(n) Suppose that S = {n|  P(n)} is non-empty. By the well-ordering property, S has a least element m such that P(m) is false. Then m  0 (since P(0) is true) and P(m  1) is false (since  n  0 (P(n)  P(n+1))). This contradicts to m is the least element. ▓

5 2009/105 Outline of an Inductive Proof Want to prove  n P(n)… Basis step: Prove P(0) is true. Inductive step: Prove  n P(n)  P(n+1).

6 2009/106 Induction Example (1st princ.) Prove that  n > 0, n < 2 n. Pf. Let P(n) = (n < 2 n ) Basis step: Inductive step:

7 2009/107 Second Principle of Induction Second principle of mathematical induction is also called strong induction. Characterized by another inference rule: P(0)  n  0: (  0  k  n P(k))  P(n+1)  n  0: P(n) Difference with 1st principle is that the inductive step uses the fact that P(k) is true for all smaller k < n+1, not just for k = n. P is true in all previous cases

8 2009/108 Example of Second Principle Show that every n > 1 can be written as a product p 1 p 2 …p s of some series of s prime numbers. Let P(n) =“n has that property” Basis step: Inductive step:

9 2009/109 Another Example Prove that every amount of postage of 12 cents or more can be formed using just 4-cent and 5-cent stamps. Basis step: Inductive step:


Download ppt "Induction and Recursion §4.1 Mathematical Induction §4.2 Strong Induction and Well-Ordering §4.3 Recursive Definitions and Structural Inductions §4.4 Recursive."

Similar presentations


Ads by Google