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...

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

CSE 311: Foundations of Computing Lecture 17: Recursively Defined Sets & Structural Induction
Image of page 1

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
Image of page 2
Midterm 5 problems covering: Logic / English translation Boolean circuits, algebra, and normal forms Solving modular equations Induction Modular arithmetic Set theory English proofs
Image of page 3

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
Image of page 4
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.
Image of page 5

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 ?
Image of page 6
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
Image of page 7

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 *
Image of page 8
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
Image of page 9

Subscribe to view the full document.

All Binary Strings with no 1’s before 0’s
Image of page 10
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
Image of page 11

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
Image of page 12
Rooted Binary Trees Basis: is a rooted binary tree Recursive step: If and are rooted binary trees, then also is a rooted binary tree.
Image of page 13

Subscribe to view the full document.

Image of page 14
  • Spring '16

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    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