Computational Complexity
Lecture 4 in which Diagonalization takes on itself, and we enter Space Complexity (But first Ladner’ s Theorem)
1
Computational Complexity Lecture 4 in which Diagonalization takes - - PowerPoint PPT Presentation
Computational Complexity Lecture 4 in which Diagonalization takes on itself, and we enter Space Complexity (But first Ladner s Theorem) 1 Ladner s Theorem 2 Ladner s Theorem If P ! NP, then are all non-P NP languages equally
1
2
If P!NP, then are all non-P NP languages equally hard? (Are all NP-complete?)
2
If P!NP, then are all non-P NP languages equally hard? (Are all NP-complete?) No!
2
If P!NP, then are all non-P NP languages equally hard? (Are all NP-complete?) No! Can show an NP language which is neither in P, nor NP complete (unless P = NP)
2
3
SATH = { (x,pad) | x ∈ SAT and |pad|=|x|H(|x|)}
3
SATH = { (x,pad) | x ∈ SAT and |pad|=|x|H(|x|)} H(|x|) will be computable in poly(|x|) time. SATH in NP.
3
SATH = { (x,pad) | x ∈ SAT and |pad|=|x|H(|x|)} H(|x|) will be computable in poly(|x|) time. SATH in NP.
Padding maps problem to a lower complexity class
3
SATH = { (x,pad) | x ∈ SAT and |pad|=|x|H(|x|)} H(|x|) will be computable in poly(|x|) time. SATH in NP. If SATH in P and H(|x|) bounded by const. then SAT in P!
Padding maps problem to a lower complexity class
3
SATH = { (x,pad) | x ∈ SAT and |pad|=|x|H(|x|)} H(|x|) will be computable in poly(|x|) time. SATH in NP. If SATH in P and H(|x|) bounded by const. then SAT in P! |pad| < |x|i* implies SAT !p SATH
Padding maps problem to a lower complexity class
3
SATH = { (x,pad) | x ∈ SAT and |pad|=|x|H(|x|)} H(|x|) will be computable in poly(|x|) time. SATH in NP. If SATH in P and H(|x|) bounded by const. then SAT in P! |pad| < |x|i* implies SAT !p SATH If SATH is NPC (⇒ SATH not in P) and H(|x|) goes to infinity, then SAT in P!
Padding maps problem to a lower complexity class
3
SATH = { (x,pad) | x ∈ SAT and |pad|=|x|H(|x|)} H(|x|) will be computable in poly(|x|) time. SATH in NP. If SATH in P and H(|x|) bounded by const. then SAT in P! |pad| < |x|i* implies SAT !p SATH If SATH is NPC (⇒ SATH not in P) and H(|x|) goes to infinity, then SAT in P! Suppose f(x) = (x’,pad), |(x’,pad)| ! c|x|c. If |x’|>|x|/2, then |pad| = |x’|H(|x’|) > c|x|c (for long enough x). So |x’| is at most |x|/2. Repeat to solve SAT
Padding maps problem to a lower complexity class
3
SATH = { (x,pad) | x ∈ SAT and |pad|=|x|H(|x|)} H(|x|) will be computable in poly(|x|) time. SATH in NP. If SATH in P and H(|x|) bounded by const. then SAT in P! |pad| < |x|i* implies SAT !p SATH If SATH is NPC (⇒ SATH not in P) and H(|x|) goes to infinity, then SAT in P! Suppose f(x) = (x’,pad), |(x’,pad)| ! c|x|c. If |x’|>|x|/2, then |pad| = |x’|H(|x’|) > c|x|c (for long enough x). So |x’| is at most |x|/2. Repeat to solve SAT To define H s.t. H(n) bounded by const. iff SATH in P
Padding maps problem to a lower complexity class
3
4
Mi be ith TM. Ti be ith polynomial (i.e., Ti(t)=i.ti)
4
Mi|Ti be Mi restricted to Ti Mi be ith TM. Ti be ith polynomial (i.e., Ti(t)=i.ti)
4
Mi|Ti |z|
Mi|Ti be Mi restricted to Ti Mi be ith TM. Ti be ith polynomial (i.e., Ti(t)=i.ti)
4
Mi|Ti |z|
Mi|Ti be Mi restricted to Ti Put at (i,t) if Mi|Ti agrees with SATH on all z, |z|=t; else put Mi be ith TM. Ti be ith polynomial (i.e., Ti(t)=i.ti)
4
Mi|Ti |z|
Mi|Ti be Mi restricted to Ti Put at (i,t) if Mi|Ti agrees with SATH on all z, |z|=t; else put H(n) be least i < log log n s.t. Mi|Ti correct for all |z|<log n Mi be ith TM. Ti be ith polynomial (i.e., Ti(t)=i.ti)
4
Mi|Ti |z|
Mi|Ti be Mi restricted to Ti Put at (i,t) if Mi|Ti agrees with SATH on all z, |z|=t; else put H(n) be least i < log log n s.t. Mi|Ti correct for all |z|<log n
log log n log n
Mi be ith TM. Ti be ith polynomial (i.e., Ti(t)=i.ti)
4
Mi|Ti |z|
Mi|Ti be Mi restricted to Ti Put at (i,t) if Mi|Ti agrees with SATH on all z, |z|=t; else put H(n) be least i < log log n s.t. Mi|Ti correct for all |z|<log n
log log n log n
Mi be ith TM. Ti be ith polynomial (i.e., Ti(t)=i.ti)
4
Mi|Ti |z|
Mi|Ti be Mi restricted to Ti Put at (i,t) if Mi|Ti agrees with SATH on all z, |z|=t; else put H(n) be least i < log log n s.t. Mi|Ti correct for all |z|<log n H is poly-time computable
log log n log n
Mi be ith TM. Ti be ith polynomial (i.e., Ti(t)=i.ti)
4
Mi|Ti |z|
Mi|Ti be Mi restricted to Ti Put at (i,t) if Mi|Ti agrees with SATH on all z, |z|=t; else put H(n) be least i < log log n s.t. Mi|Ti correct for all |z|<log n H is poly-time computable SATH in P iff H(n) < i*
log log n log n
Mi be ith TM. Ti be ith polynomial (i.e., Ti(t)=i.ti)
4
Mi|Ti |z|
Mi|Ti be Mi restricted to Ti Put at (i,t) if Mi|Ti agrees with SATH on all z, |z|=t; else put H(n) be least i < log log n s.t. Mi|Ti correct for all |z|<log n H is poly-time computable SATH in P iff H(n) < i* Both equivalent to having a row of all
log log n log n
Mi be ith TM. Ti be ith polynomial (i.e., Ti(t)=i.ti)
4
5
5
“Real” Questions
5
“Real” Questions “Meta” Questions
5
“Real” Questions SAT in DTIME(n2)? “Meta” Questions
5
“Real” Questions SAT in DTIME(n2)? Is my problem NP-complete? “Meta” Questions
5
“Real” Questions SAT in DTIME(n2)? Is my problem NP-complete? Results non-specialists would care about “Meta” Questions
5
“Real” Questions SAT in DTIME(n2)? Is my problem NP-complete? Results non-specialists would care about “Meta” Questions What can we do with an
5
“Real” Questions SAT in DTIME(n2)? Is my problem NP-complete? Results non-specialists would care about “Meta” Questions What can we do with an
Will this proof technique work?
5
“Real” Questions SAT in DTIME(n2)? Is my problem NP-complete? Results non-specialists would care about “Meta” Questions What can we do with an
Will this proof technique work? Tools & Techniques, intermediate results
5
“Real” Questions SAT in DTIME(n2)? Is my problem NP-complete? Results non-specialists would care about “Meta” Questions What can we do with an
Will this proof technique work? Tools & Techniques, intermediate results Under-the-hood stuff
5
6
What if we had an oracle for language A
6
What if we had an oracle for language A Class PA: L ∈ PA if
6
What if we had an oracle for language A Class PA: L ∈ PA if L decided by a TM MA, in poly time
6
What if we had an oracle for language A Class PA: L ∈ PA if L decided by a TM MA, in poly time Turing reduction: L !T A
6
What if we had an oracle for language A Class PA: L ∈ PA if L decided by a TM MA, in poly time Turing reduction: L !T A Class NPA: L ∈ NPA if
6
What if we had an oracle for language A Class PA: L ∈ PA if L decided by a TM MA, in poly time Turing reduction: L !T A Class NPA: L ∈ NPA if L decided by an NTM MA, in poly time
6
What if we had an oracle for language A Class PA: L ∈ PA if L decided by a TM MA, in poly time Turing reduction: L !T A Class NPA: L ∈ NPA if L decided by an NTM MA, in poly time Equivalently, L = {x| ∃w, |w| < poly(|x|) s.t. (x,w) ∈ L ’ }, where L ’ is in PA
6
What if we had an oracle for language A Class PA: L ∈ PA if L decided by a TM MA, in poly time Turing reduction: L !T A Class NPA: L ∈ NPA if L decided by an NTM MA, in poly time Equivalently, L = {x| ∃w, |w| < poly(|x|) s.t. (x,w) ∈ L ’ }, where L ’ is in PA Equivalence carries over!
6
7
Often entire theorems/proofs carry over, with the
7
Often entire theorems/proofs carry over, with the
e.g. Time hierarchy theorems (and proofs!) hold for machines with access to any given oracle A
7
Often entire theorems/proofs carry over, with the
e.g. Time hierarchy theorems (and proofs!) hold for machines with access to any given oracle A Said to “relativize”
7
8
How does P vs. NP fare relative to different oracles?
8
How does P vs. NP fare relative to different oracles? Does their relation (equality or not) relativize?
8
How does P vs. NP fare relative to different oracles? Does their relation (equality or not) relativize? No! Different in different worlds!
8
How does P vs. NP fare relative to different oracles? Does their relation (equality or not) relativize? No! Different in different worlds! There exist languages A, B such that PA = NPA, but PB ! NPB!
8
9
If A is EXP-complete (w.r.t !Cook or !P), PA = NPA = EXP
9
If A is EXP-complete (w.r.t !Cook or !P), PA = NPA = EXP A EXP-hard ⇒ EXP ⊆ PA ⊆ NPA
9
If A is EXP-complete (w.r.t !Cook or !P), PA = NPA = EXP A EXP-hard ⇒ EXP ⊆ PA ⊆ NPA A in EXP ⇒ NPA ⊆ EXP (note: to decide a language in NPA can try all possible witnesses, and carry out PA computation in exponential time)
9
If A is EXP-complete (w.r.t !Cook or !P), PA = NPA = EXP A EXP-hard ⇒ EXP ⊆ PA ⊆ NPA A in EXP ⇒ NPA ⊆ EXP (note: to decide a language in NPA can try all possible witnesses, and carry out PA computation in exponential time) A simple EXP-complete language:
9
If A is EXP-complete (w.r.t !Cook or !P), PA = NPA = EXP A EXP-hard ⇒ EXP ⊆ PA ⊆ NPA A in EXP ⇒ NPA ⊆ EXP (note: to decide a language in NPA can try all possible witnesses, and carry out PA computation in exponential time) A simple EXP-complete language: EXPTM = { (M,x,1n) | TM represented by M accepts x within time 2n }
9
10
10
L={1n| ∃w, |w|=n and w∈B}
10
L={1n| ∃w, |w|=n and w∈B} B
10
L={1n| ∃w, |w|=n and w∈B}
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B}
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n)
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) Mi
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) 1n Mi
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) 1n Mi
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) Pick n s.t. B not yet set beyond 1n-1. Run Mi on 1n for 2n-1 steps. 1n Mi
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) Pick n s.t. B not yet set beyond 1n-1. Run Mi on 1n for 2n-1 steps. 1n Mi
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) Pick n s.t. B not yet set beyond 1n-1. Run Mi on 1n for 2n-1 steps. 1n Mi
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) Pick n s.t. B not yet set beyond 1n-1. Run Mi on 1n for 2n-1 steps. 1n Mi
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) Pick n s.t. B not yet set beyond 1n-1. Run Mi on 1n for 2n-1 steps. 1n Mi
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) Pick n s.t. B not yet set beyond 1n-1. Run Mi on 1n for 2n-1 steps. 1n Mi
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) Pick n s.t. B not yet set beyond 1n-1. Run Mi on 1n for 2n-1 steps. When Mi queries B on x > 1n-1, set B(X)=0 1n Mi
1n 11 1
L B
00 01 10
...
10
L={1n| ∃w, |w|=n and w∈B} L in NPB. To do: L not in PB For each i, ensure MiB in 2n-1 time gets L(1n) wrong (for some new n) Pick n s.t. B not yet set beyond 1n-1. Run Mi on 1n for 2n-1 steps. When Mi queries B on x > 1n-1, set B(X)=0 After Mi finished set B up to x=1n s.t. L(1n) ! MiB(1n) 1n Mi
1n 11 1
L B
00 01 10
...
10
11
P vs. NP cannot be resolved using a relativizing proof
11
P vs. NP cannot be resolved using a relativizing proof “Diagonalization proofs” relativize
11
P vs. NP cannot be resolved using a relativizing proof “Diagonalization proofs” relativize Just need a way to enumerate/ encode machines, and to simulate one without much
11
P vs. NP cannot be resolved using a relativizing proof “Diagonalization proofs” relativize Just need a way to enumerate/ encode machines, and to simulate one without much
Do not further depend on internals of computation
11
P vs. NP cannot be resolved using a relativizing proof “Diagonalization proofs” relativize Just need a way to enumerate/ encode machines, and to simulate one without much
Do not further depend on internals of computation e.g. of non-relativizing proof: that of Cook-Levin theorem
11
12
13
Natural complexity question
13
Natural complexity question How much memory is needed
13
Natural complexity question How much memory is needed More pressing than time:
13
Natural complexity question How much memory is needed More pressing than time: Can’ t generate memory on the fly
13
Natural complexity question How much memory is needed More pressing than time: Can’ t generate memory on the fly Or maybe less pressing:
13
Natural complexity question How much memory is needed More pressing than time: Can’ t generate memory on the fly Or maybe less pressing: Turns out, often a little memory can go a long way (if we can spare the time)
13
14
Measure of working memory (work-tape) used by a TM/NTM: input kept in a read-only tape
14
Measure of working memory (work-tape) used by a TM/NTM: input kept in a read-only tape Model allows o(n) memory usage
14
Measure of working memory (work-tape) used by a TM/NTM: input kept in a read-only tape Model allows o(n) memory usage DSPACE(n) may already be inefficient in terms of time
14
Measure of working memory (work-tape) used by a TM/NTM: input kept in a read-only tape Model allows o(n) memory usage DSPACE(n) may already be inefficient in terms of time We shall stick to "(log n)
14
Measure of working memory (work-tape) used by a TM/NTM: input kept in a read-only tape Model allows o(n) memory usage DSPACE(n) may already be inefficient in terms of time We shall stick to "(log n) Less than log is too little space to remember locations in the input
14
Measure of working memory (work-tape) used by a TM/NTM: input kept in a read-only tape Model allows o(n) memory usage DSPACE(n) may already be inefficient in terms of time We shall stick to "(log n) Less than log is too little space to remember locations in the input DSPACE/NSPACE more robust across models
14
Measure of working memory (work-tape) used by a TM/NTM: input kept in a read-only tape Model allows o(n) memory usage DSPACE(n) may already be inefficient in terms of time We shall stick to "(log n) Less than log is too little space to remember locations in the input DSPACE/NSPACE more robust across models Constant factor (+O(log n)) simulation overhead
14
15
Non-deterministic M
15
Non-deterministic M input: x
15
Non-deterministic M input: x makes non-det choices
15
Non-deterministic M input: x makes non-det choices x ∈ L iff some thread of M accepts
15
Non-deterministic M input: x makes non-det choices x ∈ L iff some thread of M accepts in at most S(|x|) space
15
Non-deterministic M input: x makes non-det choices x ∈ L iff some thread of M accepts in at most S(|x|) space Deterministic M’
15
Non-deterministic M input: x makes non-det choices x ∈ L iff some thread of M accepts in at most S(|x|) space Deterministic M’ input: x and read-once w
15
Non-deterministic M input: x makes non-det choices x ∈ L iff some thread of M accepts in at most S(|x|) space Deterministic M’ input: x and read-once w reads bits from w (certificate)
15
Non-deterministic M input: x makes non-det choices x ∈ L iff some thread of M accepts in at most S(|x|) space Deterministic M’ input: x and read-once w reads bits from w (certificate) x ∈ L iff for some cert. w, M’ accepts
15
Non-deterministic M input: x makes non-det choices x ∈ L iff some thread of M accepts in at most S(|x|) space Deterministic M’ input: x and read-once w reads bits from w (certificate) x ∈ L iff for some cert. w, M’ accepts in at most S(|x|) space
15
Non-deterministic M input: x makes non-det choices x ∈ L iff some thread of M accepts in at most S(|x|) space Deterministic M’ input: x and read-once w reads bits from w (certificate) x ∈ L iff for some cert. w, M’ accepts in at most S(|x|) space
15
16
L = DSPACE(O(log n))
16
L = DSPACE(O(log n)) L = ∪a,b > 0 DSPACE(a.log n+b)
16
L = DSPACE(O(log n)) L = ∪a,b > 0 DSPACE(a.log n+b) NL = NSPACE(O(log n))
16
L = DSPACE(O(log n)) L = ∪a,b > 0 DSPACE(a.log n+b) NL = NSPACE(O(log n)) NL = ∪a,b > 0 NSPACE(a.log n+b)
16
L = DSPACE(O(log n)) L = ∪a,b > 0 DSPACE(a.log n+b) NL = NSPACE(O(log n)) NL = ∪a,b > 0 NSPACE(a.log n+b) “L and NL are to space what P and NP are to time”
16
17
UTM space-overhead is only a constant factor
17
UTM space-overhead is only a constant factor Tight hierarchy: if T(n) = o(T’(n)) (no log slack) then DSPACE(T(n)) ⊊ DSPACE(T’(n))
17
UTM space-overhead is only a constant factor Tight hierarchy: if T(n) = o(T’(n)) (no log slack) then DSPACE(T(n)) ⊊ DSPACE(T’(n)) Same for NSPACE
17
UTM space-overhead is only a constant factor Tight hierarchy: if T(n) = o(T’(n)) (no log slack) then DSPACE(T(n)) ⊊ DSPACE(T’(n)) Same for NSPACE Again, tighter than for NTIME (where in fact, we needed T(n+1) = o(T’(n) )
17
UTM space-overhead is only a constant factor Tight hierarchy: if T(n) = o(T’(n)) (no log slack) then DSPACE(T(n)) ⊊ DSPACE(T’(n)) Same for NSPACE Again, tighter than for NTIME (where in fact, we needed T(n+1) = o(T’(n) ) No “delayed flip,” because, as we will see later, NSPACE(O(S)) = co-NSPACE(O(S))!
17
18
DSPACE, NSPACE
18
DSPACE, NSPACE Tight hierarchy.
18
DSPACE, NSPACE Tight hierarchy. Coming up:
18
DSPACE, NSPACE Tight hierarchy. Coming up: Connections with DTIME/NTIME
18
DSPACE, NSPACE Tight hierarchy. Coming up: Connections with DTIME/NTIME Savitch’ s theorem: NSPACE(S) ⊆ DSPACE(S2)
18
DSPACE, NSPACE Tight hierarchy. Coming up: Connections with DTIME/NTIME Savitch’ s theorem: NSPACE(S) ⊆ DSPACE(S2) Hence PSPACE = NPSPACE
18
DSPACE, NSPACE Tight hierarchy. Coming up: Connections with DTIME/NTIME Savitch’ s theorem: NSPACE(S) ⊆ DSPACE(S2) Hence PSPACE = NPSPACE PSPACE-completeness and NL-completeness
18
DSPACE, NSPACE Tight hierarchy. Coming up: Connections with DTIME/NTIME Savitch’ s theorem: NSPACE(S) ⊆ DSPACE(S2) Hence PSPACE = NPSPACE PSPACE-completeness and NL-completeness NSPACE = co-NSPACE
18
P
PSPACE
EXP NP NEXP L NL
NPSPACE
DSPACE, NSPACE Tight hierarchy. Coming up: Connections with DTIME/NTIME Savitch’ s theorem: NSPACE(S) ⊆ DSPACE(S2) Hence PSPACE = NPSPACE PSPACE-completeness and NL-completeness NSPACE = co-NSPACE
18