Lecture Slides for MAT-73006 Theoretical computer science PART IIc: - - PowerPoint PPT Presentation

lecture slides for mat 73006 theoretical computer science
SMART_READER_LITE
LIVE PREVIEW

Lecture Slides for MAT-73006 Theoretical computer science PART IIc: - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

Lecture Slides for MAT-73006 Theoretical computer science PART IIc: Reducibility

Henri Hansen February 3, 2014

1

slide-2
SLIDE 2

Reducibility

  • We established that the Turing Machine is a reasonable

model of a general purpose computer

  • We also showed that some problems, at least ATM, 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

slide-3
SLIDE 3
  • 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)

slide-4
SLIDE 4
  • We shall look at some reductions in terms of computational

problems

slide-5
SLIDE 5

Undecidable problems through reductions

  • Let HTM = {(M, w) | M is a TM which halts on input w}
  • Theorem: HTM is undecidable.
  • Proof: LEt us assume R decides HTM. 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

slide-6
SLIDE 6
  • S is now a decider for ATM, i.e., we have reduced ATM to

HTM, thus showing that R cannot be a decider.

  • Let ETM = {(M) | M is a TM with L(M) = ∅}
  • Theorem: ETM is undecidable.
  • Proof: We do another reduction to ATM. Given M and w,

construct Mw 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
slide-7
SLIDE 7

Now, assuming R decides ETM, we build S, that on receiv- ing input (M, w):

  • 1. Construct Mw using the description of M and w
  • 2. Run R on Mw
  • 3. If R accepts, reject, and vice versa.
  • Let REGTM = {(M) | L(M) is regular}
  • Theorem: REGTM is undecidable
  • Proof: Let R decide REGTM, construct S, that takes input

(M, w):

slide-8
SLIDE 8
  • 1. Construct Mw

2 , that checks whether its input is 0n1n;

accept if it is, if not, run the input on M and accept ac- cordingly

  • 2. Run R on input Mw

2 , and accept accordingly.

  • Now, what does this machine accept? R (and therefore S

accepts if Mw

2 accepts a regular language. IF M accepts

w, then Mw

2 accepts every string, and therefore is regular.

If M does not accept w, Mw

2 accepts 0n1n, and so is not

regular.

  • Hence S decides ATM
  • Let EQTM = {(M1, M2) | L(M1) = L(M2)}
slide-9
SLIDE 9
  • Theorem: EQTM is undecidable.
  • Proof: Choose M1 in such a way that (M1) = ∅, and ETM

reduces to this

slide-10
SLIDE 10

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 C1. . . . , Cl where Cl is accepting and C1 is the inital configuration, and Ci legally follows from Ci−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. ALBA = {(M, w) | M is an LBA that accepts w}

4

slide-11
SLIDE 11
  • 4. Lemma: Let M be an LBA with q states and g symbols on

its tape alphabet. There are exactly qngn different configu- rations of M, when the tape length is n.

  • 5. Theorem: ALBA is decidable
  • 6. Proof: Consider a Turing machine that on input (M, w):

(a) Simulate M on w for qngn steps or until it halts (b) If M halts, accept/reject accordingly, otherwise reject

  • 7. If the simulation is able to carry out qngn 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.

slide-12
SLIDE 12
  • 8. Let ELBA = {(M) | M is an LBA and L(M) = ∅}
  • 9. Theorem ELBA is undecidable
  • 10. Proof: We reduce this to ATM, even if this may be a bit

surprising

  • 11. Given a Turing machine M and input w we construct an

LBA Bw and check this for emptiness

  • 12. What Bw accepts will be the accepting computing histories
  • f M on w.
slide-13
SLIDE 13
  • 13. Given a computation history C1, . . . Cl, Bw checks that

(a) C1 is the initial configuration, i.e., the tape contains w and M is in the start state. (b) Each Ci+i follows from Ci according to Ms transition function (c) Cl is an acceopting configuration of M

  • 14. The language of Bw is empty if and only if M does not

accept w.

  • 15. Let ALLCFG = {(G) | G is a CFG and L(G) = Σ∗}
slide-14
SLIDE 14
  • 16. Theorem: ALLCFG is undecidable
  • 17. Proof: We can define a grammar Gw that generates all

strings that are not accepting computation histories of M

  • n 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 Ci does not properly yield Ci+1 under the computation rules

  • 18. M does not accept w if and only if Gw generates all strings
slide-15
SLIDE 15
  • 19. ATM can then be decided: If Gw generates all strings, re-

ject, otherwise accept.

slide-16
SLIDE 16

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 [si

ti] where si and ti are strings. For example, the col-

lection could be {[ b ca], [ a ab], [ca a ], [abc c ]}

5

slide-17
SLIDE 17
  • 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 =

{[s1

t1], . . . , [sk tk]}, is there a sequence i1, . . . , il such that

si1si2 · · · sil = ti1ti2 · · · til

  • We define PCP = {(P) | P is an instance of PCP that has a match}
slide-18
SLIDE 18
  • 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, Σ, Γ, δ, q0, qa, qr)

and its input w

  • 1. The first domino is given as

$ $q0w1···wn#, and we make

sure that no other domino can be the first in the se- quence

slide-19
SLIDE 19
  • 2. For every a, b ∈ Γ and q, r ∈ Q, where q = qr, 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 = qr, 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 aqa

qa and qaa qa

  • 7. We add the domino with qa##

#

  • 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.

slide-20
SLIDE 20
  • 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 = {[s1

t1], . . . , [sk tk]} obtained

alread and consider {[ ∗s1 ∗t1∗], [∗s1 t1∗], [∗s2 t2∗], . . . , [∗sk tk∗], [∗♦ ♦ ]}

slide-21
SLIDE 21

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

slide-22
SLIDE 22

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!