Recursively Enumerable and Recursive. Languages

Similar documents
CSCI FOUNDATIONS OF COMPUTER SCIENCE

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

CSC 473 Automata, Grammars & Languages 11/9/10

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Automata and Languages

This lecture covers Chapter 8 of HMU: Properties of CFLs

Deterministic Finite-State Automata

Non-Deterministic Finite Automata

Non Deterministic Automata. Formal Languages and Automata - Yonsei CS 1

CS375: Logic and Theory of Computing

First Midterm Examination

Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir

Theory of Computation Regular Languages

Decidability. Models of Computation 1

First Midterm Examination

Nondeterminism and Nodeterministic Automata

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Minimal DFA. minimal DFA for L starting from any other

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Lecture 6 Regular Grammars

State Minimization for DFAs

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15

CS375: Logic and Theory of Computing

Formal languages, automata, and theory of computation

CS 275 Automata and Formal Language Theory

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power

SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 2014

Homework Solution - Set 5 Due: Friday 10/03/08

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

Regular expressions, Finite Automata, transition graphs are all the same!!

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science

I. Theory of Automata II. Theory of Formal Languages III. Theory of Turing Machines

Worked out examples Finite Automata

Chapter 2 Finite Automata

Finite-State Automata: Recap

1.4 Nonregular Languages

Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1

Homework 3 Solutions

Let's start with an example:

Turing Machines Part One

Convert the NFA into DFA

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

More on automata. Michael George. March 24 April 7, 2014

Normal Forms for Context-free Grammars

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

Turing Machines Part One

Designing finite automata II

Harvard University Computer Science 121 Midterm October 23, 2012

CS 330 Formal Methods and Models

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

CISC 4090 Theory of Computation

Lexical Analysis Finite Automate

Non-deterministic Finite Automata

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

Formal Languages Simplifications of CFGs

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15

Finite Automata-cont d

Some Theory of Computation Exercises Week 1

CS5371 Theory of Computation. Lecture 20: Complexity V (Polynomial-Time Reducibility)

Myhill-Nerode Theorem

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation

E 1 (n) = E 0 (n-1) E 0 (n) = E 0 (n-1)+e 0 (n-2) T(n -1)=2E 0 (n-2) + E 0 (n-3)

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

Streamed Validation of XML Documents

1.3 Regular Expressions

Non-deterministic Finite Automata

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Lecture 08: Feb. 08, 2019

Math 4310 Solutions to homework 1 Due 9/1/16

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

GNFA GNFA GNFA GNFA GNFA

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

1 Nondeterministic Finite Automata

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa

CS 330 Formal Methods and Models

1 From NFA to regular expression

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

Name Ima Sample ASU ID

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Fundamentals of Computer Science

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff

TM M ... TM M. right half left half # # ...

1 Structural induction

Transcription:

Recursively Enumerble nd Recursive nguges 1

Recll Definition (clss 19.pdf) Definition 10.4, inz, 6 th, pge 279 et S be set of strings. An enumertion procedure for Turing Mchine tht genertes ll strings of S one by one S is nd ech string is generted in finite time. 2

Definition: A lnguge is recursively enumerble if some Turing mchine ccepts it 3

et nd M be recursively enumerble lnguge the Turing Mchine tht ccepts it w For string : if w then M hlts in finl stte w if then hlts in non-finl stte M or loops forever 4

Definition (11.2, pge 287): A lnguge is recursive if some Turing mchine ccepts it nd hlts on ny input string In other words: A recursive lnguge hs membership lgorithm. 5

et nd M be recursive lnguge the Turing Mchine tht ccepts it is recursive lnguge if there is Turing Mchine M such tht w For ny string : if w then M hlts in finl stte w if then hlts in non-finl stte M 6

We will prove: 1. There is specific lnguge which is not recursively enumerble (not ccepted by ny Turing Mchine) 2. There is specific lnguge which is recursively enumerble but not recursive 7

Non Recursively Enumerble Recursively Enumerble Recursive 8

We will first prove: If lnguge is recursive then there is n enumertion procedure for it A lnguge is recursively enumerble if nd only if there is n enumertion procedure for it 9

Theorem: if lnguge is recursive then there is n enumertion procedure for it 10

Proof: Enumertion Mchine M ~ M Enumertes ll strings of input lphbet Accepts 11

If the lphbet is M ~ then {, b} cn enumerte strings s follows: b b b bb b... 12

Enumertion procedure Repet: M ~ genertes string w M checks if w YES: print to output w NO: ignore w End of Proof 13

Exmple: { b, b, bb,,...} M ~ (M ) Enumertion Output b b b b b b b bb b... bb... bb... 14

Theorem: if lnguge is recursively enumerble then there is n enumertion procedure for it 15

Proof: Enumertion Mchine M ~ M Enumertes ll strings of input lphbet Accepts 16

If the lphbet is M ~ then {, b} cn enumerte strings s follows: b b b bb b 17

NAIVE APPROACH Enumertion procedure Repet: M ~ genertes string w M checks if w YES: print to output w NO: ignore w Problem: If w mchine M my loop forever 18

BETTER APPROACH M ~ Genertes first string w 1 M executes first step on w 1 M ~ Genertes second string w2 M executes first step on second step on w 2 w 1 19

M ~ Genertes third string w3 M executes first step on w3 second step on third step on w 2 w 1 And so on... 20

