Você está na página 1de 10

Definition:

A language is recursively enumerable


if some Turing machine accepts it

Recursively Enumerable
and
Recursive
Languages

Let

be a recursively enumerable language

and

the Turing Machine that accepts it

For string

Definition:
A language is recursive
if some Turing machine accepts it
and halts on any input string

w:

if

w L

then

halts in a final state

if

w L

then

halts in a non-final state


or loops forever

In other words:
A language is recursive if there is
a membership algorithm for it

Let

be a recursive language

and

the Turing Machine that accepts it

For string

We will prove:
1. There is a specific language
which is not recursively enumerable
(not accepted by any Turing Machine)

w:

if

w L

then

halts in a final state

if

w L

then

halts in a non-final state

2. There is a specific language


which is recursively enumerable
but not recursive

1
PDF created with pdfFactory Pro trial version www.pdffactory.com

We will first prove:

Non Recursively Enumerable

If a language is recursive then


there is an enumeration procedure for it

Recursively Enumerable

Recursive

A language is recursively enumerable


if and only if
there is an enumeration procedure for it
7

Proof:

Theorem:
if a language L is recursive then
there is an enumeration procedure for it

Enumeration Machine

~
M

Enumerates all
strings of input alphabet

Accepts

L
10

Enumeration procedure

If the alphabet is {a , b} then


~
M can enumerate strings as follows:

Repeat:

a
b
aa
ab
ba
bb
aaa
aab

~
M generates a string w

checks if

w L

YES: print
NO:

......
11

ignore

End of Proof

w to output

12

2
PDF created with pdfFactory Pro trial version www.pdffactory.com

Theorem:

L = {b, ab, bb, aaa,....}

Example:

~
M

Enumeration
Output

L (M )

a
b
aa
ab
ba
bb
aaa
aab
......

ab

ab

bb
aaa

bb
aaa

......

......

if language L is recursively enumerable then


there is an enumeration procedure for it

13

Proof:

If the alphabet is {a , b} then


~
M can enumerate strings as follows:

Enumeration Machine

~
M

14

a
b
aa
ab
ba
bb
aaa
aab

Enumerates all
strings of input alphabet

Accepts L
15

16

NAIVE APPROACH

BETTER APPROACH

Enumeration procedure
Repeat:

~
M

generates a string

checks if

~
M Generates first string w1

w L

YES: print
NO:

w to output
ignore w

may loop forever

w1

~
M Generates second string w2

M
Problem: If w L
machine M

executes first step on

17

executes first step on

w2

second step on

w1
18

3
PDF created with pdfFactory Pro trial version www.pdffactory.com

~
M Generates third string w3

executes first step on

w3

second step on

w2

third step on

w1

Step
in
string

And so on............
19

w1

w2

w3

w4

20

Theorem:
If for language L
there is an enumeration procedure
then L is recursively enumerable

If for any string wi


machine M halts in a final state
then it prints wi on the output

End of Proof

Proof:

21

Turing machine that accepts

Input Tape

For input string

Repeat:

Machine that
accepts L
Enumerator
for L

22

Using the enumerator,


generate the next string of

Compare generated string with

Compare

If same, accept and exit loop


23

End of Proof

24

4
PDF created with pdfFactory Pro trial version www.pdffactory.com

We have proven:
A language is recursively enumerable
if and only if
there is an enumeration procedure for it

A Language which
is not
Recursively Enumerable

25

We want to find a language that


is not Recursively Enumerable

26

Consider alphabet
Strings:

a, aa, aaa, aaaa,

a1 a 2

This language is not accepted by any


Turing Machine

{a}

a3

a4

27

Consider Turing Machines


that accept languages over alphabet

28

Example language accepted by M i

L ( M i ) = {aa, aaaa, aaaaaa}

{a}

L ( M i ) = {a 2 , a 4 , a 6 }

They are countable:

Alternative representation

M 1, M 2 , M 3 , M 4 ,

a1
L(M i ) 0
29

a2

a3

a4

a5

a6

a7

30

5
PDF created with pdfFactory Pro trial version www.pdffactory.com

a1

a2

a3

a4

L ( M 1)

L(M 2 )

L( M 3 )

