Professional Documents
Culture Documents
Lecture #42
Sarmad Abbasi
Virtual University
Theory of Computation
1 / 38
Space Complexity
Theory of Computation
2 / 38
Space Complexity
Notice that to count upto n we need a log n-bit counter. Thus you
should think of L as the set of problems that can be solved using a
fixed number of counters. NL is offcourse the non-deterministic
analogue of this class.
Theory of Computation
3 / 38
Space Complexity
We know that
L NL P.
Theory of Computation
4 / 38
Space Complexity
Theory of Computation
5 / 38
Space Complexity
Theory of Computation
6 / 38
Space Complexity
Theory of Computation
7 / 38
Space Complexity
Note that
1
Theory of Computation
8 / 38
Space Complexity
Theory of Computation
9 / 38
Space Complexity
On input x
Set counter=0;
for i = 1 to counter.
5
6
for j = 1 to counter.
print 1.
This machine uses only three counters. They need to be log n bit
counters on input of length n. The output is clearly n2 bits.
Theory of Computation
10 / 38
Space Complexity
Theory of Computation
11 / 38
Space Complexity
Theory of Computation
12 / 38
Space Complexity
Theorem
If B L and A L B then
A L.
This is not trivial. Let us try to give a simple solution for this problem
and see why does it not work.
Theory of Computation
13 / 38
Space Complexity
We know that
A L B
thus there is a log space transducer N computing f such that
x A
if and only if
f (x)
is in B.
Furthermore, we know that B L so there is a TM M that uses
O(log n)
space and accepts B.
Theory of Computation
14 / 38
Space Complexity
Input x.
Theory of Computation
15 / 38
Space Complexity
Theory of Computation
16 / 38
Space Complexity
The first step is to compute f (x) and write it down. Although, it takes
O(log n) space to compute f (x) but writing down f (x) can require a lot
of space. Thus this is NOT a log space TM. We need a new idea.
Theory of Computation
17 / 38
Space Complexity
The new idea is to use what I call the man in the middle attack! Let us
see what the man in the middle attack is. Talk about man in the middle
attack.
Theory of Computation
18 / 38
Space Complexity
Theory of Computation
19 / 38
Space Complexity
Theory of Computation
20 / 38
Space Complexity
Theory of Computation
21 / 38
Space Complexity
This way by using a few extra counters the space requirement of this
TM is
O(log n) + O(log y ).
The lenght of y is at most nk thus the whole procedure takes
log-space.
Theory of Computation
22 / 38
Space Complexity
Theorem
If B L and A L B then
A L.
Notice that we would not be able to prove this theorem if we were
using polynomial time reducibility.
Theory of Computation
23 / 38
Space Complexity
Theory of Computation
24 / 38
Space Complexity
Theory of Computation
25 / 38
Space Complexity
Theory of Computation
26 / 38
Space Complexity
Theory of Computation
27 / 38
Space Complexity
It is easy to see that
Theorem
If co NP 6= NP then P 6= NP.
Thus
NP 6= co NP
is a stronger conjecture than
P 6= NP
conjecture.
Theory of Computation
28 / 38
Space Complexity
Theory of Computation
29 / 38
Space Complexity
Theory of Computation
30 / 38
Space Complexity
Theory of Computation
31 / 38
Space Complexity
Theory of Computation
32 / 38
Space Complexity
It is easy to see that
Theorem
If co NL 6= NL then L 6= NL.
Thus
NL 6= co NL
is a stronger conjecture than
L 6= NL
conjecture.
Theory of Computation
33 / 38
Space Complexity
Theory of Computation
34 / 38
Space Complexity
Theory of Computation
35 / 38
Space Complexity
Theory of Computation
36 / 38
Space Complexity
Theory of Computation
37 / 38
Space Complexity
Theory of Computation
38 / 38