w1 w2 w3 w4 1 1 1 1 Step in string 2 2 2 2 3 3 3 3 21

If for ny string w i the mchine M hlts in finl stte, then it prints w i on the output End of Proof 22

Theorem: If for lnguge there is n enumertion procedure, then is recursively enumerble 23

Proof: Input Tpe w Mchine tht ccepts Enumertor for Compre 24

Turing mchine tht ccepts For input string w Repet: Using the enumertor, generte the next string of Compre generted string with w If sme, ccept nd exit loop End of Proof 25

We hve proven: A lnguge is recursively enumerble if nd only if there is n enumertion procedure for it 26

A nguge which is not Recursively Enumerble 27

We wnt to find lnguge tht is not Recursively Enumerble This lnguge is not ccepted by ny Turing Mchine 28

Consider lphbet {} Strings:,,,, 1 2 3 4 29

Consider Turing Mchines tht ccept lnguges over lphbet {} They re countble: M1, M 2, M3, M 4, 30

Exmple lnguge ccepted by M i ( Mi ) {,, } ( Mi ) { 2, 4, 6 } Alterntive representtion 1 2 3 4 5 6 7 ( Mi ) 0 1 1 1 0 0 0 31

1 2 3 4 ( M1 ) ( M2 ) ( M3 ) 0 1 0 1 1 0 0 1 0 1 1 1 ( M4 ) 0 0 0 1 32

Consider the lnguge i i { : ( Mi )} consists from the 1 s in the digonl 33

1 2 3 4 ( M1 ) ( M2 ) ( M3 ) 0 1 0 1 1 0 0 1 0 1 1 1 ( M4 ) 0 0 0 1 { 3, 4, } 34

Consider the lnguge i i { : ( Mi )} i i { : ( Mi )} consists from the 0 s in the digonl 35

1 2 3 4 ( M1 ) ( M2 ) ( M3 ) 0 1 0 1 1 0 0 1 0 1 1 1 ( M4 ) 0 0 0 1 { 1, 2, } 36

Theorem: nguge is not recursively enumerble 37

Proof: Assume for contrdiction tht is recursively enumerble There must exist some mchine tht ccepts M k ( M k ) 38

1 2 3 4 ( M1 ) ( M2 ) ( M3 ) 0 1 0 1 1 0 0 1 0 1 1 1 ( M4 ) 0 0 0 1 Question: M k M 1? 39

1 2 3 4 ( M1 ) ( M2 ) ( M3 ) 0 1 0 1 1 0 0 1 0 1 1 1 ( M4 ) 0 0 0 1 Answer: M k M1 1 1 ( M ( M k 1 ) ) 40

1 2 3 4 ( M1 ) ( M2 ) ( M3 ) 0 1 0 1 1 0 0 1 0 1 1 1 ( M4 ) 0 0 0 1 Question: M k M 2? 41

1 2 3 4 ( M1 ) ( M2 ) ( M3 ) 0 1 0 1 1 0 0 1 0 1 1 1 ( M4 ) 0 0 0 1 Answer: M k M2 2 2 ( M ( M k 2 ) ) 42

1 2 3 4 ( M1 ) ( M2 ) ( M3 ) 0 1 0 1 1 0 0 1 0 1 1 1 ( M4 ) 0 0 0 1 Question: M k M 3? 43

1 2 3 4 ( M1 ) ( M2 ) ( M3 ) 0 1 0 1 1 0 0 1 0 1 1 1 ( M4 ) 0 0 0 1 Answer: M k M3 3 3 ( M ( M k 3 ) ) 44

Similrly: M k M i for ny i Becuse either: i i ( M ( M k i ) ) or i i ( M ( M k i ) ) 45

Therefore, the mchine M k cnnot exist Therefore, the lnguge recursively enumerble is not End of Proof 46

Observtion: There is no lgorithm tht describes (otherwise some Turing Mchine) would be ccepted by 47

Non Recursively Enumerble Recursively Enumerble Recursive 48

A nguge which is Recursively Enumerble nd not Recursive 49

We wnt to find lnguge which Is recursively enumerble But not recursive There is Turing Mchine tht ccepts the lnguge The mchine doesn t hlt on some input 50

We will prove tht the lnguge i i { : ( Mi )} Is recursively enumerble but not recursive 51

1 2 3 4 ( M1 ) ( M2 ) ( M3 ) 0 1 0 1 1 0 0 1 0 1 1 1 ( M4 ) 0 0 0 1 { 3, 4, } 52

Theorem: The lnguge i i { : ( Mi )} is recursively enumerble 53

Proof: We will give Turing Mchine tht ccepts 54

Turing Mchine tht ccepts For ny input string w Compute, for which i i w Find Turing mchine M (using the enumertion procedure for Turing Mchines) i Simulte M i on input i If M i ccepts, then ccept w End of Proof 55

Observtion: Recursively enumerble i i { : ( Mi )} Not recursively enumerble i i { : ( Mi )} (Thus, lso not recursive) 56

Theorem: i i { i The lnguge : ( M )} is not recursive 57

Proof: Assume for contrdiction tht is recursive Then is recursive: Tke the Turing Mchine M tht ccepts M hlts on ny input: If If M M ccepts then reject rejects then ccept 58

Therefore: is recursive But we know: is not recursively enumerble thus, not recursive CONTRADICTION!!!! 59

Therefore, is not recursive End of Proof 60

Non Recursively Enumerble Recursively Enumerble Recursive 61