Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computability and Complexity 5-1 Classifying Problems Computability and Complexity Andrei Bulatov.

Similar presentations


Presentation on theme: "Computability and Complexity 5-1 Classifying Problems Computability and Complexity Andrei Bulatov."— Presentation transcript:

1 Computability and Complexity 5-1 Classifying Problems Computability and Complexity Andrei Bulatov

2 Computability and Complexity 5-2 Problems and Languages We have seen that every decision problem  has an associated language L ( , e ) (via a suitable encoding e ) Hence, to classify decision problems we will develop methods to classify languages

3 Computability and Complexity 5-3 Decidable Languages Definition A language L is decidableª if there exists a TM T, with 2 final states and, such that If x  L then T(x) halts in state If x  L then T(x) halts in state ªalso known as recursive T is said to decide the language L — it gives a yes or no answer for each possible string from  *

4 Computability and Complexity 5-4 Examples The following languages are decidable:  *  {x| |x| = 20} {x | x is prime } {x | x encodes a graph G, and a Hamilton circuit of G} {x | x is a valid encoding of a TM}

5 Computability and Complexity 5-5 Examples All languages accepted by finite automata, or generated by context-free grammars are decidable All Languages Decidable Languages Context-free Languages Regular Languages (for finite automata see Discrete Mathematics course or Sipser) (for context-free grammars see Compilers course or Sipser)

6 Computability and Complexity 5-6 Acceptable Languages Definition A language L is acceptableª if there exists a TM T, with 2 final states and, such that If x  L then T(x) halts in state If x  L then T(x) halts in state or infinite ªalso known as Turing-acceptable or Turing-recognizable T is said to accept the language L — it gives a yes answer for each string in L, in all other cases it gives a no answer or fails to halt

7 Computability and Complexity 5-7 Acceptable vs. Decidable If a language is decidable, then it is acceptable. If a language, L, is acceptable, and its complement is also acceptable, the it is decidable. (Proof: run the two acceptor machines alternately until one halts) So, to show that there are languages that are not decidable, we must find a language that is not acceptable …

8 Computability and Complexity 5-8 The Halting Problem Instance: A Turing Machine T and an input string x. Question: Does T(x) halt? Halting Once we choose an encoding for Turing machines, the corresponding language is: is acceptable - use a universal TM U to simulate T on x and modify it so that that if it halts then it moves to “Accept” state is not decidable - see next slide

9 Computability and Complexity 5-9 Assume, for contradiction, that there is a TM that decides Construct a new T from so that for input x, T simulates but - if accepts “ x ; x ” then T goes into an infinite loop, - if rejects “ x ; x ” then T accepts x.

10 Computability and Complexity 5-10 INPUT A? R? T

11 I NPUTINPUT ; Computability and Complexity 5-11 INPUT A? R? T A?R?

12 Computability and Complexity 5-12 Consider the computation T(T) - if T(T) halts this implies that rejects “ T;T ”, implying that T(T) does not halt! - if T(T) does not halt this implies that accepts “ T;T ”, implying that T(T) halts! Hence cannot exist, so is undecidable.

13 Computability and Complexity 5-13 Consequences There is no Turing machine that can give correct answers to the Halting problem on all inputs. The language is not acceptable. Hence, by Turing’s Thesis: The Halting problem cannot be solved by any algorithm! This result was first announced in Turing’s 1936 paper

14 Computability and Complexity 5-14 Reducibility A major tool in analysing and classifying problems is the idea of “reducing one problem to another” Informally, a problem  is reducible to a problem  if we can somehow use methods that solve  in order to solve 

15 Computability and Complexity 5-15 Many-One Reducibility Definition A language A is many-one reducible (or m-reducible, or mapping reducible) to a language B if there exists a total and computable function f such that for all We can use a machine that decides B (plus a machine that reduces A ) So, in a sense, A is “no harder than” B We denote this by writing

16 Computability and Complexity 5-16 Properties of Many-One Reducibility If and is decidable, then so is (Just build a machine that computes f(x) and then behaves like the machine that decides ) is reflexive and transitive If is any language (apart from  and  *) and is decidable, then The first property can be used when trying to prove that a language is decidable (or undecidable). The last property implies that many-one reducibility is too weak to distinguish between decidable languages — they are pretty much All reducible to each other!

17 Computability and Complexity 5-17 Other Undecidable Problems Instance: A Turing Machine (acceptor) T and an input string x. Question: Does T accept x ? ACCEPTANCE The corresponding language is: Theorem is undecidable. Proof see next slide

18 Computability and Complexity 5-18 We show that For every input “ T;x ” of, we do: Add to T two new states and (to guarantee that they are not in T already we may need to rename the states of T ) Change the transition function by adding transition from every final state to Denote the obtained machine T’ Note that T’ accepts x if and only if T halts on x Therefore, the function which maps “ T;x ” to “ T’;x ” is computable and provides a mapping reduction from to

19 Computability and Complexity 5-19 Instance: A Turing Machine T. Question: Can T be simulated by a finite automaton? Regularity Instance: A context-free grammar G. Question: Is G ambiguous? Ambiguous Grammars

20 Computability and Complexity 5-20 Instance: A multivariate polynomial equation such as Question: Does this equation have an integer-valued solution? Diophantine Equations See “Hilbert’s Tenth Problem is Unsolvable” M.Davis, American Mathematical Monthly 80 (1973) pp.233-269


Download ppt "Computability and Complexity 5-1 Classifying Problems Computability and Complexity Andrei Bulatov."

Similar presentations


Ads by Google