Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.

Similar presentations


Presentation on theme: "Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages."— Presentation transcript:

1 Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages

2 Fall 2005Costas Busch - RPI2 Definition: A language is recursively enumerable if there is a Turing machine that accepts it Also known as: Turing Recognizable languages orTuring Acceptable languages

3 Fall 2005Costas Busch - RPI3 For any string : Let be a recursively enumerable language and the Turing Machine that accepts it ifthen halts in an accept state if then halts in a non-accept state or loops forever

4 Fall 2005Costas Busch - RPI4 Definition: A language is recursive if there is a Turing machine accepts it and the machine halts on every input string Also known as decidable languages

5 Fall 2005Costas Busch - RPI5 For any string : Let be a recursive language that accepts such that: ifthen halts in an accept state ifthen halts in a non-accept state Then there is a Turing machine

6 Fall 2005Costas Busch - RPI6 We will prove: 1. There is a specific language which is not recursively enumerable (not accepted by any Turing Machine) 2. There is a specific language which is recursively enumerable but not recursive

7 Fall 2005Costas Busch - RPI7 Recursive Recursively Enumerable Non Recursively Enumerable

8 Fall 2005Costas Busch - RPI8 A Language which is not Recursively Enumerable

9 Fall 2005Costas Busch - RPI9 Consider alphabet Strings:

10 Fall 2005Costas Busch - RPI10 Consider Turing Machines that accept languages over alphabet They are countable: (There is an enumeration procedure that generates them)

11 Fall 2005Costas Busch - RPI11 Each machine accepts some language over Note that it is possible to have Since, a language could be accepted by more than one Turing machine for

12 Fall 2005Costas Busch - RPI12 Example language accepted by Binary representation

13 Fall 2005Costas Busch - RPI13 Example of binary representations

14 Fall 2005Costas Busch - RPI14 Consider the language consists of the 1’s in the diagonal

15 Fall 2005Costas Busch - RPI15

16 Fall 2005Costas Busch - RPI16 Consider the language consists of the 0’s in the diagonal

17 Fall 2005Costas Busch - RPI17

18 Fall 2005Costas Busch - RPI18 Proof: is recursively enumerable Assume for contradiction that There must exist some machine that accepts : Theorem: Language is not recursively enumerable

19 Fall 2005Costas Busch - RPI19 Question:

20 Fall 2005Costas Busch - RPI20 Answer:

21 Fall 2005Costas Busch - RPI21 Question:

22 Fall 2005Costas Busch - RPI22 Answer:

23 Fall 2005Costas Busch - RPI23 Question:

24 Fall 2005Costas Busch - RPI24 Answer:

25 Fall 2005Costas Busch - RPI25 Similarly: for any Because either: or the machine cannot exist is not recursively enumerable End of Proof

26 Fall 2005Costas Busch - RPI26 Recursive Recursively Enumerable Non Recursively Enumerable

27 Fall 2005Costas Busch - RPI27 A Language which is Recursively Enumerable and not Recursive

28 Fall 2005Costas Busch - RPI28 There is a Turing Machine that accepts Every machine that accepts doesn’t halt on some input string Is recursively enumerable But not recursive We will prove that the language

29 Fall 2005Costas Busch - RPI29

30 Fall 2005Costas Busch - RPI30 The languageTheorem: is recursively enumerable Proof: We will give a Turing Machine that accepts

31 Fall 2005Costas Busch - RPI31 Turing Machine that accepts For any input string Compute, for which Find Turing machine (using the enumeration procedure for Turing Machines) Simulate on input If accepts, then accept End of Proof

32 Fall 2005Costas Busch - RPI32 Observation: Recursively enumerable Not recursively enumerable (Thus, is not recursive either)

33 Fall 2005Costas Busch - RPI33 Theorem: If a language is recursive, then its complement is recursive too Proof: Build a Turing machine that accepts and halts on every input

34 Fall 2005Costas Busch - RPI34 (accepts and halts on every input string) 1. Let be the Turing machine that accepts and halts on every input string If accepts then reject If rejects then accept Turing Machine On any input string do: 2. Run with input string

35 Fall 2005Costas Busch - RPI35 For all tape symbols not read in the other transitions of Transform to END OF PROOF

36 Fall 2005Costas Busch - RPI36 Theorem: is not a recursive language Proof: If is recursive Then is recursive The complement of a recursive language is recursive Contradiction!!!! However, is not Turing acceptable!

37 Fall 2005Costas Busch - RPI37 Recursive Recursively Enumerable Non Recursively Enumerable

38 Fall 2005Costas Busch - RPI38 Turing acceptable languages and Enumeration Procedures

39 Fall 2005Costas Busch - RPI39 We will 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 (weak result) (strong result)

40 Fall 2005Costas Busch - RPI40 Theorem: if a language is recursive then there is an enumeration procedure for it Proof: Let be the Turing machine that accepts and halts on every input Use to build the enumeration procedure for

41 Fall 2005Costas Busch - RPI41 Example: alphabet is (proper order) Let be an enumerator that prints all strings from input alphabet in proper order

42 Fall 2005Costas Busch - RPI42 Enumeration procedure for Repeat: generates a string checks if YES: print to output NO: ignore This part terminates, because is recursive

43 Fall 2005Costas Busch - RPI43 Enumeration Machine for string Give me next string Enumerates all strings of input alphabet Generates all Strings in alphabet If accepts then print to output Tests each string if it is accepted by output All strings of

44 Fall 2005Costas Busch - RPI44 Example: Enumeration Output reject accept reject END OF PROOF

45 Fall 2005Costas Busch - RPI45 Theorem: if language is recursively enumerable then there is an enumeration procedure for it Proof: Let be the Turing machine that accepts Use to build the enumeration procedure for

46 Fall 2005Costas Busch - RPI46 Enumeration Machine for Accepts Enumerates all strings of input alphabet in proper order

47 Fall 2005Costas Busch - RPI47 Enumeration procedure for Repeat:generates a string checks if YES: print to output NO: ignore NAIVE APPROACH Problem: If machine may loop forever

48 Fall 2005Costas Busch - RPI48 executes first step on BETTER APPROACH Generates second string executes first step on second step on Generates first string

49 Fall 2005Costas Busch - RPI49 Generates third string executes first step on second step on third step on And so on............

50 Fall 2005Costas Busch - RPI50 1 Step in computation of string 111 22 22 3333 String: 4444

51 Fall 2005Costas Busch - RPI51 If for any string machine halts in an accepting state then it prints on the output End of Proof

52 Fall 2005Costas Busch - RPI52 Theorem: If for language there is an enumeration procedure then is recursively enumerable Proof: Using the enumerator for we will build a Turing machine that accepts

53 Fall 2005Costas Busch - RPI53 Input Tape Enumerator for Compare Turing Machine that accepts If same, Accept and Halt Give me the next string in the enumeration sequence

54 Fall 2005Costas Busch - RPI54 Turing machine that accepts Loop: Using the enumerator of, generate the next string of For any input string Compare generated string with If same, accept and exit loop End of Proof

55 Fall 2005Costas Busch - RPI55 By Combining the last two theorems, we have proven: A language is recursively enumerable if and only if there is an enumeration procedure for it


Download ppt "Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages."

Similar presentations


Ads by Google