Lecture Slides for MAT-73006 Theoretical computer science PART IIc: Reducibility Henri Hansen February 3, 2014 1
Reducibility • We established that the Turing Machine is a reasonable model of a general purpose computer • We also showed that some problems, at least A TM , are unsolvable • We shall now look at several other problems and learn an important theoretical tool called reduction • Reduction is a way of converting one problem to another problem so that the solution of the latter also is a solution of the former. 2
• For example, suppose you want to find some place in a new city. You reduce the problem to finding the place on the map, then following the steps indicated on the map. • Reducibility involves two problems, let us call them A and B . If A reduces to B , we can use the solution of B to solve A . So, in our example A is finding your target and B is looking it up and following on the map. • Reducibility also occurs in mathematical problems. For in- stance, measuring the area of a rectangle is reduced into measuring width and height (and combining with multiplica- tion)
• We shall look at some reductions in terms of computational problems
Undecidable problems through reductions • Let H TM = { ( M, w ) | M is a TM which halts on input w } • Theorem: H TM is undecidable. • Proof: LEt us assume R decides H TM . Construct S as follows: 1. Run R on input ( M, w ) 2. If R rejects, reject 3. If R accepts, run M on input w , and accept/reject ac- cordingly 3
• S is now a decider for A TM , i.e., we have reduced A TM to H TM , thus showing that R cannot be a decider. • Let E TM = { ( M ) | M is a TM with L ( M ) = ∅} • Theorem: E TM is undecidable. • Proof: We do another reduction to A TM . Given M and w , construct M w which does the following: 1. If the input x � = w , reject 2. If the input x = w , run M on w and accept if M accepts
Now, assuming R decides E TM , we build S , that on receiv- ing input ( M, w ) : 1. Construct M w using the description of M and w 2. Run R on M w 3. If R accepts, reject, and vice versa. • Let REG TM = { ( M ) | L ( M ) is regular } • Theorem: REG TM is undecidable • Proof: Let R decide REG TM , construct S , that takes input ( M, w ) :
1. Construct M w 2 , that checks whether its input is 0 n 1 n ; accept if it is, if not, run the input on M and accept ac- cordingly 2. Run R on input M w 2 , and accept accordingly. • Now, what does this machine accept? R (and therefore S accepts if M w 2 accepts a regular language. IF M accepts w , then M w 2 accepts every string, and therefore is regular. If M does not accept w , M w 2 accepts 0 n 1 n , and so is not regular. • Hence S decides A TM • Let EQ TM = { ( M 1 , M 2 ) | L ( M 1 ) = L ( M 2 ) }
• Theorem: EQ TM is undecidable. • Proof: Choose M 1 in such a way that ( M 1 ) = ∅ , and E TM reduces to this
Reductions via computing histories 1. Definition: If M is a turing machine, and w is an input, an accepting computing history for M on w is a sequence of configurations C 1 . . . . , C l where C l is accepting and C 1 is the inital configuration, and C i legally follows from C i − 1 . Similarly for rejecting computing history 2. Definition: A linear bounded automaton (LBA) is a Turing machine that is never allowed to move over , i.e., it can only read and write on the tape cells that originally contained the input. 3. A LBA = { ( M, w ) | M is an LBA that accepts w } 4
4. Lemma: Let M be an LBA with q states and g symbols on its tape alphabet. There are exactly qng n different configu- rations of M , when the tape length is n . 5. Theorem: A LBA is decidable 6. Proof: Consider a Turing machine that on input ( M, w ) : (a) Simulate M on w for qng n steps or until it halts (b) If M halts, accept/reject accordingly, otherwise reject 7. If the simulation is able to carry out qng n steps without halt- ing, it has visited all the configurations that it could, so that if it has not halted yet, it must be running a loop.
8. Let E LBA = { ( M ) | M is an LBA and L ( M ) = ∅} 9. Theorem E LBA is undecidable 10. Proof: We reduce this to A TM , even if this may be a bit surprising 11. Given a Turing machine M and input w we construct an LBA B w and check this for emptiness 12. What B w accepts will be the accepting computing histories of M on w .
13. Given a computation history C 1 , . . . C l , B w checks that (a) C 1 is the initial configuration, i.e., the tape contains w and M is in the start state. (b) Each C i + i follows from C i according to M s transition function (c) C l is an acceopting configuration of M 14. The language of B w is empty if and only if M does not accept w . 15. Let ALL CFG = { ( G ) | G is a CFG and L ( G ) = Σ ∗ }
16. Theorem: ALL CFG is undecidable 17. Proof: We can define a grammar G w that generates all strings that are not accepting computation histories of M on w . We generate all strings, (a) that do not start with the initial configuration (b) that do not end with an accepting configuration (c) in which some C i does not properly yield C i +1 under the computation rules 18. M does not accept w if and only if G w generates all strings
19. A TM can then be decided: If G w generates all strings, re- ject, otherwise accept.
Another undecidable problem • The problems we described were all confined to questions regarding how automata behave • A classic example that only concerns handling strings, is the so called Post correspondence problem (PCP) • Assume we are given a collection of domino-pieces, of the form [ s i t i ] where s i and t i are strings. For example, the col- lection could be { [ b ca ] , [ a ab ] , [ ca a ] , [ abc c ] } 5
• The task is to make a list of these pieces (with repetitions if necessary) so that we generate a match , i.e., the string that forms on top of the line is the same as the one that forms below the line • For example, a solution (i.e., a match) for our example puz- zle is [ a ab ][ b ca ][ ca a ][ a ab ][ abc c ] • The formal statement of the PCP is: given a collection P = t 1 ] , . . . , [ s k { [ s 1 t k ] } , is there a sequence i 1 , . . . , i l such that s i 1 s i 2 · · · s i l = t i 1 t i 2 · · · t i l • We define PCP = { ( P ) | P is an instance of PCP that has a match }
• Theorem: PCP is undecidable • The proof is quite complicated but the idea is simple: We can build a set of dominos where the strings below the line match results of the moves of the automaton and the initial configuration, while the strings above the line correspond to the state/alphabet pairs that appear in transitions; a match then corresponds to an accepting computation history • Let us start with a turing machine M = ( Q, Σ , Γ , δ, q 0 , q a , q r ) and its input w $ 1. The first domino is given as $ q 0 w 1 ··· w n # , and we make sure that no other domino can be the first in the se- quence
2. For every a, b ∈ Γ and q, r ∈ Q , where q � = q r , if δ ( q, a ) = ( r, b, R ) we add the domino with qa br 3. For every a, b, c ∈ Γ and q, r ∈ Q , where q � = q r , if δ ( q, a ) = ( r, b, L ) we add the domino with cqa rcb 4. For every a, ∈ Γ we add the domino with a a 5. We add dominos with # # and # # 6. For every a, ∈ Γ we add the dominos with aq a q a and q a a q a 7. We add the domino with q a ## # • This set of dominos is still not the correct reduction, be- cause we still hve to make sure the first domino is the first and no other domino can be.
• We add some symbols in between to achieve this. Let ∗ u be the string that is like u but with a ∗ before every symbol. • Let u ∗ be like u but with a ∗ after every symbol. • Let ∗ u ∗ be like u ∗ but with ∗ in the beginning as well • Then we take the collection P = { [ s 1 t 1 ] , . . . , [ s k t k ] } obtained alread and consider { [ ∗ s 1 ∗ t 1 ∗ ] , [ ∗ s 1 t 1 ∗ ] , [ ∗ s 2 t 2 ∗ ] , . . . , [ ∗ s k t k ∗ ] , [ ∗♦ ♦ ] }
Reducibility of mappings • We say that a function f : Σ ∗ �→ Σ ∗ is computable if some turing machine M halts on all inputs and on input w , halts with f ( w ) on its tape. • Arithmetic operations are computable, but we leave details as exercises • Some transformations of turing machines are also computable functions • We say that a language A is mapping reducible to language B , written A ≤ m B if there is a computable dunction f such 6
that w ∈ A ⇔ f ( w ) ∈ B . f is then said to be a reduction from A to B . • Theorem: If A ≤ m B and B is decidable, then A is decid- able • Proof is simple: If M decides B , then simply compute f ( w ) and run M to decide if w ∈ A . • Corollary: If A ≤ m B and A is undecidable, then B is un- decidable • In fact, many of the examples we looked at, make use of this corollary!
Recommend
More recommend