1 uncountable sets continued.... 2 theorem: let be an infinite countable set. the powerset of is...

61
1 Uncountable Sets continued...

Post on 20-Dec-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

1

Uncountable Sets

continued...

2

Theorem:

Let be an infinite countable set.

The powerset of is uncountable S2 S

S

3

Application: Languages

Example Alphabet : },{ ba

Set of Strings:

},,,,,,,,,{},{ * aabaaabbbaabaababaS infinite and countable

Powerset: all languages

}},,,}{,{},{},{{2 aababaabaaS 1L 2L 3L 4L

uncountable

4

Languages: Uncountable

Turing machines: Countable

1L 2L 3L kL

1M 2M 3M

?

There are infinitely many more languagesthan Turing Machines

5

There are some languages not acceptedby Turing Machines

These languages cannot be describedby algorithms

6

Recursively Enumerable Languages

and Recursive Languages

7

Definition:

A language is recursively enumerableif some Turing machine accepts it

8

For string :

Let be a recursively enumerable languageL

and be the Turing Machine that accepts itM

Lw

w

if then halts in a final state M

Lwif then halts in some stateM

or loops forever

9

Definition:

A language is recursiveif some Turing machine accepts itand halts on any input string

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

10

For string :

Let be a recursive languageL

and be the Turing Machine that accepts itM

Lw

w

if then halts in a final state M

Lwif then halts in a non-final stateM

11

We will prove:

1. There is a specific language which is not recursively enumerable

2. There is a specific language which is recursively enumerable but not recursive

12

Recursive

Recursively Enumerable

Non Recursively Enumerable

13

First we prove:

• If a language is recursive then there is an enumeration procedure for it

• A language is recursively enumerable if and only if there is an enumeration procedure for it

14

Theorem:

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

L

15

Proof:

MM~

Enumeration Machine

Accepts LEnumerates allstrings of input alphabet

16

Enumeration procedure

Repeat:

M~ generates a string

M

w

checks if Lw

YES: print to output w

NO: ignore w

End of proof

17

Theorem:

if language is recursively enumerable thenthere is an enumeration procedure for it

L

18

Proof:

MM~

Enumeration Machine

Accepts LEnumerates allstrings of input alphabet

19

Enumeration procedure

Repeat: M~ generates a string

M

w

checks if Lw

YES: print to output w

NO: ignore w

NAIVE APPROACH

Problem:If machine may loop forever

LwM

20

M~

M

1w

executes first step on

BETTER APPROACH

1w

M~ Generates second string 2w

M executes first step on 2w

second step on 1w

Generates first string

21

M~ Generates third string 3w

M executes first step on 3w

second step on 2w

third step on 1w

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

22

1w 2w 3w 4w

1

Move

2

3

23

If for string machine halts in a final statethen it prints on the output

Mw

w

End of proof

24

Theorem:

If for language there is an enumeration procedurethen is recursively enumerable

L

L

25

Proof:

w

Input Tape

Enumeratorfor L

Compare

Machine that accepts L

26

Turing machine that accepts L

Repeat:

• Using the enumerator, generate the next string ofL

For input string w

• Compare generated string with w

If same, accept and exit loop

End of proof

27

This is not a membership algorithm.Why?

Question:

Answer:

The enumeration procedure may not produce strings in proper order

28

We have proven:

A language is recursively enumerable if and only if there is an enumeration procedure for it

29

A Language which is not

Recursively Enumerable

30

We want to find a language thatis not Recursively Enumerable

This language is not accepted by anyTuring Machine

31

Consider alphabet }{a

Strings: ,,,, aaaaaaaaaa

1a 2a 3a 4a

32

Consider Turing Machinesthat accept languages over alphabet }{a

They are countable:

,,,, 4321 MMMM

33

Example language accepted by

},,{)( aaaaaaaaaaaaML i

},,{)( 642 aaaML i

iM

Alternative representation

1a 2a 3a 4a 5a 6a 7a

)( iML

0 1 1 10 0 0

34

1a 2a 3a 4a

)( 1ML

0 1 10

)( 2ML

)( 3ML

01 0 1

0 1 11

)( 4ML 0 10 0

35

Consider the language

)}(:{ iii MLaaL

L consists from the 1’s in the diagonal

36

1a 2a 3a 4a

)( 1ML

0 1 10

)( 2ML

)( 3ML

01 0 1

0 1 11

)( 4ML 0 10 0

},,{ 43 aaL

37

Consider the language

)}(:{ iii MLaaL

L consists from the 0’s in the diagonal

)}(:{ iii MLaaL

L

38

1a 2a 3a 4a

)( 1ML

0 1 10

)( 2ML

)( 3ML

01 0 1

0 1 11

)( 4ML 0 10 0

},,{ 21 aaL

39

Theorem:

Language is not recursively enumerableL

40

Proof:

is recursively enumerableL

Assume for contradiction that

There must exist some machinethat accepts

kM

L

LML k )(

41

1a 2a 3a 4a

)( 1ML

0 1 10

)( 2ML

)( 3ML

01 0 1

0 1 11

)( 4ML 0 10 0

Question: ?1MMk

42

1a 2a 3a 4a

)( 1ML

0 1 10

)( 2ML

)( 3ML

01 0 1

0 1 11

)( 4ML 0 10 0

Answer: 1MMk )(

)(

11

1

MLa

MLa k

43

1a 2a 3a 4a

)( 1ML

0 1 10

)( 2ML

)( 3ML

01 0 1

0 1 11

)( 4ML 0 10 0

Question: ?2MMk

44

1a 2a 3a 4a

)( 1ML

0 1 10

)( 2ML

)( 3ML

01 0 1

0 1 11

)( 4ML 0 10 0

Answer: 2MMk )(

)(

22

2

MLa

MLa k

45

1a 2a 3a 4a

)( 1ML

0 1 10

)( 2ML

)( 3ML

01 0 1

0 1 11

)( 4ML 0 10 0

Question: ?3MMk

46

1a 2a 3a 4a

)( 1ML

0 1 10

)( 2ML

)( 3ML

01 0 1

0 1 11

)( 4ML 0 10 0

Answer: 3MMk )(

)(

33

3

MLa

MLa k

47

Similarly: ik MM

)(

)(

ii

ki

MLa

MLa

)(

)(

ii

ki

MLa

MLa

for any i

Because either:

or

48

Therefore the machine cannot exist kM

CONTRADICTION!!!

Therefore the languageis not recursively enumerable

L

End of proof

49

Observation:

There is no algorithm thatdescribes L

(otherwise it would be accepted by a Turing Machine)

50

A Language which is Recursively Enumerable

and not Recursive

51

We want to find a language which

There is a Turing Machine that accepts the language

The machinedoesn’tnecessarily halt on any input

Is recursively enumerable

But notrecursive

52

We will prove that the language

)}(:{ iii MLaaL

Is recursively enumerablebut not recursive

53

The language

Theorem:

)}(:{ iii MLaaL

is recursively enumerable

54

Proof:

We will give a Turing Machine thataccepts L

55

Turing Machine that accepts L

For any input string w

• Write iaw• Find Turing machine iM

(using the enumeration procedure for Turing Machines)

• Simulate on inputiMia

• If accepts, then accept iM w

End of proof

56

Observation:

)}(:{ iii MLaaL

)}(:{ iii MLaaL

Recursively enumerable

Not recursively enumerable

(Thus, not recursive)

57

Theorem:

The language )}(:{ iii MLaaL

is not recursive

58

Proof:

Assume for contradiction that is recursive

Then is recursive:

L

L

Take the Turing Machine that accepts M L

halts on any inputM

If accepts then rejectIf rejects then accept

MM

59

Therefore:

L recursive

But we know:

Lnot recursively enumerable

thus, not recursive

CONTRADICTION!!!!

60

Therefore, is not recursiveL

End of proof

61

Recursive

Recursively Enumerable

Non Recursively EnumerableL

L