CSci 4011
This presentation is the property of its rightful owner.
Sponsored Links
1 / 25

INHERENT LIMITATIONS OF COMPUTER PROGRAMS PowerPoint PPT Presentation


  • 45 Views
  • Uploaded on
  • Presentation posted in: General

CSci 4011. INHERENT LIMITATIONS OF COMPUTER PROGRAMS. QUIZ 6. B is NP-Complete if:. (a) B ∈ NP. (b) ∀ A ∈ NP, A ≤ P B. Reduction from HAMPATH to KPATH:. ƒ (〈 G,s,t 〉) = 〈 G,s,t,|V |-1〉. n ifty proof that 〈[ 14, 24, 13, 5, 1, 23, 29, 11], 42〉 ∈ SSUM:.

Download Presentation

INHERENT LIMITATIONS OF COMPUTER PROGRAMS

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Inherent limitations of computer programs

CSci 4011

INHERENT LIMITATIONS OF COMPUTER PROGRAMS


Inherent limitations of computer programs

QUIZ 6

B is NP-Complete if:

(a) B ∈ NP

(b) ∀ A ∈ NP, A ≤P B

Reduction from HAMPATH to KPATH:

ƒ(〈G,s,t〉) = 〈G,s,t,|V|-1〉

nifty proof that

〈[14, 24, 13, 5, 1, 23, 29, 11], 42〉 ∈ SSUM:

Many, e.g. 14+23+5 = 42; 13+29 = 42

Nifty Proof that 〈G〉 ∈ 3COLOR:


Space complexity

SPACE COMPLEXITY


Inherent limitations of computer programs

Definition: Let M be a deterministic TM that halts on all inputs. The space complexity of M is the function f : N  N, where f(n) is the rightmost tape position that M reaches on any input of length n.

{ L | L is a language decided by a O(t(n)) space deterministic Turing Machine }

Definition: SPACE(t(n)) =


Inherent limitations of computer programs

PSPACE = SPACE(nk)

k  N

3SAT  PSPACE

PSPACE = NPSPACE

P  NP  PSPACE  EXPTIME


Inherent limitations of computer programs

HARDEST PROBLEMS IN PSPACE

Definition: Language B is PSPACE-complete if:

1. B  PSPACE

2. Every A in PSPACE is poly-time reducible to B

(i.e. B is PSPACE-hard)


Inherent limitations of computer programs

QUANTIFIED BOOLEAN FORMULAS

xy [

x  y

]

x [ x  x ]

x [ x ]

xy [ (x  y)  (x  y) ]


Inherent limitations of computer programs

Definition: A fully quantified Boolean formula (or a sentence) is a Boolean formula in which every variable is quantified

xy [

x  y

]

x [ x  x ]

x [ x ]

xy [ (x  y)  (x  y) ]


Inherent limitations of computer programs

TQBF = {  |  is a true fully quantified Boolean formula}

Theorem: TQBF is PSPACE-complete


Inherent limitations of computer programs

TQBF  PSPACE

is_true():

1. If  contains no quantifiers, then it is an expression with only constants, so simply evaluate 

2. If  = x , recursively call isTrue on , first with x = 0 and then with x = 1. Accept if either one of them is true.

3. If  = x , recursively call isTrue on , first with x = 0 and then with x = 1. Accept if both of them are true.


Inherent limitations of computer programs

Claim: Every language A in PSPACE is

polynomial time reducible to TQBF

We build a poly-time reduction from A to TQBF

Let M be a deterministic TM that decides A in space nk

The reduction turns a string w into a fully quantified Boolean formula  that is true

iff M has an accepting computation on w.


Inherent limitations of computer programs

We let  = c , c , h, where h = 2nk+1

start

accept

We now design  so that a satisfying assignment to the variables corresponds to M accepting w

Given two collections of variables denoted c and d representing two configurations of M and a number t > 0, we construct a formula c,d,t

If we assign c and d to actual configurations, c,d,t will be true if and only if M can go from c to d in t steps


Inherent limitations of computer programs

If t = 1, we can easily construct c,d,t:

c,d,t = “c equals d” or “d follows from c in a single step of M”

“c equals d” says that each for each i, ci = di.

“d follows from c in a single step of M” can be expressed as we did with SAT


Inherent limitations of computer programs

If t > 1, we can build c,d,trecursively:

c,d,t = m [c,m,t/2  m,d,t/2 ]

m1m2 … 9ml

O(t) = 2O(nk)

How long is this formula?

Since O(t) is too long, we modify the formula to be:

c,d,t = ma,b[ [(a,b)=(c,m)  (a,b)=(m,d)]  [ a,b,t/2 ] ]


Inherent limitations of computer programs

PSPACE is frequently called the class of games because many popular games are PSPACE-Complete


Inherent limitations of computer programs

THE FORMULA GAME

…is played between two players, E and A

Given a fully quantified Boolean formula

yx [ (x  y)  (x  y) ]

E chooses values for variables quantified by 

A chooses values for variables quantified by 

Start at the leftmost quantifier

E wins if the resulting formula is true

A wins otherwise


Inherent limitations of computer programs

xy [

x  y

]

xy [ (x  y)  (x  y) ]

FG = {  | Player E can force a win in  }

Theorem: FG is PSPACE-Complete

Proof:

FG = TQBF


Inherent limitations of computer programs

GEOGRAPHY

Two players take turns naming cities from anywhere in the world

Each city chosen must begin with the same letter that the previous city ended with

Cities cannot be repeated

Austin  Nashua  Albany  York

Whoever cannot name any more cities loses


Inherent limitations of computer programs

e

f

b

g

a

i

d

h

c

GENERALIZED GEOGRAPHY


Inherent limitations of computer programs

GG = { 〈G,b〉 | Player I has a winning strategy for the generalized geography game played on graph G starting at node b }

Theorem: GG is PSPACE-Complete


Inherent limitations of computer programs

GG  PSPACE

def current_player_wins(G, s):

False

if neighbors(s,G) = Ø: return

G’ = remove_node(s,G)

for t ∈ neighbors(s,G):

return True.

if not(current_player_wins(G’,t)):

else: return False

Maximum recursion depth: |G|

Space complexity: O(|G|²)


Inherent limitations of computer programs

GG IS PSPACE-HARD

We show that FG P GG

We convert a formula  into 〈G,b〉 such that:

Player E has winning strategy in  if and onlyif Player I has winning strategy in 〈G,b〉

For simplicity we assume  is of the form:

 = x1x2x3…xk []

where  is in cnf


Inherent limitations of computer programs

(x1  x1  x2) 

(x1  x2  x2) …

c2

cn

c1

x1

x1

x2

b

x2

x1

x2

c

TRUE

FALSE

x1

x2

xk


Inherent limitations of computer programs

c1

x1

x1

x1

b

c

x1 [ (x1  x1  x1) ]

TRUE

FALSE

x1


Inherent limitations of computer programs

Question: Is Chess PSPACE complete?

No, because determining whether Player I has a winning strategy takes constant time and space

n x n GO, chess and checkers can be shown to be PSPACE-hard


  • Login