L(M 4 )

Consider the language

L = {a i : a i L( M i )}

consists from the 1s in the diagonal

31

a1

a2

a3

a4

L ( M 1)

L(M 2 )

L( M 3 )

L(M 4 )

Consider the language

L = {a i : a i L( M i )}

a2

a3

a4

L ( M 1)

L(M 2 )

L( M 3 )

L(M 4 )

L = {a1 , a 2 , }

consists from the 0s in the diagonal

33

a1

L = {a i : a i L( M i )}

L = {a , a , }
3

32

34

Theorem:
Language

35

is not recursively enumerable

36

6
PDF created with pdfFactory Pro trial version www.pdffactory.com

a1

a2

a3

a4

L ( M 1)

L(M 2 )

L( M 3 )

L(M 4 )

Proof:
Assume for contradiction that

is recursively enumerable

There must exist some machine


that accepts L

Mk

Question: M k = M1 ?

L(M k ) = L

37

a1

a2

a3

a4

L ( M 1)

L(M 2 )

L( M 3 )

L(M 4 )

Answer:

a1

a2

a3

a4

L ( M 1)

L(M 2 )

L( M 3 )

L(M 4 )

a1 L ( M k )

M k M1

a1 L ( M 1)

a1

a2

a3

a4

L ( M 1)

L(M 2 )

L( M 3 )

L(M 4 )

Answer:

Mk M2

38

Question: M k = M 2 ?
39

40

a1

a2

a3

a4

L ( M 1)

L(M 2 )

L( M 3 )

L(M 4 )

a 2 L(M k )
a 2 L(M 2 )

Question: M k = M 3 ?
41

42

7
PDF created with pdfFactory Pro trial version www.pdffactory.com

a1

a2

a3

a4

L ( M 1)

L(M 2 )

L( M 3 )

L(M 4 )

Similarly:

a i L( M k )

a i L( M i )

a L(M k )

Mk M3

Therefore, the machine

a3 L ( M 3 )

Mk

for any

Because either:

Answer:

M k Mi

or

a i L( M k )
a i L( M i )

43

cannot exist

44

Observation:
There is no algorithm that describes

Therefore, the language L


is not recursively enumerable

(otherwise L would be accepted by


some Turing Machine)

End of Proof

45

46

Non Recursively Enumerable

A Language which is
Recursively Enumerable
and not Recursive

Recursively Enumerable

Recursive

47

48

8
PDF created with pdfFactory Pro trial version www.pdffactory.com

We will prove that the language

We want to find a language which


Is recursively
enumerable

L = {a i : a i L( M i )}

But not
recursive

There is a
Turing Machine
that accepts
the language

Is recursively enumerable
but not recursive

The machine
doesnt halt
on some input
49

a1

a2

a3

a4

L ( M 1)

L(M 2 )

L( M 3 )

L(M 4 )

L = {a 3 , a 4 , }

50

Theorem:
The language

L = {a i : a i L( M i )}

is recursively enumerable

51

52

Turing Machine that accepts

Proof:

For any input string

We will give a Turing Machine that


accepts L

Compute i , for which


Find Turing machine

w = ai

Mi

(using the enumeration procedure


for Turing Machines)

Simulate
If

Mi

53

Mi

on input

ai

accepts, then accept


End of Proof

w
54

9
PDF created with pdfFactory Pro trial version www.pdffactory.com

Theorem:

Observation:
Recursively enumerable
L = {a i : a i L( M i )}

The language

L = {a i : a i L( M i )}

is not recursive

Not recursively enumerable


L = {a i : a i L( M i )}
(Thus, also not recursive)
55

Proof:
Assume for contradiction that

L is recursive

56

Therefore:

L is recursive
Then

is recursive:

Take the Turing Machine

that accepts

But we know:

halts on any input:


If
If

M
M

L is not recursively enumerable


thus, not recursive

accepts then reject


rejects then accept

CONTRADICTION!!!!
57

58

Non Recursively Enumerable

L
Therefore,

is not recursive

Recursively Enumerable

L
Recursive

End of Proof

59

60

10
PDF created with pdfFactory Pro trial version www.pdffactory.com

Você também pode gostar