lecture17-structuralinduction.pdf - CSE 311 Foundations of Computing Lecture 17 Recursively Defined Sets Structural Induction Midterm • Monday May

lecture17-structuralinduction.pdf - CSE 311 Foundations of...

• Notes
• 31

This preview shows page 1 - 14 out of 31 pages.

CSE 311: Foundations of Computing Lecture 17: Recursively Defined Sets & Structural Induction Subscribe to view the full document.

Midterm Monday, May 13th in class Closed book, closed notes will include inference rules & equivalences if helpful expect you remember congruence, divides, inverse, etc. Covers material up to end of ordinary induction. Practice problems & midterm on the website TA-led review session: Saturday, May 11th, 2-4 pm in SMI 120 Midterm 5 problems covering: Logic / English translation Boolean circuits, algebra, and normal forms Solving modular equations Induction Modular arithmetic Set theory English proofs Subscribe to view the full document.

Recursive Definitions of Sets Natural numbers Basis: 0 S Recursive: If x S, then x+1 S Even numbers Basis: 0 S Recursive: If x S, then x+2 S Recursive Definition of Sets Recursive definition of set S Basis Step: 0 S Recursive Step: If x S , then x + 2 S Exclusion Rule: Every element in S follows from the basis step and a finite number of recursive steps. We need the exclusion rule because otherwise S= would satisfy the other two parts. However, we won’t always write it down on these slides. Subscribe to view the full document.

Recursive Definitions of Sets Basis: [0, 0] S, [1, 1] S Recursive: If [n-1, x] S and [n, y] S, then [n+1, x + y] S. Powers of 3: Basis: 1 S Recursive: If x S, then 3x S. Natural numbers Basis: 0 S Recursive: If x S, then x+1 S Even numbers Basis: 0 S Recursive: If x S, then x+2 S ? Recursive Definitions of Sets Basis: [0, 0] S, [1, 1] S Recursive: If [n-1, x] S and [n, y] S, then [n+1, x + y] S. Powers of 3: Basis: 1 S Recursive: If x S, then 3x S. Natural numbers Basis: 0 S Recursive: If x S, then x+1 S Even numbers Basis: 0 S Recursive: If x S, then x+2 S Fibonacci numbers Subscribe to view the full document.

Strings An alphabet S is any finite set of characters The set S * of strings over the alphabet S is defined by Basis: ε Î S ( ε is the empty string w/ no chars) Recursive: if ࠵? Î S *, ࠵? Î S , then ࠵?࠵? Î S * Palindromes Palindromes are strings that are the same backwards and forwards Basis: ε is a palindrome and any ࠵? ∈ S is a palindrome Recursive step: If ࠵? is a palindrome then ࠵?࠵?࠵? is a palindrome for every ࠵? ∈ S Subscribe to view the full document.

All Binary Strings with no 1’s before 0’s All Binary Strings with no 1’s before 0’s Basis: ε ∈ S Recursive: If x S , then 0x S If x S , then x1 S Subscribe to view the full document.

Functions on Recursively Defined Sets (on S * ) Length: len( ε ) = 0 len(wa) = 1 + len(w) for w S * , a S Concatenation: x • ε = x for x S * x • wa = (x • w)a for x S * , a S Reversal: ε R = ε (wa) R = a • w R for w S * , a S Number of c’ s in a string: # c ( ε ) = 0 # c (wc) = # c (w) + 1 for w S * # c (wa) = # c (w) for w S * , a S , a ≠ c Rooted Binary Trees Basis: is a rooted binary tree Recursive step: If and are rooted binary trees, then also is a rooted binary tree. Subscribe to view the full document. • Spring '16

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes