CSE 311 Foundations of Computing I Lecture 16 Recursively Defined Sets and Structural Induction Spring 2013 1.

Slides:



Advertisements
Similar presentations
22C:19 Discrete Structures Induction and Recursion Spring 2014 Sukumar Ghosh.
Advertisements

22C:19 Discrete Structures Induction and Recursion Fall 2014 Sukumar Ghosh.
Recursive Definitions and Structural Induction
Induction and Recursion. Odd Powers Are Odd Fact: If m is odd and n is odd, then nm is odd. Proposition: for an odd number m, m k is odd for all non-negative.
10.1 CompSci 102© Michael Frank Today’s topics RecursionRecursion –Recursively defined functions –Recursively defined sets –Structural Induction Reading:
Induction and recursion
CSE115/ENGR160 Discrete Mathematics 04/03/12 Ming-Hsuan Yang UC Merced 1.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
CSE 321 Discrete Structures Winter 2008 Lecture 12 Induction.
CSE115/ENGR160 Discrete Mathematics 03/31/11
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
1 Recitation 10. Induction Introduction. Induction is useful in proving properties of recursive algorithms, like their execution times. It is also the.
1 Section 3.4 Recursive Definitions. 2 Recursion Recursion is the process of defining an object in terms of itself Technique can be used to define sequences,
22C:19 Discrete Math Induction and Recursion Fall 2011 Sukumar Ghosh.
Induction and recursion
Recursive Definitions and Structural Induction
Mathematical Maxims and Minims, 1988
Induction and recursion
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 4 Induction and Recursion 歐亞書局.
Chapter 4: Induction and Recursion
CSE 311 Foundations of Computing I Lecture 15 Recursive Definitions and Structural Induction Autumn 2011 CSE 3111.
Section 5.3. Section Summary Recursively Defined Functions Recursively Defined Sets and Structures Structural Induction.
CSE 311 Foundations of Computing I Lecture 17 Structural Induction: Regular Expressions, Regular Languages Autumn 2011 CSE 3111.
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
Chapter 5 With Question/Answer Animations. Section 5.1.
CSE 311 Foundations of Computing I Lecture 17 Structural Induction Spring
Chapter Mathematical Induction 4.2 Strong Induction and Well-Ordering 4.3 Recursive Definitions and Structural Induction 4.4 Recursive Algorithms.
Induction Proof. Well-ordering A set S is well ordered if every subset has a least element. [0, 1] is not well ordered since (0,1] has no least element.
Section 3.3: Mathematical Induction Mathematical induction is a proof technique that can be used to prove theorems of the form:  n  Z +,P(n) We have.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
1 Recursive Definitions and Structural Induction CS 202 Epp section ??? Aaron Bloomfield.
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
CSE 311: Foundations of Computing Fall 2013 Lecture 18: Structural induction, regular expressions.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
CSE 311 Foundations of Computing I Lecture 19 Recursive Definitions: Context-Free Grammars and Languages Autumn 2012 CSE
Chapter 5 With Question/Answer Animations 1. Chapter Summary Mathematical Induction - Sec 5.1 Strong Induction and Well-Ordering - Sec 5.2 Lecture 18.
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
1 Recursive Definitions and Structural Induction CS/APMA 202 Rosen section 3.4 Aaron Bloomfield.
Section Recursion  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
CSE 311 Foundations of Computing I Lecture 15 Strong Induction and Recursive Definitions Spring
Mathematical Induction What it is? Why is it a legitimate proof method? How to use it?
3.3 Mathematical Induction 1 Follow me for a walk through...
Chapter 5 1. Chapter Summary  Mathematical Induction  Strong Induction  Recursive Definitions  Structural Induction  Recursive Algorithms.
(Proof By) Induction Recursion
CSE 311 Foundations of Computing I
CS2210:0001Discrete Structures Induction and Recursion
CSE 311 Foundations of Computing I
Induction and recursion
CSE 311 Foundations of Computing I
CSE 311: Foundations of Computing
Discrete Structures for Computer Science
Discrete Structures for Computer Science
CSE 311: Foundations of Computing
Induction and recursion
CSE 311 Foundations of Computing I
CSE 311: Foundations of Computing
CSE 321 Discrete Structures
MA/CSSE 474 More Math Review Theory of Computation
CSE 321 Discrete Structures
Induction Chapter
Mathematical Induction
CSE 321 Discrete Structures
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
Presentation transcript:

CSE 311 Foundations of Computing I Lecture 16 Recursively Defined Sets and Structural Induction Spring

