Attribution Non-Commercial (BY-NC)

1 views

Attribution Non-Commercial (BY-NC)

- The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
- Sapiens: A Brief History of Humankind
- Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
- Shoe Dog: A Memoir by the Creator of Nike
- The Unwinding: An Inner History of the New America
- The Little Book of Hygge: Danish Secrets to Happy Living
- Never Split the Difference: Negotiating As If Your Life Depended On It
- Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
- Yes Please
- A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
- Grit: The Power of Passion and Perseverance
- Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
- The Emperor of All Maladies: A Biography of Cancer
- John Adams
- This Changes Everything: Capitalism vs. The Climate
- Team of Rivals: The Political Genius of Abraham Lincoln
- The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
- Principles: Life and Work
- Rise of ISIS: A Threat We Can't Ignore
- The World Is Flat 3.0: A Brief History of the Twenty-first Century

You are on page 1of 12

Peter Cappello Department of Computer Science University of California, Santa Barbara Santa Barbara, CA 93106 cappello@cs.ucsb.edu

The corresponding textbook chapter should be read before attending this lecture. These notes are not intended to be complete. They are supplemented with gures, and other material that arises during the lecture period in response to questions.

Based on Theory of Computing, 2nd Ed., D. Cohen, John Wiley & Sons, Inc.

A precise and useful way to dene sets is by recursive denition. A recursive denition of set S has 2 kinds of rules: An enumeration of Ss base elements; Rules for making new elements in S from Ss existing elements.

Example 1

Set S is dened by the following rules: 0, 1 S a, b S a + b S. Can you characterize S using English words?

Example 2

Set S is dened by the following rules: 0, 1 S a, b S a + b, a b S. Can you characterize S using English words?

Example 3

Set S is dened by the following rules: 0, 1 S a, b S a + b, a b S. a, b S a/b S, for b = 0. Can you characterize S using English words?

Example 4

Set S is dened by the following rules: 0, 1 S a, b S a + b, a b S. a, b S a/b S, for b = 0. a, b S a b S. Can you prove that 3 5 S?

Observation:

Denition of S 1. 0, 1 S 2. a, b S a + b, a b S.

Proof of observation 1. 1 S (Rule 1) 2. 2 = 1 + 1 S (Step1, Rule 2) 3. 3 = 2 + 1 S (Step 2, Rule 2) 4. 3 S (Step 3, Rule 2) 5. 5 = 3 + 2 S (Steps 2, 3, Rule 2) 6. 3 5 S (Steps 4, 5, Rule 2) Can you think of an alternate proof?

5S

Example 5

Function f is dened by the following rules: f (0) = 0, f (1) = 1 f (n) = f (n 1) + f (n 2). Have you seen this function before?

Let S be a language. Dene Ss Kleene closure, denoted S , as follows: S w S w S x, w S xw S .

Let = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, +, , , /, (, )}. Dene arithmetic expressions, denoted AE, as follows. 1. Any number (positive, negative, or zero) is in AE 2. x, y AE : (b) x AE (provided that x does not already start with ) (d) x y AE (if the rst symbol of y is not + or ) (e) x y AE (c) x + y AE (if the rst symbol of y is not + or ) (a) (x) AE

10

(g) x y AE (our notation for exponentiation) This denition says nothing about the value or meaning of such an expression. What do we want 3 3 3 to mean?

(f) x/y AE

11

Let Letter = {a, A, b, B, ..., z, Z}. Let Digit = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. Let = Letter Digit { , $ }. Dene Identif ier = Letter .

12

- Lecture 02Uploaded bymanikandarajan_gr
- Procedural Floor CreationUploaded bykukuduxu
- 20110913140929_MTK 2013 (RI) SEM 1 1011-1Uploaded byMargo Bell
- or assignment 6Uploaded byapi-323462816
- 111Uploaded bylycaphe8x
- A Classification of Viruses Through Recursion TheoremsUploaded byLuiz Corleone
- languageUploaded byKamoKamo
- funciones en c++Uploaded byClaudia Fuentes Ortiz
- Logic and Discrete MathematicsUploaded byafhaal01
- Test Bank Landmarks in Humanity 3rd EditionUploaded byRichard1Lauritsen
- Starting Out With Java From Control Structures Through Data Structures 2nd Edition Gaddis Test BankUploaded bycedaw
- The Fibonacci Rabbit Sequence - The Golden StringUploaded byCeiba Groove
- 16 Recursive Backtracking[1]Uploaded byJun Zhang
- Pub Bickerton on ChomskyUploaded byVanesa Condito
- jhtp7_SSM_15.pdfUploaded bysfddsfdsf
- Questions and Answers About Proof by InductionUploaded byJulio José
- The Strange the Estate DossiersUploaded byVernonWilliamReich
- Handout CS F222 2018Uploaded byTussank Gupta
- A course in machine learningUploaded byfoo goest
- CSE101-Lec#15.pptx.pptUploaded byDebatulya Mandal
- The Primitive Recursive FunctionsUploaded byWaldo Gómez Alvarez
- Single Riffle Shuffle Interview CakeUploaded byjc
- On the Coding of a Turing Machines and Non - Recursive LanguagesUploaded byEditor IJRITCC
- triumph and tragedy lessonsUploaded byapi-394725139
- pset3Uploaded byZhichaoWang
- rekursif.pdfUploaded byady
- NotesUploaded byAnkur Batta
- Vb-Notes.docUploaded byKritika Mishra
- Assignment 1 FrontsheetUploaded byChấn Nguyễn
- 06 ProceduresUploaded bySmith José Solis Bermudez

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.