CS151 Complexity Theory
Total Page:16
File Type:pdf, Size:1020Kb
Relationships between classes • So far: CS151 L ⊆ P ⊆ PSPACE ⊆ EXP • believe all containments strict Complexity Theory • know L ⊆ PSPACE, P ⊆ EXP Lecture 3 • even before any mention of NP, two major unsolved problems: April 6, 2021 ? ? L = P P = PSPACE April 6, 2021 CS151 Lecture 3 2 A P-complete problem A P-complete problem • We don’t know how to prove L ≠ P • logspace reduction: f computable by TM • But, can identify problems in P least likely that uses O(log n) space to be in L using P- completeness. – denoted “L1 ≤L L2” • need stronger notion of reduction (why?) • If L is P-complete, then L in L implies L = f 2 2 yes yes P (homework problem) f no no L1 L2 April 6, 2021 CS151 Lecture 3 3 April 6, 2021 CS151 Lecture 3 4 A P-complete problem A P-complete problem • Circuit Value (CVAL): given a variable-free • Tableau (configurations written in an Boolean circuit (gates ∧, ∨, ¬, 0, 1), does array) for machine M on input w: it output 1? … w1/qs w2 … wn _ • height = … w1 w2/q1 … wn _ time taken Theorem: CVAL is P-complete. … c w1/q1 a … wn _ = |w| • Proof: . – already argued in P . • width = … – L arbitrary language in P, TM M decides L in _/qa _ … _ _ space used nc steps ≤ |w|c April 6, 2021 CS151 Lecture 3 5 April 6, 2021 CS151 Lecture 3 6 1 A P-complete problem A P-complete problem • Important observation: contents of cell in • Can build Boolean circuit STEP tableau determined by 3 others above it: – input (binary encoding of) 3 cells – output (binary encoding of) 1 cell a/q1 b a a b/q1 a a b/q1 a • each output bit is some b/q1 a function of inputs a b a STEP • can build circuit for each b • size is independent of a size of tableau April 6, 2021 CS151 Lecture 3 7 April 6, 2021 CS151 Lecture 3 8 A P-complete problem A P-complete problem w w w … 1 2 n Tableau for w1/qs w2 … wn _ This circuit M on input … w q w … w … _ C has w1 w2/q1 … wn _ 1/ s 2 n M, w w . inputs . STEP STEP STEP STEP STEP w1w2…wn and outputs 1 iff M • |w|c copies of STEP compute row i from i-1 STEP STEP STEP STEP STEP . accepts input … . w. STEP STEP STEP STEP STEP logspace STEP STEP STEP STEP STEP ignore these reduction … 2c 1 iff cell contains qaccept Size = O(|w| ) April 6, 2021 CS151 Lecture 3 9 April 6, 2021 CS151 Lecture 3 10 Answer to question Padding and succinctness • Can we evaluate an n node Boolean Two consequences of measuring running circuit using O(log n) space? time as function of input length: • “padding” ∧ • NO! (probably) – suppose L ∈ EXP, and define N |x|k ∧ ∨ PADL = { x# : x ∈ L, N = 2 } • CVAL in L if and – TM that decides PADL: ensure suffix of N #s, ∨ ∧ ¬ ignore #s, then simulate TM that decides L only if L = P – running time now polynomial ! 1 0 1 0 1 April 6, 2021 CS151 Lecture 3 11 April 6, 2021 CS151 Lecture 3 12 2 Padding and succinctness Succinct encodings • converse (intuition only): “succinctness” • succinct encoding for a directed – suppose L is P-complete graph G= (V = {1,2,3,…}, E): 1 iff (i, j) ∈ E – intuitively, some inputs are “hard” -- require • a succinct encoding for a full power of P variable-free Boolean circuit: – SUCCINCT has inputs encoded in different L i j form than L, some exponentially shorter 1 iff wire type of – if “hard” inputs are exponentially shorter, then from gate i to gate j gate i candidate to be EXP-complete type of gate j i j April 6, 2021 CS151 Lecture 3 13 April 6, 2021 CS151 Lecture 3 14 An EXP-complete problem An EXP-complete problem • Succinct Circuit Value: given a succinctly – tableau for input x = x1x2x3…xn: encoded variable-free Boolean circuit x _ _ _ _ _ (gates ∧, ∨, ¬, 0, 1), does it output 1? height, k Theorem: Succinct Circuit Value is EXP- width 2n complete. • Proof: – Circuit C from CVAL reduction has size – in EXP (why?) k O(22n ). – L arbitrary language in EXP, TM M decides L k – TM M accepts input x iff circuit outputs 1 in 2n steps April 6, 2021 CS151 Lecture 3 15 April 6, 2021 CS151 Lecture 3 16 An EXP-complete problem Summary • Remaining TM details: big-oh necessary. – Can encode C succinctly: • First complexity classes: L, P, PSPACE, EXP 1 iff wire type of type of • First separations (via simulation and from gate diagonalization): gate i gate j i to gate j i j P ≠ EXP, L ≠ PSPACE • if i, j within single STEP circuit, easy to compute • First major open questions: output ? ? • if i, j between two STEP circuits, easy to compute L = P P = PSPACE output • First complete problems: • if one of i, j refers to input gates, consult x to – CVAL is P-complete compute output – Succinct CVAL is EXP-complete April 6, 2021 CS151 Lecture 3 17 April 6, 2021 CS151 Lecture 3 18 3 Summary Nondeterminism: introduction A motivating question: EXP • Can computers replace mathematicians? PSPACE P L L = { (x, 1k) : statement x has a proof of length at most k } April 6, 2021 CS151 Lecture 3 19 April 6, 2021 CS151 Lecture 3 20 Nondeterminism: introduction Nondeterminism • Outline: • Recall deterministic TM – nondeterminism – nondeterministic time classes – Q finite set of states – NP, NP-completeness, P vs. NP – ∑ alphabet including blank: “_” – coNP – qstart, qaccept, qreject in Q – NTIME Hierarchy – transition function: – Ladner’s Theorem δ : Q x ∑ → Q x ∑ x {L, R, -} April 6, 2021 CS151 Lecture 3 21 April 6, 2021 CS151 Lecture 3 22 Nondeterminism Nondeterminism • deterministic TM: given current configuration, • nondeterministic Turing Machine: unique next configuration – Q finite set of states qstartx1x2x3…xn qstartx1x2x3…xn – ∑ alphabet including blank: “_” – q , q , q in Q start accept reject x ∈ L x ∉ L – transition relation ∆ ⊆ (Q x ∑) x (Q x ∑ x {L, R, -}) qaccept qreject • given current state and symbol scanned, several choices of what to do next. • nondeterministic TM: given current configuration, several possible next configurations April 6, 2021 CS151 Lecture 3 23 April 6, 2021 CS151 Lecture 3 24 4 Nondeterminism Nondeterminism qstartx1x2x3…xn qstartx1x2x3…xn • all paths terminate “computation x ∈ L ∉ x L path” “guess” • time used: maximum length of paths from root • space used: maximum # of work tape qaccept squares touched on any path from root qreject • asymmetric accept/reject criterion April 6, 2021 CS151 Lecture 3 25 April 6, 2021 CS151 Lecture 3 26 Nondeterminism Nondeterminism • NTIME(f(n)) = languages decidable by a • Focus on time classes first: multi-tape NTM that runs for at most f(n) steps on any computation path, where n is k the input length, and f :N → N NP = ∪k NTIME(n ) • NSPACE(f(n)) = languages decidable by a multi-tape NTM that touches at most f(n) nk squares of its work tapes along any NEXP = ∪k NTIME(2 ) computation path, where n is the input length, and f :N → N April 6, 2021 CS151 Lecture 3 27 April 6, 2021 CS151 Lecture 3 28 Poly-time verifiers Poly-time verifiers Very useful alternate“ witnessdefinition” or of NP: • Example: 3SAT expressible as “certificate” 3SAT = {φ : φ is a 3-CNF formula for which Theorem: language L is in NP if andefficiently only if ∃ assignment A for which (φ, A) ∈ R} it is expressible as: verifiable R = {(φ, A) : A is a sat. assign. for φ} L = { x| ∃ y, |y| ≤ |x|k, (x, y) ∈ R } where R is a language in P. – satisfying assignmdnt A is a “witness” of the satisfiability of φ (“certifies” satisfiability of φ) – R is decidable in poly-time • poly-time TM MR deciding R is a “verifier” April 6, 2021 CS151 Lecture 3 29 April 6, 2021 CS151 Lecture 3 30 5 Poly-time verifiers Poly-time verifiers L = { x | ∃ y, |y| ≤ |x|k, (x, y) ∈ R } Proof: (⇐) given L ∈ NP, describe L as: Proof: (⇒) give poly-time NTM deciding L L = { x | ∃ y, |y| ≤ |x|k, (x, y) ∈ R } – L is decided by NTM M running in time nk – define the language phase 1: “guess” y R = { (x, y) : y is an accepting computation with |x|k history of M on input x} nondeterministic steps – check: accepting history has length ≤ |x|k phase 2: – check: R is decidable in polynomial time decide if – check: M accepts x iff ∃y, |y| ≤ |x|k, (x, y) ∈ R (x, y) ∈ R April 6, 2021 CS151 Lecture 3 31 April 6, 2021 CS151 Lecture 3 32 Why NP? Why NP? problem object we •requirementsnot a realistic model of computationare seeking • but, captures important computational • Why not EXP? feature of many problems: exhaustive search worksefficient test: – too strong! • contains huge number of natural,does practical y meet – important problems not complete. problems requirements? • many problems have form: L = { x | ∃ y s.t. (x,y) ∈ R} April 6, 2021 CS151 Lecture 3 33 April 6, 2021 CS151 Lecture 3 34 Relationships between classes NP-completeness • Easy: P ⊆ NP, EXP ⊆ NEXP • Circuit SAT: given a Boolean circuit (gates – TM special case of NTM ∧, ∨, ¬), with variables y1, y2, …, ym is • Recall: L ∈ NP iff expressible as there some assignment that makes it k L = { x | ∃ y, |y| ≤ |x| s.t. (x,y) ∈ R} output 1? • NP ⊆ PSPACE (try all possible y) • The central question: Theorem: Circuit SAT is NP-complete.