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