Computability and Complexity 5 1 Classifying Problems Computability
Computability and Complexity 5 -1 Classifying Problems Computability and Complexity Andrei Bulatov
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
Computability and Complexity 5 -3 Decidable Languages Definition A language L is decidableª if there exists a TM T, with 2 final states , such that • If x L then and 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 answ for each possible string from *
Computability and Complexity 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 -4
Computability and Complexity 5 -5 Examples All languages accepted by finite automata, or generated by context-free grammars are decidable Decidable Languages Regular Languages All Languages Context-free Languages (for finite automata see Discrete Mathematics course or Sipser) (for context-free grammars see Compilers course or Sipser)
Computability and Complexity 5 -6 Acceptable Languages Definition A language L is acceptableª if there exists a TM T, with 2 final states , such that • If x L then and 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 e string in L, in all other cases it gives a no answer or fails to hal
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 acceptable, the it is decidable. (Proof: is als run the two acceptor machines alternately until one h So, to show that there are languages that are not decidable, we m find a language that is not acceptable …
Computability and Complexity 5 -8 The Halting Problem Halting Instance: A Turing Machine T and an input string x. Question: Does T(x) halt? Once we choose an encoding for Turing machines, the correspond language is: • is acceptable - use a universal TM U to simulate T on x and modify it so that if it halts then it moves to “Accept” state • is not decidable - see next slide
Computability and Complexity • Assume, for contradiction, that there is a TM • Construct a new T from but 5 -9 that decide so that for input x, T simulate - if accepts “x; x” then T goes into an infinite loop, - if rejects “x; x” then T accepts x.
Computability and Complexity 5 -10 I NPUT A? R? T
Computability and Complexity 5 -11 I NPUT A? R? I N P U T ; I N P U T T A? R?
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 implying that T(T) halts! • Hence cannot exist, so accepts “T; T”, is undecidable.
Computability and Complexity 5 -13 Consequences • The language is not acceptable. • There is no Turing machine that can give correct answers to the Halting problem on all inputs. • Hence, by Turing’s Thesis: The Halting problem cannot be solved by any algorithm! This result was first announced in Turing’s 1936 paper
Computability and Complexity 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 5 -14
Computability and Complexity 5 -15 Many-One Reducibility Definition A language A is many-one reducible (or mreducible, or mapping reducible) to a language B if there exists a total and computable function f such that for all • We denote this by writing • We can use a machine that decides B (plus a machine that redu • So, in a sense, A is “no harder than” B
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 decidable, then is 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!
Computability and Complexity 5 -17 Other Undecidable Problems ACCEPTANCE Instance: A Turing Machine (acceptor) T and an input string x. Question: Does T accept x? The corresponding language is: Theorem Proof see next slide is undecidable.
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 th are not in T already we may need to rename the states of • Change the transition function by adding transition from eve 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
Computability and Complexity Regularity Instance: A Turing Machine T. Question: Can T be simulated by a finite automaton? Ambiguous Grammars Instance: A context-free grammar G. Question: Is G ambiguous? 5 -19
Computability and Complexity Diophantine Equations Instance: A multivariate polynomial equation such as Question: Does this equation have an integer-valued solution? See “Hilbert’s Tenth Problem is Unsolvable” M. Davis, American Mathematical Monthly 80 (1973) pp. 233 -269 5 -20
- Slides: 20