280 likes | 390 Views
CSci 4011. INHERENT LIMITATIONS OF COMPUTER PROGRAMS. e. f. b. g. a. i. d. h. c. GENERALIZED GEOGRAPHY. GG IS PSPACE-HARD. We show that FG P GG. We convert a formula into 〈 G,b 〉 such that:.
E N D
CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS
e f b g a i d h c GENERALIZED GEOGRAPHY
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: = x1x2x3…xk [] where is in cnf
(x1 x1 x2) (x1 x2 x2) … c2 cn c1 x1 x1 x2 b x2 x1 x2 c TRUE FALSE x1 x2 xk
c1 x1 x1 x1 b c x1 [ (x1 x1 x1) ] TRUE FALSE x1
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
FINAL EXAM SATURDAY, MAY 18 8:00AM – 10:00AM. Reminder: one page (8.5×11”) “cheat sheet” Office hours next week: Tuesday 2-4pm Wednesday 10am-noon Thursday 10am-noon Friday 3-5pm
1 0 q0 q2 0 1 q1 S → R | ε R → LRL | b L → a | b MODELS 1*(0∪01) {0k1k | k ≥ 0} { ww | w ∈ {0,1}* }
q2 q1 q0 TURING MACHINES read write move → , R 0 → 0, R q0 q1 qaccept 0→ 0, R → , R 0→ 0, R q2 → , L 0 0 UNBOUNDED TAPE
true if M(w) accepts false if M(w) does not. ATM = { M,w | M is a TM that accepts string w } ATM is undecidable: (proof by contradiction) Assume there is a program accepts to decide ATM. accepts(M,w) = Construct a new TM LLPF that on input M, runs accepts(M,M) and “does the opposite”: LLPF(PROG ) = if (accepts( PROG , PROG )) then reject; else accept. LLPF LLPF LLPF
REDUCTIONS A m B if there is a computable ƒ so that w A ƒ(w) B A P B if there is a poly-timecomputable ƒ so that w A ƒ(w) B ƒ is called a reduction from A to B
COMPLEXITY THEORY Is there a fast program for this problem? P = Problems where it is easy to find the answer. NP = Problems where it’s easy to check the answer. If P = NP then generation is as easy as recognition. PSPACE = Problems that can be solved in polynomial space. If P = PSPACE then TIMEis as powerful as SPACE.
COMPLETE PROBLEMS If C is a class of languages and B is a language, then B is C-Complete if: 1. B ∈ C. 2. ∀A ∈ C, A ≤P C (i.e. B is C-Hard) NP: 3SAT, SUBSET-SUM, HAMPATH, VERTEX COVER, 3-COLOR, CLIQUE,… PSPACE: TQBF, FG, GEOGRAPHY,…
POTPOURRI P VS NP SPACE COMPLEXITY 100 100 100 200 200 200 300 300 300 400 400 400 FINAL JEOPARDY
A tight asymptotic bound on the function ƒ(n) = n3/2 + n log(n2)
A proof that SET-PARTITION ∈ NP, where SET-PARTITION = { T = {x1,x2,…,xn} | ∃ S ⊆ T so that Σx ∈ S x = Σy S y }.
A proof that 3-COLOR ≤P 4-COLOR, where 4-COLOR = { G| G is a graph that is 4-colorable. }
A proof of SUBSET-SUM ≤P SET-PARTITION, where SET-PARTITION = { T = {x1,x2,…,xn} | ∃ S ⊆ T so that Σx∈S x = Σy S y }.
A winning strategy for Player I in this GG instance: b d a c
A proof that PATH ∈ PSPACE, where PATH = { G,s,t|G is a directed graph with a path from s to t}
A proof that MIN-FORMULA ∈ PSPACE, where MIN-FORMULA = { | is a formula and ∀formulae . || < || ⇒ ∃x. (x) (x) }
A CFG for the language { | is in cnf }, where variable xi is represented by the string xi.
A proof that { M| L(M) ∈ P } is undecidable, using the assumption P NP.
FINAL JEOPARDY TRUE