• Keine Ergebnisse gefunden

To keep track of the current position,Nwrites the name of the path ofM(x)currently being traversed on track 1 of the working tape

N/A
N/A
Protected

Academic year: 2022

Aktie "To keep track of the current position,Nwrites the name of the path ofM(x)currently being traversed on track 1 of the working tape"

Copied!
26
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Theorem

L⊆NL⊆P⊆NP⊆PSPACE.

Proof: The inclusionsL⊆NLandP⊆NPare immediately clear, since every DTM, by definition, is a special NTM.

To prove thatNP⊆PSPACE, letM be any NTM running in timep(n)for somep∈IPol.

To define a DTMNthat decidesL(M)in polynomial space, we take advantage of an important property of the complexity resource space:

Unlike the time resource,space is reusable.

Using the same space on its working tape again and again, DTMN performs adepth-first searchthrough the computation tree ofM(x).

(2)

Construct DTMN, running on inputx of lengthn, as follows:

In addition to its input tape,N has one working tape subdivided into three tracks.

Recall that every polynomial is space-constructible. N first marks the spacep(n)on its working tape, i.e., exactlyp(n)cells.

Then,N systematically traverses the computation tree ofM(x) (assumed to be a full binary tree) by adepth-first search.

To keep track of the current position,Nwrites the name of the path ofM(x)currently being traversed on track 1 of the working tape.

A path name can be encoded in binary by a lengthp(n)string s∈ {0,1}: theithbit ofs represents theithbranching ofM(x).

The leftmost bits ofsmay be marked, so as to indicate that this initial part of the path has already been processed.

(3)

Initially,Nwrites the path name 0p(n)on track 1 and it writes the start configuration ofM(x)on track 2.

Then,N starts the search by simulating the computation ofM(x) along the path whose name, says, is currently written on track 1.

N writes two successive configurations occurring along this path alternately on the tracks 2 and 3.

