Unformatted text preview: Introduction to the Theory of Computation
AZADEH FARZAN WINTER 2010 Monday, January 11, 2010 PROOFS
Proof by Contradiction Proof by Construction
Jack sees Jill, who has just come in from outdoors Proof by Induction dry. Jack knows that it is not raining. For any n, there exist n consecutive composite integers. His proof: if it were raining (assuming the statement Pis false), Jillthe n be wet (contradiction,integers roof: here are woud consecutive composite or false fconsequence). Therefore, it must not be raining. or any n: (n+1)!+2, (n+1)!+3, ..., (n+1)!+n+1 Monday, January 11, 2010 INDUCTION
A method used to show that all elements of an inﬁnite set have a speciﬁc property.
Example: an arithmetic expression computes a desired quantity for every assignment to its variables. Example: program works correctly at all steps or for all input. Every proof induction consists of two parts: The basis. The induction step. Monday, January 11, 2010 IDEA
Let’s take the inﬁnite set to be N = {1, 2, 3, . . . }. Let’s call the property P .
The goal is to prove that P (k ) is true for each natural number k .
The basis: P (1) is true. The induction step: if P (i) is true, then P (i + 1) is true as well.
P (1) ⇒ P (2) ⇒ P (3) ⇒ . . . P (i) ⇒ . . .
Monday, January 11, 2010 Mathematical Induction is a way to show that for eac we could eventually prove that P (n) is true. FORMALLY: MATHEMATICAL INDUCTION PRINCIPLE Deﬁnition 44 Principle of Mathematical Induction: Let P () be a predicate deﬁned on N. Then if (1) P (0) is true, and 1 (2) ∀n ∈ N [P (n) → P (n + 1)], troduction to theP (Theory ∀n ∈ N n) is true. of Computation
then 7.1 Why it works Suppose (1) and (2) hold. Then AZADEH FARZAN
Monday, January 11, 2010 WINTER 2010 73 EXAMPLE
Prove
Proof by induction:
The basis (n=1): holds since 1 = 1 ×2/2. m The induction step: if i=1 i = m(m + 1)/2, then m+1 i=1 i = (m + 1)(m + 2)/2.
m+1 i=1 n i=1 i = n(n + 1)/2. i = = = m i=1 i + (m + 1) m(m + 1)/2 + (m + 1) [m(m + 1) + 2(m + 1)] /2 = (m + 1)(m + 2)/2 Monday, January 11, 2010 LET’S FORMALIZE ! Monday, January 11, 2010 WELLORDERING
Principle of Wellordering: Any nonempty subset of N has minimum element. ∀A ⊆ N, s.t. A = ∅, [∃a ∈ A s.t. (∀b ∈ A, a ≤ b)]. Is the principle true for Z?
Is the principle true for rational numbers in (0, 1)? Monday, January 11, 2010 WHAT IS THE RELATION BETWEEN WELLORDERING AND INDUCTION? Monday, January 11, 2010 Induction works as a proof method since: Principle of wellordering implies principle of mathematical induction. proof on the board! Monday, January 11, 2010 SIMPLE INDUCTION
Principle of Simple Induction: Let A be a set that satisﬁes the following properties: (i) 0 is in A; (ii) for any i ∈ N, if i ∈ A, then i + 1 ∈ A. Then N ⊆ A. 0 ∈ A ⇒ 1 ∈ A ⇒ 2 ∈ A ⇒ 3 ∈ A... Monday, January 11, 2010 Problem: prove that every natural number greater than 1 can be written as a product of prime numbers. LET’S LOOK AT A SLIGHTLY DIFFERENT KIND OF INDUCTION. Monday, January 11, 2010 7.3 Strong Mathematical Induction FORMALLY: STRONG INDUCTION PRINCIPLE
Deﬁnition 46 Strong Mathematical Induction Principle If P (0) and ∀n ≥ 0 [(P (0) ∧ P (1) ∧ . . . ∧ P (n)) → P (n + 1)] then ∀n P (n). Using the above (stronger) principle, to prove P (n + 1) we can rely on inductive hypothesis that all of P (0), P (1), . . . , P (n) are true. The reason this principle works, and the proof that it does (based on wellordering principle) is identical to the weak induction. EXAMPLE Given n black points and n white points in the plane, no three WAIT, WHY that there exists ONE WORK? of them on a line, proveDOES THIS a way to match them onetoone, such that the line segments between the matched pairs do not intersect. Proof. Base Case. n = 1. Just join them together; there is only one segment so clearly it doesn’t intersect Monday, Januaryany others. 11, 2010 COMPLETE INDUCTION
Principle of Complete Induction: Let A be a set that satisﬁes the following properties: (*) for any i ∈ N, if ∀j < i, j ∈ A, then i ∈ A. Then N ⊆ A. , , , 0 ∈ A ⇒ 1 ∈ A ⇒ 2 ∈ A ⇒ 3 ∈ A ⇒ ... Monday, January 11, 2010 THREE EQUIVALENT NOTIONS
Theorem. The principles of (a) wellordering, (b) simple induction, and (c) complete induction are equivalent. Monday, January 11, 2010 ALL DEFINITIONS
Principle of Wellordering: Any nonempty subset of N has minimum element. Principle of Simple Induction: Let A be a set that satisﬁes the following properties: (i) 0 is in A; (ii) for any i ∈ N, if i ∈ A, then i + 1 ∈ A. Then N ⊆ A.
Principle of Complete Induction: Let A be a set that satisﬁes the following properties: (*) for any i ∈ N, if ∀j < i, j ∈ A, then i ∈ A. Then N ⊆ A.
Monday, January 11, 2010 EXAMPLE
For every natural number n, the power set of a set with n elements has 2n elements. Basis: The power set of ∅ (with 0 elements) has 20 = 1 element (∅ itself). Induction step: if n element sets have 2n subsets, then n + 1 element sets have 2n+1 subsets. Let X  = n + 1 and x ∈ X and let Y = X − {x}. Then Y  = n. X  has two types of subsets: (i) those which contain x, and (ii) those which do not. • Subsets of type (i) are subsets of Y as well, and there are 2n of them by IH. • Subsets of type (ii) are subsets of Y if we remove x from them, and there are 2n of them by IH.
Total number of subsets: 2n + 2n = 2n+1 .
Monday, January 11, 2010 NONZERO BASES
For all n ≥ 6, we have 2n > 10n. Basis: n = 6, clearly 26 = 64 > 10.6 = 60.
Induction Step: For an arbitrary i ≥ 6, 2i > 10i ⇒ 2i+1 > 10(i + 1). 2 i+1 = 2.2 i > 2.10i = 10i + 10i > 10i + 10 = 10(i + 1) Monday, January 11, 2010 A VARIATION
Sometimes it is easier to have an explicit basis for complete induction.
Basis: Prove that P (0) is true. Induction Step: Prove that , for each natural number i > 0, if P (j ) holds for all natural numbers j < i, then P (i) holds as well. Monday, January 11, 2010 EXAMPLE
P (n): If a full binary tree has n nodes, then n is an odd number.
Prove P (n) is true for all n ≥ 1. Basis: n = 1. A full binary tree with one node, and one is odd. Induction Hypothesis: Assume we have a binary tree with n > 1 nodes.
If T1 is the left subtree and T2 is the right subtree of our full binary tree T , then we have:
nodes(T )=nodes(T1 )+nodes(T2 )+1
Monday, January 11, 2010 READING Chapter 0: to remind yourself of the basic notions and deﬁnitions. Chapters 1 for this week’s discussions on induction. Monday, January 11, 2010 ...
View
Full
Document
This note was uploaded on 04/11/2010 for the course CSC CSC236 taught by Professor Farzanazadeh during the Spring '10 term at University of Toronto.
 Spring '10
 FarzanAzadeh

Click to edit the document details