W e m ust argue that the TM can do exactly what a - - PDF document

w e m ust argue that the tm can do exactly what a
SMART_READER_LITE
LIVE PREVIEW

W e m ust argue that the TM can do exactly what a - - PDF document

Outline of T uring Mac hines and Complexit y 1. T uring mac hine (TM) = formal mo del of a computer running a particular program. W e m ust argue that the TM can do exactly what a computer can do, alb


slide-1
SLIDE 1 Outline
  • f
T uring Mac hines and Complexit y 1. T uring mac hine (TM) = formal mo del
  • f
a computer running a particular program.

W e m ust argue that the TM can do exactly what a computer can do, alb eit slo w er. 2. W e use the simplicit y
  • f
the TM mo del to pro v e formally that there are sp ecic problems (=languages) that the TM cannot solv e.

Tw
  • classes:
\recursiv ely en umerable" = TM can accept the strings in the language but cannot tell for certain that a string is not in the language; \non-RE" = no TM can ev en recognize the mem b ers
  • f
the language in the RE sense. 3. W e then lo
  • k
at problems (languages) that do ha v e TM's that accept them and alw a ys halt; i.e., they not
  • nly
recognize the strings in the language, but they tell us when they are sure the string is not in the language.

The classes P and N P are those languages recognizable b y deterministic (resp., nondeterministic) TM's that halt within a time that is some p
  • lynomial
in the input.

P
  • lynomial
is as close as w e can get, b ecause real computers and dieren t mo dels
  • f
(deterministic) TM's can dier in their running time b y a p
  • lynomial
function, e.g., a problem migh t tak e O (n 2 ) time
  • n
a real computer and O (n 6 )
  • n
a TM. 4. NP-complete problems: Since w e don't kno w whether P = N P , but it app ears that at least some problems in N P tak e exp
  • nen
tial time, the b est w e can do is sho w that a certain problem is \NP-complete," = if this problem is in P , then all
  • f
N P is in P . 5. Some sp ecic problems that are NP-complete: satisabilit y
  • f
b
  • lean
(prop
  • sitional
logic) form ulas, tra v eling salesman, etc. In tuiti v e Argumen t Ab
  • ut
an Undecidabl e Problem Giv en a C program, do es it prin t hello, world. as the rst 13 c haracters
  • f
  • utput?
1
slide-2
SLIDE 2
  • W
e pro v e there is no C program to solv e that problem b y supp
  • sing
that there w ere suc h a program H , the \hello-w
  • rld-tester."

H tak es as input a C program P and an input le I for that program, and tells whether P , with input I , \prin ts hello w
  • rld"
(b y whic h w e mean it do es so as the rst 13 c haracters).
  • Mo
dify H to a new program H 1 that acts lik e H , but when H prin ts no, H 1 prin ts hello, world.

Requires some though t: w e need to nd where no is prin ted and c hange the printf statemen t.
  • Mo
dify H 1 to H 2 . This program tak es
  • nly
  • ne
input, P , and acts lik e H 1 with b
  • th
its program and data inputs equal to P .

I.e., H 2 (P ) = H 1 (P ; P ).

Requires more though t: H 2 m ust buer its input so it can b e used as b
  • th
the P and I inputs to H 1 .
  • H
2 cannot exist. If it did, what w
  • uld
H 2 (H 2 ) do?

If H 2 (H 2 ) = yes, then H 2 giv en H 2 as input eviden tly do es not prin t hello, world. But H 2 (H 2 ) = H 1 (H 2 ; H 2 ) = H (H 2 ; H 2 ), and H 1 prin ts yes if and
  • nly
if its rst input, giv en its second input as data, prin ts hello, world. Th us, H 2 (H 2 ) = yes implies H 2 (H 2 ) = hello, world.

But if H 2 (H 2 ) = hello, world. then H 1 (H 2 ; H 2 ) = hello, world. and H (H 2 ; H 2 ) = no. Th us, H 2 (H 2 ) = hello, world. implies H 2 (H 2 ) 6= hello, world. The TM
  • Finite-state
con trol, lik e PD A.
  • One
read-write tap e serv es as b
  • th
input and un b
  • unded
storage device.

T ap e divided in to c el ls.

Eac h tap e holds
  • ne
sym b
  • l
from the tap e alphab et.

T ap e is \semi-innite"; it ends
  • nly
at the left. 2
slide-3
SLIDE 3
  • T
ap e he ad marks the \curren t" cell, whic h is the
  • nly
cell that can inuence the mo v e
  • f
the TM.
  • Initially
, tap e holds a 1 a 2
  • a
n B B
  • where
a 1 a 2
  • a
n is the input, c hosen from an input alphab et (subset
  • f
the tap e alphab et) and B is the blank. F
  • rmal
TM M = (Q; ; ;
  • ;
q ; B ; F ), where:
  • Q
= n te set
  • f
states.
  • =
tap e alphab et;
  • =
input alphab et.
  • B
in
  • =
blank.
  • q
in Q = start sym b
  • l;
F
  • Q
= accepting states.
  • tak
es a state and tap e sym b
  • l,
