structural-induction

structural-induction - Introduction to the Theory of...

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Introduction to the Theory of Computation AZADEH FARZAN SPRING 2010 Tuesday, February 2, 2010 STRUCTURAL INDUCTION Tuesday, February 2, 2010 DEFINING SETS RECURSIVELY Deﬁne a set of objects: (i) deﬁne the smallest or smiplest object (or objects). (ii) deﬁne the ways in which larger or more complex objects can be built out of the smaller or simpler ones. Example: smallest set of simple expressions over x, y, z , call it E . (i) smiple objects: x, y, z ∈ E . (ii) more complex objects: if e1 , e2 ∈ E then so are (e1 + e2 ), (e1 − e2 ), (e1 × e2 ), and (e1 ÷ e2 ). Tuesday, February 2, 2010 CORRECTNESS Theorem. Let S be a set, B ⊆ S , m a positive integer, and f1 , . . . , fm be operators on S of arity k1 , . . . , km , respectively. There is a unique U ⊆ S such that: (a) B ⊆ U , (b) U is closed under f1 , . . . , fm , and (c) any subset of S that satisﬁes (a) and (b) contains U . Tuesday, February 2, 2010 U0 U1 U2 U3 ... =B = U0 ∪ set obtained by applying f1 , . . . , fm to elements in U0 = U1 ∪ set obtained by applying f1 , . . . , fm to elements in U1 = U2 ∪ set obtained by applying f1 , . . . , fm to elements in U1 Ui = Ui−1 ∪ set obtained by applying f1 , . . . , fm to elements in Ui−1 U0 ∪ U1 ∪ U2 ∪ · · · ∪ Ui ∪ . . . Tuesday, February 2, 2010 PRINCIPLE OF SET DEFINITION BY INDUCTION Let S be a set, B ⊆ S , m be a positive interger, and f1 , . . . , fm be operators on S of arity k1 , . . . , km respectively. Let ￿ ￿ if i = 0 if i > 0 Ui = B Ui−1 ∪ ￿￿ m j =1 {fj (a1 , . . . , akj ) : a1 , . . . akj ∈ Si−1 } ￿ Then i∈N Ui is the smallest subset of S that contains B and is closed under f1 , . . . , fm . Tuesday, February 2, 2010 STRUCTURAL INDUCTION To prove that every element of X (deﬁned inductively) has a certain property P : Basis: Prove that every smallest or smiplest element of X satisﬁes P . Induction Step: Prove that each of the (ﬁnitely many) ways of constructing larger or more complex elements out of t smaller or simpler ones preserves the property. Tuesday, February 2, 2010 EXAMPLE Example 1: well-balanced parentheses. Example 2: Binary Trees. Tuesday, February 2, 2010 ALTERNATIVE: COMPLETE INDUCTION How can we use complete induction instead of structural induction? • Deﬁne a measure for each element of the set. • Show by complete induction that every element with measure n has the property P . Tuesday, February 2, 2010 EXAMPLE example: well-balanced parentheses revisited: lp(e) = rp(e) example: binary threes revisited: nodes(T) ≤ 2h(T)+1 -1 Tuesday, February 2, 2010 READING Chapter 4. Tuesday, February 2, 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.

Ask a homework question - tutors are online