Announcements Reading assignments – Today: th Edition th Edition Midterm Friday, May 10, MGH 389 – Closed book, closed notes – Tables of inference rules and equivalences will be included on test – Sample questions from old midterms are now posted 2

Induction Mathematical Induction Induction proof layout: 1.Let P(n) be “ “. By induction we will show that P(n) is true for every n≥0 2.Base Case: Prove P(0) 3.Inductive Hypothesis: Assume that P(k) is true for some arbitrary integer k ≥ 0 4.Inductive Step: Prove that P(k+1) is true using Inductive Hypothesis that P(k) is true 5.Conclusion: Result follows by induction P(0)  k≥0 (P(k)  P(k+1))   n≥0 P(n) 3

Strong Induction P(0)  k (  j ((0 ≤j ≤k)  P(j))  P(k+1))  n P(n) Strong Induction proof layout: 1.Let P(n) be “…”. By induction we will show that P(n) is true for every n≥0 2.Base Case: Prove P(0) 3.Inductive Hypothesis: Assume that for some arbitrary integer k ≥ 0 we have P(j) true for every integer j with 0 ≤ j ≤ k. 4.Inductive Step: Prove that P(k+1) is true using Inductive Hypothesis that P(0),…,P(k) are true 5.Conclusion: Result follows by induction 4

Bounding the Fibonacci Numbers How we did it last time 5

Bounding the Fibonacci Numbers Alternative Layout 6

Recursive Definitions of Sets Recursive definition – Basis step: 0  S – Recursive step: if x  S, then x + 2  S – Exclusion rule: Every element in S follows from basis steps and a finite number of recursive steps 7

Recursive definitions of sets Basis: 6  S; 15  S; Recursive: if x, y  S, then x + y  S; Basis: [1, 1, 0]  S, [0, 1, 1]  S; Recursive: if [x, y, z]  S,  in ℝ, then [  x,  y,  z]  S if [x 1, y 1, z 1 ], [x 2, y 2, z 2 ]  S then [x 1 + x 2, y 1 + y 2, z 1 + z 2 ]  S Powers of 3 8

Recursive Definitions of Sets: General Form Recursive definition – Basis step: Some specific elements are in S – Recursive step: Given some existing named elements in S some new objects constructed from these named elements are also in S. – Exclusion rule: Every element in S follows from basis steps and a finite number of recursive steps 9

Strings An alphabet  is any finite set of characters. The set  * of strings over the alphabet  is defined by – Basis:   * ( is the empty string) – Recursive: if w   *, a  , then wa   * 10

Palindromes Palindromes are strings that are the same backwards and forwards Basis: is a palindrome and any a ∈  is a palindrome Recursive step: If p is a palindrome then apa is a palindrome for every a ∈  11

All binary strings with no 1’s before 0’s 12

Function definitions on recursively defined sets len ( ) = 0; len (wa) = 1 + len (w); for w   *, a   Reversal: R =  (wa) R = aw R for w   *, a   Concatenation: x = x for x   * x wa = (x w)a for x, w   *, a   13

Rooted Binary trees Basis: is a rooted binary tree Recursive Step: If and are rooted binary trees then so is: 14 T1T1 T2T2 T1T1 T2T2

Functions defined on rooted binary trees size()=1 size( ) = 1+size(T 1 )+size(T 2 ) height()=0 height( )=1+max{height(T 1 ),height(T 2 )} 15 T1T1 T2T2 T1T1 T2T2

Structural Induction: proving properties of recursively defined sets How to prove  x ∈ S. P(x) is true: Base Case: Show that P is true for all specific elements of S mentioned in the Basis step Inductive Hypothesis: Assume that P is true for some arbitrary values of each of the existing named elements mentioned in the Recursive step Inductive Step: Prove that P holds for each of the new elements constructed in the Recursive step using the named elements mentioned in the Inductive Hypothesis Conclude that  x ∈ S. P(x) 16

Structural Induction versus Ordinary Induction Ordinary induction is a special case of structural induction: – Recursive Definition of ℕ Basis: 0 ∈ ℕ Recursive Step: If k ∈ ℕ then k+1 ∈ ℕ Structural induction follows from ordinary induction Let Q(n) be true iff for all x ∈ S that take n Recursive steps to be constructed, P(x) is true. 17

Using Structural Induction Let S be given by – Basis: 6  S; 15  S; – Recursive: if x, y  S, then x + y  S. Claim: Every element of S is divisible by 3 18

Structural Induction for strings 19

len(x y)=len(x)+len(y) for all strings x and y 20 Let P(w) be “len(x w)=len(x)+len(w)”