# Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.

## Presentation on theme: "Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also."— Presentation transcript:

Prof. Busch - LSU1 Decidable Languages

Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also known as: Turing-Recognizable or Recursively-enumerable languages

Prof. Busch - LSU3 For any string : halts in an accept state halts in a non-accept state or loops forever

Prof. Busch - LSU4 Definition: A language is decidable if there is a Turing machine (decider) which accepts and halts on every input string Also known as recursive languages

Prof. Busch - LSU5 For any string : halts in an accept state halts in a non-accept state Every decidable language is Turing-Acceptable

Prof. Busch - LSU6 Sometimes, it is convenient to have Turing machines with single accept and reject states These are the only halting states That result to possible halting configurations

Prof. Busch - LSU7 We can convert any Turing machine to have single accept and reject states Old machine New machine Multiple accept states For each tape symbol One accept state

Prof. Busch - LSU8 For all tape symbols not used for read in the other transitions of Old machine New machine Multiple reject states One reject state Do the following for each possible halting state: For each

Prof. Busch - LSU9 Input string Accept Reject Decider for Decision On Halt: For a decidable language : For each input string, the computation halts in the accept or reject state

Prof. Busch - LSU10 Input string Turing Machine for For a Turing-Acceptable language : It is possible that for some input string the machine enters an infinite loop

Prof. Busch - LSU11 Is number prime? Corresponding language: Problem: We will show it is decidable

Prof. Busch - LSU12 On input number : Divide with all possible numbers between and If any of them divides Then reject Else accept Decider for :

Prof. Busch - LSU13 (Input string) is prime? Decider for PRIMES Input number YES NO the decider for the language solves the corresponding problem (Accept) (Reject)

Prof. Busch - LSU14 Theorem: If a language is decidable, then its complement is decidable too Proof: Build a Turing machine that accepts and halts on every input string ( is decider for )

Prof. Busch - LSU15 Transform accept state to reject and vice-versa

Prof. Busch - LSU16 Accepts and halts on every input string 1. Let be the decider for If accepts then reject If rejects then accept Turing Machine On each input string do: 2. Run with input string END OF PROOF

Prof. Busch - LSU17 Undecidable Languages An undecidable language has no decider: There is a language which is Turing-Acceptable and undecidable We will show that: each Turing machine that accepts does not halt on some input string

Prof. Busch - LSU18 We will prove that there is a language : is not Turing-acceptable (not accepted by any Turing Machine) is Turing-acceptable Therefore, is undecidable the complement of a decidable language is decidable

Prof. Busch - LSU19 Decidable Turing-Acceptable Non Turing-Acceptable

Prof. Busch - LSU20 A Language which is not Turing Acceptable

Prof. Busch - LSU21 Consider alphabet Strings of :

Prof. Busch - LSU22 Consider Turing Machines that accept languages over alphabet They are countable: (There is an enumerator that generates them)

Prof. Busch - LSU23 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

Prof. Busch - LSU24 Example language accepted by Binary representation

Prof. Busch - LSU25 Example of binary representations

Prof. Busch - LSU26 Consider the language consists of the 1’s in the diagonal

Prof. Busch - LSU27

Prof. Busch - LSU28 Consider the language consists of the 0’s in the diagonal

Prof. Busch - LSU29

Prof. Busch - LSU30 Proof: is Turing-Acceptable Assume for contradiction that There must exist some machine that accepts : Theorem: Language is not Turing-Acceptable

Prof. Busch - LSU31 Question:

Prof. Busch - LSU33 Question:

Prof. Busch - LSU35 Question:

Prof. Busch - LSU37 Similarly: for any Because either: or the machine cannot exist is not Turing-Acceptable End of Proof

Prof. Busch - LSU38 Decidable Turing-Acceptable Non Turing-Acceptable

Prof. Busch - LSU39 A Language which is Turing-Acceptable and Undecidable

Prof. Busch - LSU40 There is a Turing machine that accepts Each machine that accepts doesn’t halt on some input string Is Turing- Acceptable Undecidable We will prove that the language

Prof. Busch - LSU41

Prof. Busch - LSU42 The languageTheorem: Is Turing-Acceptable Proof: We will give a Turing Machine that accepts

Prof. Busch - LSU43 Turing Machine that accepts For any input string Compute, for which Find Turing machine (using the enumerator for Turing Machines) Simulate on input If accepts, then accept End of Proof

Prof. Busch - LSU44 Observation: Turing-Acceptable Not Turing-acceptable (Thus, is undecidable)

Prof. Busch - LSU45 Decidable Turing-Acceptable Non Turing-Acceptable ?

Prof. Busch - LSU46 Theorem: is undecidable Proof: If is decidable Then is decidable Contradiction!!!! However, is not Turing-Acceptable! the complement of a decidable language is decidable

Prof. Busch - LSU47 Decidable Turing-Acceptable Not Turing-Acceptable

Prof. Busch - LSU48 Turing acceptable languages and Enumerators

Prof. Busch - LSU49 We will prove: If a language is decidable then there is an enumerator for it A language is Turing-acceptable if and only if there is an enumerator for it (weak result) (strong result)

Prof. Busch - LSU50 Theorem: if a language is decidable then there is an enumerator for it Proof: Let be the decider for Use to build the enumerator for

Prof. Busch - LSU51 Example: alphabet is (proper order) Let be an enumerator that prints all strings from input alphabet in proper order

Prof. Busch - LSU52 Enumerator for Repeat: 1. generates a string 2. checks if YES: print to output NO: ignore This part terminates, because is decidable

Prof. Busch - LSU53 Enumerator 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

Prof. Busch - LSU54 Example: Enumeration Output reject accept reject END OF PROOF

Prof. Busch - LSU55 Theorem: if language is Turing-Acceptable then there is an enumerator for it Proof: Let be the Turing machine that accepts Use to build the enumerator for

Prof. Busch - LSU56 Enumerator for Accepts Enumerates all strings of input alphabet in proper order

Prof. Busch - LSU57 Enumerator for Repeat:generates a string checks if YES: print to output NO: ignore NAIVE APPROACH Problem:If machine may loop forever

Prof. Busch - LSU58 executes first step on BETTER APPROACH Generates second string executes first step on second step on Generates first string

Prof. Busch - LSU59 Generates third string executes first step on second step on third step on And so on............

Prof. Busch - LSU60 1 Step in computation of string 111 22 22 3333 String: 4444

Prof. Busch - LSU61 If for any string machine halts in an accepting state then print on the output End of Proof

Prof. Busch - LSU62 Theorem: If for language there is an enumerator then is Turing-Acceptable Proof: Using the enumerator for we will build a Turing machine that accepts

Prof. Busch - LSU63 Input Tape Enumerator for Compare Turing Machine that accepts If same, Accept and Halt Give me the next string in the enumeration sequence

Prof. Busch - LSU64 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

Prof. Busch - LSU65 By combining the last two theorems, we have proven: A language is Turing-Acceptable if and only if there is an enumerator for it

Download ppt "Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also."

Similar presentations