LetC0`M C1`M · · · `M Cp(n)be the sequence of configurations corresponding tos.

(4)

Foriwith 1≤i<p(n), consider the three successive configurationsCi−1,Ci, andCi+1, where

(a) Ci−1`M Ci `MCi+1,

(b) Ci is the first configuration alongsas yet unvisited, (c) the firsti1 bits ofs are currently marked, and (d) track 2, say, currently containsCi−1.

Then,N writesCi on track 3, deleting the former content of track 3 and marking theith bit ofson track 1.

N thus proceeds, alternately switching the roles of track 2 and track 3, until the current path is completely processed and all bits ofsare marked.

If an accepting configuration is reached, thenN halts and acceptsx.

(5)

Ifshas been processed without reaching an accepting configuration, then

Nadds a one in binary to the content of track 1 and

keeps traversing the as yet unvisited configurations on that new path.

If all the paths ofM(x)have been processed without success, thenN rejectsx.

It follows thatL(N) =L(M). SinceNworks deterministically in polynomial space,

NP⊆PSPACE.

(6)

To prove the remaining inclusion,NL⊆P, letMb be any NTM operating in logarithmic space, and letx be any input of lengthn.

Note that the above systematic search through the entire computation tree doesnotwork here:

In fact, any log-space bounded NTM can spend as much asq(n)steps along each path, whereq∈IPol, which results in a total of 2q(n)

potential computation paths. Why?

This is becauseDSPACE(s)⊆DTIME(2ILin(s))for, say,s = loggives computation paths of length2c·logn=2lognc =nc =q(n).

Thus, a polynomial-time bounded DTM has no chance of checking every path ofM(xb )up to its full length ofq(n)steps.

(7)

Fortunately, however, an argument analogous to the proof that DSPACE(s)⊆DTIME(2ILin(s)) fors≥log

shows that there exists a constantc, depending onMb only, such that the number of distinct configurations ofM(xb )is bounded above by

2c·logn=2lognc =nc. (1)

That is, many of the configurations in the full depthq(n)computation tree ofM(x)b must occur repeatedly.

Hence, one can construct a DTMNb that, on inputx, searches through only a polynomial-size part of the computation tree ofM(xb ), truncating any path as soon as some configuration is encountered twice.

(8)

To this end,Nb uses three working tapes.

Tape 1 is again subdivided into three tracks and is used the same way the working tape of DTMN is used in the above proof of

NP⊆PSPACE.

That is, track 1 again keeps track of the current position in the search, by storing the current path name and marking how much of it has already been processed.

Tracks 2 and 3 again store two successive configurations, alternately producing the next one along the current path whose name is written on track 1.

(9)

In addition, DTMNb has two more tapes.

Tape 2 keeps a list of every new configuration ofM(xb )as yet found:

Whenever a new configuration, call itC, is produced on either track 2 or track 3 of tape 1, it is compared with each configuration currently contained in tape 2 to check whether or notCindeed is new.

If so,C is added to the list on tape 2;

otherwise, the current path ofM(x)b can safely be truncated.

Tape 3 contains a binary counter of lengthc·logn, wherecis the constant from Equation (1).

This counter is incremented by one each time a new configuration is added to tape 2.

(10)

If an accepting configuration ofM(xb )is found in the course of this process, thenNb halts and acceptsx.

If the search throughM(xb )is completed without success or if the counter ontape 3is full, i.e., the maximum number ofnc distinct configurations is found and none of them is accepting, thenNb rejectsx.

It follows thatL(N) =b L(M).b

(11)

To estimate the time needed, note thatM(xb )has at mostnc configurations of lengthO(logn)each.

Thus, the number of steps needed to compare the current configuration on tape 1 with the entire content oftape 2is in O(nc·logn)and thus in

O(nc+1).

Hence, comparing each of the at mostnc possible configurations on tape 1 with the content oftape 2requires altogether at most

O(n2c+1) steps.

(12)

Similarly, the process of producing new configurations on tape 1 and copying them ontotape 2requires at most

O(nc+1)

steps.

Incrementing the counter on tape 3 at mostnc times can be done in parallel.

Summing up,N(xb )needs time no more than polynomial inn.

Hence,NL⊆P. q

(13)

Corollary (to the proof)

1 If t is space-constructible, then

NTIME(t)⊆DSPACE(t).

2 If s≥logis constructible in time2ILin(s), then NSPACE(s)⊆DTIME(2ILin(s)).

This corollary immediately implies that:

NTIME(t)⊆DTIME(2ILin(t)) and NSPACE(s)⊆DSPACE(2ILin(s)), which upperbounds, for both time and space, the costs of trading nondeterminism for determinism.

(14)

What about the lower bounds?

Is an exponential increase in the resources really necessary in order to deterministically simulate nondeterminism?

For the time resource, the answer to this question is not known.

For the space resource, the answer is no!

Savitch’s Theorem shows that for the resource space, already a quadratic increase is enough to deterministically simulate nondeterminism.

(15)

Theorem (Savitch’s Theorem)

If s≥log is space-constructible, then

NSPACE(s)⊆DSPACE(s2).

(16)

Proof:

LetAbe any set inNSPACE(s), and letMbe some NTM acceptingAand working in spaces(n)on inputs of lengthn.

Goal: Construct a DTMN decidingAin spaceO(s2).

The constant implicit in theOnotation can safely be neglected by the Linear Compression Theorem.

Sinces≥log,MacceptsAin time t(n)≤2c·s(n)

for some constantc that depends on the program ofM only and can be easily determined.

(17)

ACCEPTM is the unique accepting configuration ofM on any input, and

STARTM(x)is the unique start configuration ofMon inputx. Letk =c·s(n), where we assume that 2k−1<t(n)≤2k, which impliesdlogt(n)e=k.

Suppose that the configurations ofM(x)are suitably encoded by strings over a fixed alphabet, and that all such strings have the same lengthd·s(n), for some constantd.

Enumerate all strings of lengthd·s(n)as C1,C2, . . . ,Cm

in the lexicographical ordering. Note that not all stringsCi may encode syntactically correct configurations ofM(x).

(18)

x ∈A ⇐⇒ STARTM(x)`2Mk ACCEPTM (2)

⇐⇒ (∃i) h

STARTM(x)`2Mk−1 Ci andCi `2Mk−1 ACCEPTMi .

This idea can be realized in spaceO(s2).

(19)

On inputx of lengthn, DTMNworks as follows:

1 N constructss(n)and computesk =c·s(n) =dlogt(n)e.

2 N generates the following pattern on its work tape:

STARTM(x)

| {z }

d·s(n)cells

#

kblocks

