Docsity

Computational Complexity: Lecture 5 - Space and Nondeterminism, Study notes of Computational Methods

Toggle sidebar
bg1
CS221: Computational Complexity Prof. Salil Vadhan
Lecture 5: Space and Nondeterminism
September 30, 2002 Scribe: Trevor Bass
Contents
1 Agenda 1
2 Hierarchy Theorems, Continued 1
3 Space Complexity Classes 2
4 Nondeterminism 2
1 Agenda
•Space and Nondeterministic complexity classes
•Nondeterministic hierarchy theorem
•Relating time, space, and nondeterminism
•Reductions and completeness
2 Hierarchy Theorems, Continued
Theorem 1 (Almost everywhere hierarchy) If fis a proper complexity function, there exists
a language L∈TIME(2O(n)f(n)2)such that any Mwith L(M) = L(i.e. with no errors) takes
time > f(n)almost everywhere (i.e. Lis ā€œhardā€ a.e.).
Last time we constructed L, but we didn’t verify L∈TIME(2O(n)f(n)2). Where does the expo-
nential factor come from? To decide Lon input x, recall that we needed to look at all strings y≤x
(lexicographically). Fully verifying the time bound is left as an exercise.
Corollary 2 There exists a language L∈EXP(= TIME(2nO(1))) such that deciding Ltakes time
>2na.e.
Another form of ā€œLis hard oftenā€ introduces the notion of ā€œaverage-case complexityā€: āˆ€Mrunning
in time f(n), the fraction of inputs on which M(x)6=χL(x) is at least a constant Ī“asymptotically
as n→ āˆž. Noting that the all-1 or all-0 TM is correct 50% of the time asymptotically, we could
ideally hope to have Γto be something like 49%.
1
pf3

Partial preview of the text

Download Computational Complexity: Lecture 5 - Space and Nondeterminism and more Study notes Computational Methods in PDF only on Docsity!

CS221: Computational Complexity Prof. Salil Vadhan

Lecture 5: Space and Nondeterminism

September 30, 2002 Scribe: Trevor Bass

Contents

1 Agenda 1

2 Hierarchy Theorems, Continued 1

3 Space Complexity Classes 2

4 Nondeterminism 2

1 Agenda

  • Space and Nondeterministic complexity classes
  • Nondeterministic hierarchy theorem
  • Relating time, space, and nondeterminism
  • Reductions and completeness

2 Hierarchy Theorems, Continued

Theorem 1 (Almost everywhere hierarchy) If f is a proper complexity function, there exists a language L ∈ TIME(2O(n)f (n)^2 ) such that any M with L(M ) = L (i.e. with no errors) takes time > f (n) almost everywhere (i.e. L is ā€œhardā€ a.e.).

Last time we constructed L, but we didn’t verify L ∈ TIME(2O(n)f (n)^2 ). Where does the expo- nential factor come from? To decide L on input x, recall that we needed to look at all strings y ≤ x (lexicographically). Fully verifying the time bound is left as an exercise.

Corollary 2 There exists a language L ∈ EXP(= TIME(2n O(1) )) such that deciding L takes time

2 n^ a.e.

Another form of ā€œL is hard oftenā€ introduces the notion of ā€œaverage-case complexityā€: āˆ€M running in time f (n), the fraction of inputs on which M (x) 6 = χL(x) is at least a constant Ī“ asymptotically as n → āˆž. Noting that the all-1 or all-0 TM is correct 50% of the time asymptotically, we could ideally hope to have Ī“ to be something like 49%.

3 Space Complexity Classes

Definition 3 SPACE(f (n)) is the set of languages decidable by a TM in space f (n).

Recall that ā€œspaceā€ refers only to workspace, which does not include the input and output.

Definition 4 (ā€œLog spaceā€) L =

c

SPACE(c log n).

Definition 5 (ā€œPolynomial spaceā€) PSPACE =

c

SPACE(nc).

Log space is the smallest complexity class we will study in this course. Constant space can be hardwired into the finite state control of a TM (i.e. SPACE(O(1)) = SPACE(0)). In fact:

Remark 6 SPACE(log log n) = SPACE(O(1)) = SPACE(0) = {regular languages}.

Notice that log n bits are needed even to keep a pointer in the input or to calculate the size of the input. L is thus a good measure of feasible computation for massive data sets: with it one can keep track of a constant number of pointers, but cannot do too much more.

The following operations are typical of problems in L: addition (trivial to prove this), multiplication (on problem set 1), and division (difficult—solved in 2001).

On the other hand, PSPACE is much more powerful; typical problems are games (e.g. does player 1 have a winning strategy from a given position in some game?), such as go, chess, and geography.

On problem set 1, we will see that there is a hierarchy theorem for space. A corollary to this theorem is:

Corollary 7 L 6 = PSPACE.

4 Nondeterminism

Recall that a nondeterministic TM (NTM) is just like a deterministic TM except that at any time step there can be several options for the possible next states, what it writes, and so on, such that the transition function becomes a transition relation. Thus on a given input, there can be many different possible computations, corresponding to all possible nondeterministic choices.

Definition 8 An NTM M accepts x if there exists a computation of M on x that halts and outputs

  1. Similarly, its language L(M ) = {x : ∃ computation of M on x that halts and outputs 1 .} (i.e. ā€œguess and verifyā€).

The running time of an NTM on x is the maximum running time used on input x over all computa- tions, even those that do not output 1, and is denoted NTIME(f (n)). The space used on x is the maximum workspace used on x over all computations, and is denoted NSPACE(f (n)). Note that if the NTM doesn’t halt on a certain set of choices, it can be redefined by limiting all computations to a particular running time. Analogous to the deterministic class we define NPdef =

c NTIME(n

c),

NEXP =

c NTIME( nc ), NL = ā‹ƒ c NSPACE(c^ log^ n), and^ NPSPACE^ =^

c NSPACE( nc ).