returns a new state, replacemen t sym b
  • l
(either migh t not c hange) and a direction L=R for head motion. Example Non trivial examples are hard to come b y . Here's a TM that c hec ks its third sym b
  • l
is 0, accepts if so, and runs forev er, if not. M = (fp; q ; r ; s; tg; f0; 1g ; f0 ; 1; B g; p; B ; fsg) 1.
  • (p;
X ) = (q ; X ; R) for X = 0; 1. 2.
  • (q
; X ) = (r ; X ; R) for X = 0; 1. 3.
  • (r
; 0) = (s; 0; L). 4.
  • (r
; 1) = (t; 1; R). 5.
  • (t;
X ) = (t; X ; R) for X = 0; 1; B . ID's
  • f
a T uring Mac hine The ID (instan taneous description) captures what is going
  • n
at an y momen t: the curren t state, the con ten ts
  • f
the tap e, and the p
  • sition
  • f
the tap e head.
  • Keep
things nite b y dropping all sym b
  • ls
to the righ t
  • f
the head and to the righ t
  • f
the righ tmost non blank.

Subtle p
  • in
t: although there is no limit
  • n
ho w far righ t the head ma y mo v e and write non blanks, at an y nite time, the TM has visited
  • nly
a nite prex
  • f
the innite tap e. 3
slide-4
SLIDE 4
  • Notation:
q
  • sa
ys:

  • is
the tap e con ten ts to the left
  • f
the head.

The state is q .

  • is
the non blank tap e con ten ts at
  • r
to the righ t
  • f
the tap e head.
  • One
mo v e indicated b y ` ; zero,
  • ne,
  • r
more mo v es represen ted b y ` * .

Chec k the reader for the detailed denition
  • f
`. Example With input 0101, the sequence
  • f
ID's
  • f
the TM is: p0101 ` 0q 101 ` 01r 01 ` 0s101.
  • A
t that p
  • in
t it halts, since state s has no mo v e when the head is scanning 1. With input 0111 the sequence is: p0111 ` 0q 111 ` 01r 11 ` 011t1 ` 0111t ` 0111B t `
  • .
  • The
TM nev er halts, but con tin ues to mo v e righ t. Acceptance b y Final State and b y Halting One w a y to dene the language
  • f
a TM is b y the set
  • f
input strings that cause it to reac h an accepting state.
  • L(M
) = fw j q w ` * p for some p in F and an y
  • and
  • in
  • g.
Another w a y is to dene the set
  • f
strings that cause the TM to halt = ha v e no next mo v e.
  • H
(M ) = fw j q w ` * pX
  • ,
and
  • (p;
X ) is not denedg.

Subtle p
  • in
t: a TM can app e ar to halt if the next mo v e w
  • uld
tak e the head
  • the
left end
  • f
the tap e.

Giv en an y TM, w e can mark the left end so that nev er happ ens; i.e., w e pro duce a mo died TM that accepts the same language and halts rather than fall
  • the
left end. Example
  • The
TM M
  • f
  • ur
previous example has L(M ) equal to those strings in the language
  • f
RE (0 + 1)(0 + 1)0(0 + 1)
  • .
4
slide-5
SLIDE 5
  • H
(M ) is the language
  • f
  • +
+ 1 + (0 + 1)(0 + 1) + (0 + 1)(0 + 1)0(0 + 1)
  • .
Equiv alence
  • f
Acceptance b y Final State and Halting W e need to sho w L is L(M 1 ) for some TM M 1 if and
  • nly
if L is H (M 2 ) for some TM M 2 . If Mo dify M 2 as follo ws: 1. In tro duce
  • ne
accepting state r . 2. Whenev er there is no transition for M 2
  • n
state q and sym b
  • l
X , add a transition to state r , mo ving righ t (so w e can't p
  • ssibly
fall
  • the
left end) and lea ving sym b
  • l
X . Only-If Roughly , w e let M 2 sim ulate M 1 , but if M 1 en ters an accepting state, M 2 has no next mo v e and so halts.
  • Ma
jor problem: M 1 could halt without accepting.

T
  • a
v
  • id
this problem, in tro duce state r that mo v es righ t
  • n
ev ery sym b
  • l,
sta ying in state r and lea ving the tap e sym b
  • ls
unc hanged.

Giv e M 2 a transition to r (mo ving righ t)
  • n
ev ery state-sym b
  • l
com bination that do es not ha v e a rule.
  • Also,
remo v e all transitions where the state is an accepting state
  • f
M 1 , so M 2 will halt in those situations. F alling O the Left End
  • f
T ap e The reader talks ab
  • ut
the funn y situation where the TM w
  • uld
halt but falls
  • the
left end
  • f
tap e.
  • This
situation is not halting.
  • Neither
do es a TM accept if it tries to en ter an accepting state as it falls
  • the
left end.
  • W
e can prev en t falling
  • the
left end, b y marking the leftmost cell, as in the reader.
  • But
it app ears w e do not need to do so in
  • rder
to pro v e the equiv alence
  • f
halting/accepting, since neither
  • ccurs
when the TM falls
  • the
left end. 5