z }| {

2· · ·2

| {z }

d·s(n)cells

# 2· · ·2

| {z }

d·s(n)cells

# · · · # 2· · ·2

| {z }

d·s(n)cells

#ACCEPTM

| {z }

d·s(n)cells

where#is a special symbol separating thesek+2 blocks.

3 N(x)simulates the computation ofM(x)deterministically within thesek+2 blocks, reusing the same space on its tape over and over again.

4 N acceptsx if and only if it reaches theACCEPTM configuration.

(20)

We prove thatN’s simulation ofM(x)succeeds for eachx ∈A:

Ifx ∈A, thenN’s simulation of

STARTM(x)`2Mk ACCEPTM

succeeds in the space marked above.

Ifx 6∈A, thenNrejectsx. The proof is by induction onk.

k =0: Ncan check whether or not

STARTM(x)`2M0 ACCEPTM

by simulatingM(x)for one step.

(21)

(k −1) 7→k:

N systematically cycles through all lengthd·s(n)strings C1,C2, . . . ,Cm,

which potentially encode configurations ofM(x), searching for one Ci that satisfies (2).

IfCi is the string currently being checked,N first checks whether or notCi is a syntactically correct configuration ofM(x).

If not,Nproceeds by examining the next string,Ci+1.

(22)

Otherwise (i.e., ifCi is a syntactically correct configuration ofM(x)),N writesCi onto the(k +1)stblock of its working tape:

STARTM(x)

| {z }

d·s(n)cells

#

k−1 blocks

z }| {

2· · ·2

| {z }

d·s(n)cells

# · · · # 2· · ·2

| {z }

d·s(n)cells

# Ci

| {z }

d·s(n)cells

#ACCEPTM

| {z }

d·s(n)cells

and checks whether or not

STARTM(x)`2Mk−1 Ci,

which is possible by the induction hypothesis.

If this test fails,N erasesCi from the(k+1)st block and proceeds by examining the next string,Ci+1.

(23)

Otherwise (i.e., ifSTARTM(x)`2Mk−1 Ci),N erasesCi from the (k +1)stblock of its working tape after having it copied onto the second block:

STARTM(x)

| {z }

d·s(n)cells

# Ci

| {z }

d·s(n)cells

#

k−1 blocks

z }| {

2· · ·2

| {z }

d·s(n)cells

# · · · # 2· · ·2

| {z }

d·s(n)cells

#ACCEPTM

| {z }

d·s(n)cells

and checks whether or not

Ci `2Mk−1 ACCEPTM,

which again is possible by the induction hypothesis.

If this test fails,N erasesCi from the second block and proceeds by examining the next string,Ci+1.

(24)

Otherwise (i.e., ifCi has passed both tests,STARTM(x)`2M Ci andCi `2Mk−1 ACCEPTM, as required by (2)),Nacceptsx and halts.

If none of the potential configurationsCi ofM(x)passes both tests, thenN rejectsx and halts.

Clearly,L(N) =A.

Sincek =c·s(n)and there arek+2 blocks of sized·s(n)each, N(x)works in spaceO((s(n))2).

The Linear Compression Theorem then impliesA∈DSPACE(s2),

which proves Savitch’s theorem. q

(25)

Corollary (from Savitch’s Theorem)

1 PSPACE=NPSPACE.

2 NL⊂PSPACE.

(26)

Theorem (Immerman and Szelepcs ´enyi) If s≥log is space-constructible, then

NSPACE(s) =coNSPACE(s).

without proof

Corollary (from Immerman and Szelepcs ´enyi’s Theorem)

1 NLINSPACE=coNLINSPACE.

2 NL=coNL.

Referenzen

ÄHNLICHE DOKUMENTE

noted, “No country, besides Germany, was involved in massacres of Jews on such a scale”. 3 The systematic deportation and killing of Jews was carried out by the Roma- nian army

This contribution presents intermediary results from a research project in Berlin/ Germany (http://neue- mobilitaet.berlin/) where local actors together with

decompose the carbon intensity of energy (Figure 2, orange) into the share of fossil fuels in total energy 94.. use and carbon intensity of fossil fuel combustion (Level 3 in Figure

Supplementary Figure 5: Historical trends and future pathways for the main energy carriers in 2°C scenarios. All panels

The main results are detailed in Section 4 which encompasses (i) baseline (2000) indicators of education with respect to education- related MDGs, (ii) educational differentials

Die Analyse gibt Aufschluss darüber, welche Faktoren relevant sind, wenn eine obli- gatorische Kommaposition als solche wahrgenommen, also ‚bedient‘ wird oder nicht.. Innovativ

This could be done by the L2 topological trigger (L2TT) which may calculate for every track its projection onto the focal plane of the SPACAL and check for signals in this region in

The study of the marginal scenario of the theorem of lemons under the total failure of the market of used cars – nobody buys, but everybody gets taxi – shifts the