Presentation is loading. Please wait.

Presentation is loading. Please wait.

Decidability.

Similar presentations


Presentation on theme: "Decidability."— Presentation transcript:

1 Decidability

2 Decidable Languages Recall: A language is decidable (recursive),
if there is a Turing machine (decider) that accepts the language and halts on every input string Decision On Halt: Turing Machine Accept Input string Decider for Reject

3 Problem: Is number prime? Corresponding language:

4 Decider for : On input number : Divide with all possible numbers between and If any of them divides Then reject Else accept

5 Thus, PRIMES is decidable
We also say that the corresponding prime number problem is solvable: we can give an answer (positive or negative) for every input instance of the problem

6 the decider for the language solves the corresponding problem
Decider for PRIMES Accept YES (Accept) Input number is number prime? (Input string) NO Reject (Reject)

7 Corresponding Language:
Problem: Does DFA accept the empty language ? Corresponding Language: Description of DFA as a string (For example, we can represent as a binary string, as we did for Turing machines)

8 Decider for : On input : Determine whether there is a path from the initial state to any accepting state DFA DFA Decision: Accept Reject

9 Problem: Does DFA accept a finite language? Corresponding Language: Decidable language

10 Decider for : On input : Check if there is a walk with cycle from the initial state to an accepting state DFA DFA infinite finite Decision: Accept Reject

11 Problem: Does DFA accept string ? Corresponding Language: Decidable language

12 Decider for : On input string : Run DFA on input string If accepts Then accept (and halt) Else reject (and halt)

13 Problem: Do DFAs and accept the same language? Corresponding Language: Decidable language

14 Decider for : On input : Let be the language of DFA Construct DFA such that: (combination of DFAs)

15 and

16 or

17 Therefore, we only need to determine whether which is a solvable problem for DFAs:

18 Undecidable Languages
language is not decidable There is no decider for the language: there is no Turing Machine that reaches a decision (halts) for all input strings of the language (decision may be reached for some strings)

19 For an undecidable language, the corresponding problem is unsolvable:
there is no Turing Machine (Algorithm) that gives an answer (solves the problem) for all input instances of the problem (answer may be given for some input instances)

20 We have shown before that there are undecidable languages:
Turing recognizable Decidable is Turing recognizable but not decidable

21 We will prove that two particular problems
are unsolvable: Membership problem Halting problem

22 Membership Problem Input: Turing Machine String Question: Does accept ? Corresponding language:

23 We will assume that is decidable; We will then prove that
Theorem: is undecidable (The membership problem is unsolvable) Proof: Basic idea: We will assume that is decidable; We will then prove that every decidable language is also Turing recognizable A contradiction!

24 Suppose that is decidable
Input string Decider for accepts YES NO rejects

25 Let be a Turing recognizable language
Let be the Turing Machine that accepts We will prove that is also decidable: we will build a decider for

26 Decider for YES accept accepts ? NO reject Input string Decider for
(and halt) accepts ? NO reject Input string (and halt)

27 Since is chosen arbitrarily, every Turing recognizable language
Therefore, is decidable Since is chosen arbitrarily, every Turing recognizable language is also decidable But there are Turing recognizable languages which are not decidable Contradiction!!!! END OF PROOF

28 We have shown: Undecidable Decidable

29 We can actually show: Turing recognizable Decidable

30 is Turing recognizable
Turing machine that accepts : Run on input If accepts then accept

31 Halting Problem Input: Turing Machine String Question: Does halt while processing input string ? Corresponding language:

32 Suppose that is decidable; we will prove that every decidable language
Theorem: is undecidable (The halting problem is unsolvable) Proof: Basic idea: Suppose that is decidable; we will prove that every decidable language is also Turing recognizable A contradiction!

33 Suppose that is decidable
Input string halts on input YES Decider for NO doesn’t halt on input

34 Let be a Turing recognizable language
Let be the Turing Machine that accepts We will prove that is also decidable: we will build a decider for

35 Decider for NO reject halts on ? YES accept Run with input reject
and halt halts on ? YES Input string halts and accepts accept and halt Run with input halts and rejects reject and halt

36 Since is chosen arbitrarily, every Turing recognizable language
Therefore is decidable Since is chosen arbitrarily, every Turing recognizable language is also decidable But there are Turing recognizable languages which are not decidable Contradiction!!!! END OF PROOF

37 An alternative proof Theorem: is undecidable Proof: Basic idea:
(The halting problem is unsolvable) Proof: Basic idea: Assume for contradiction that the halting problem is decidable; we will obtain a contradiction using a diagonilization technique

38 Suppose that is decidable
Input string Decider for YES halts on NO doesn’t halt on

39 Looking inside Decider for YES Input string: halts on ? NO

40 Construct machine : Loop forever YES halts on ? NO If halts on input Then Loop Forever Else Halt

41 Construct machine : Copy on tape If halts on input Then loop forever Else halt

42 Then loops forever on input
Run with input itself Copy on tape If halts on input Then loops forever on input Else halts on input CONTRADICTION!!! END OF PROOF

43 We have shown: Undecidable Decidable

44 We can actually show: Turing recognizable Decidable

45 is Turing recognizable
Turing machine that accepts : Run on input If halts on then accept


Download ppt "Decidability."

Similar presentations


Ads by Google