1 / 25

INHERENT LIMITATIONS OF COMPUTER PROGRAMS

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

karis
Télécharger la présentation

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS

  2. 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:

  3. SPACE COMPLEXITY

  4. 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)) =

  5. PSPACE = SPACE(nk) k  N 3SAT  PSPACE PSPACE = NPSPACE P  NP  PSPACE  EXPTIME

  6. 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)

  7. QUANTIFIED BOOLEAN FORMULAS xy [ x  y ] x [ x  x ] x [ x ] xy [ (x  y)  (x  y) ]

  8. 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) ]

  9. TQBF = {  |  is a true fully quantified Boolean formula} Theorem: TQBF is PSPACE-complete

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

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

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

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

  14. 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 ] ]

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

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

  17. 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

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

  19. e f b g a i d h c GENERALIZED GEOGRAPHY

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

  21. 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|²)

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

  23. (x1  x1  x2)  (x1  x2  x2) … c2 cn c1 x1 x1 x2 b x2 x1 x2 c TRUE FALSE x1 x2 xk

  24. c1 x1 x1 x1 b c x1 [ (x1  x1  x1) ] TRUE FALSE x1

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

More Related