Lecture 1-5
Hierarchy Theorem
Space Hierarchy Theorem
Space-constructible function
• s(n) is fully space-constructible if there
exists a DTM M such that for sufficiently
large n and any input x with |x|=n,
SpaceM(x) = s(n).
Space Hierarchy
If
• s2(n) is a fully space-constructible function,
• s1(n)/s2(n) → 0 as n → infinity,
• s1(n) > log n,
then
DSPACE(s2(n)) DSPACE(s1(n)) ≠ Φ
DSPACE( s1 ) {L1 , L2 ,...}
L {xn | xn Ln } DSPACE( s1 )
L1
L2
Ln
x1
x2
xn
xn Ln ?
DSPACE( s1 ) {L( M 1 ), L( M 2 ),...}
L {M n | M n L( M n )} DSPACE ( s1 )
M1
M2
Mn
M1
M2
Mn
M n L( M n ) ?
Design a DTM M * working in the following way.
On input x with | x | n, it computes in at most 3 steps.
Step 1. Mark s2 (n) cells on storage tapes.
Input tape
(read only)
x1 x2 xn B
s2 (n)
Storage
tapes
Output tape
(possibly, write only)
Step 2. Check if x is a DTM code.
If x is not a DTM code, then reject x.
If x is a code of DTM M , then go to Step 3.
Step 3. Simulate M on x within marked space
and within t (n) time.
If M cannot accept x within marked space
and within t (n) time, then M * accepts x;
otherwise, M * rejects x.
What is t (n) ?
If M on x runs more than t (n) time, then M fells into a loop.
Input tape
(read only)
x1 x2 xn B
s2 (n)
Storage
tapes
Output tape
(possibly, write only)
t (n) (n 1)c s2 ( n ) s2 (n)
It is obvious that L(M *) DSPACE(s2 (n)).
Claim L(M *) DSPACE(s1 (n)).
Proof For each L DSPACE ( s1 (n)), there is a DTM M with
space bound s1 (n) such that L L( M ).
Since s1 (n) / s2 (n) 0 as n , there exists n0 0 such
that for n n0 , s2 (n) s1 (n).
Choose a code x of DTM M such that | x | n0 .
Then M * can complete the simulation for M on x.
That is, x L( M *) x L( M ) L. Thus, L L( M *).
Why we need s1 (n) / s2 (n) 0 as n ?
Claim L(M *) DSPACE(s1 (n)).
Proof For each L DSPACE ( s1 (n)), there is a DTM M with
space bound s1 (n) such that L L( M ).
M may have much more tape symbols than M * and may
require h symbols of M * to represent one of M .
Since s1 (n) / s2 (n) 0 as n , there exists n0 0 such
that for n n0 , s2 (n) h s1 (n).
Choose a code x of DTM M such that | x | n0 .
Then M * can complete the simulation for M on x.
That is, x L( M *) x L( M ) L. Thus, L L( M *).
Why we need s1 (n) / s2 (n) 0 as n ?
Claim L(M *) DSPACE(s1 (n)).
Proof
For each L DSPACE ( s1 (n)), there is a DTM M with
space bound s1 (n) such that L L( M ).
M may also have much more tapes than M * . However,
there exists one tape TM to simulate M with same space
bound. Therefore, it sufficient to have condition
s1 (n) / s2 (n) 0 as n .
Choose a code x of DTM M such that | x | n0 .
Then M * can complete the simulation for M on x.
That is, x L( M *) x L( M ) L. Thus, L L( M *).
Why ask s1 (n) log n ?
To determine whether M gets into a loop , M * needs to count
the number of moves of M . The counter needs space
log t (n) log( n 1) log s1 (n) s1 (n)log c
(3 log c) s1 (n)
since s1 (n) log n.
Because s1 (n) / s2 (n) 0 as n , there is a natural number n1
such that s2 (n) (3 log c) s1 (n) for n n1.
Choose a code x of M such that n max( n0 , n1 ).
Time Hierarchy
Time-constructible function
• t(n) is fully time-constructible if there exists
a DTM such that for sufficiently large n
and any input x with |x|=n,
TimeM(x) = t(n).
Time Hierarchy
If
• t1(n) > n+1,
• t2(n) is fully time-constructible,
• t1(n)2 /t2(n) → 0 as n → infinity,
then
DTIME(t2(n)) DTIME(t1(n)) ≠ Φ
DTIME (t1 ) {L( M 1 ), L( M 2 ),...}
L {M n | M n L( M n )} DTIME (t1 )
M1
M2
Mn
M1
M2
Mn
M n L( M n ) ?
Design a DTM M * with a clock and working in the
following way. On input x with | x | n, it computes
in at most 2 steps.
Input tape
(read only)
x1 x2 xn B
Storage
tapes
clock
Output tape
(possibly, write only)
t2 (n)
Step 1. Check if x is a DTM code.
If x is not a DTM code, then reject x.
If x is a code of DTM M , then go to Step 2.
Step 2. Simulate M on x within t (n) time.
If M cannot accept x within t (n) time,
then M * accepts x;
otherwise, M * rejects x.
It is obvious that L(M *) DTIME (t2 (n)).
Claim
L(M *) DTIME (t1 (n)).
Proof For each L DTIME (t1 (n)), there is a DTM M with
time bound t1 (n) such that L L( M ).
Since t1 (n) / t 2 (n) 0 as n , there exists n0 0 such
that for n n0 , t 2 (n) t1 (n).
Choose a code x of DTM M such that | x | n0 .
Then M * can complete the simulation for M on x. ?
That is, x L( M *) x L( M ) L. Thus, L L( M *).
Why we need t1 (n) 2 / t2 (n) 0 as n ?
Claim L(M *) DTIME (t1 (n)).
Proof
For each L DTIME (t (n)), there is a DTM M with time
1
bound t1 (n) such that L L( M ).
M may have much more tape symbols and much more tapes than M * .
Thus, it may require h symbols of M * to represent one of M , which
requies t1 (n) / t 2 (n) 0 as n , i.e., there exists n0 0 such that
for n n0 , t 2 (n) h t1 (n).
It also requires to use a fixed number of tapes to simulate M . Since
k - tape TM with time bound t1 (n) can be simulated by one - tape TM
with time bound t1 (n) 2 , we need t1 (n) 2 / t 2 (n) 0 as n , i.e.,
n0 : for n n0 , t 2 (n) h t1 (n) 2 .
Choose a code x of DTM M such that | x | n0 .
Then M * can complete the simulation for M on x.
That is, x L( M *) x L( M ) L. Thus, L L( M *).
Any k - tape TM with time bound t1 (n) can be simulated
by two - tape TM with time bound t1 (n) log t1 (n).
If
• t1(n) > n+1,
• t2(n) is fully time-constructible,
• t1(n) log t1(n) /t2(n) → 0 as n →
infinity,
then
DTIME(t2(n)) DTIME(t1(n)) ≠ Φ
Time Hierarchy
If
• t1(n) > n+1,
• t2(n) is fully time-constructible,
• t1(n) log t1(n) /t2(n) → 0 as n → infinity,
then
DTIME(t2(n)) DTIME(t1(n)) ≠ Φ
Model Independent Classes
c
• P = U c>0 DTIME(n )
cn
• EXP = U c > 0 DTIME(2 )
n
c
• EXPOLY = U c > 0 DTIME(2 )
c
• PSPACE = U c > 0 DSPACE(n )
P EXP
Since n c 2 n / 2 for sufficient ly large n,
we have DTIME (n c ) DTIME (2 n / 2 ).
Thus, P DTIME (2 n / 2 ).
2 n / 2 log 2 n / 2 n / 2
Since
n / 2 0 as n ,
n
2
2
we have DTIME (2 n / 2 ) DTIME (2 n ) EXP.
Hence, P EXP.
EXP EXPOLY
Since 2 2
cn
n2 / 2
for sufficient ly large n,
we have DTIME (2 ) DTIME (2
cn
Thus, EXP DTIME (2
Since
2n
2
/2
log 2 n
2
2
/2
n2
we have DTIME (2
n2 / 2
0 as n ,
) DTIME (2 ) EXPOLY .
n2
Hence, EXP EXPOLY .
).
).
n2 / 2
2
n2 / 2
n2 / 2
n2 / 2
PSPACE≠EXP
First, note that EXP DTIME (2 ) DTIME (2 ).
For contradict ion, suppose PSPACE EXP.
n2 / 2
Consider any L DTIME (2 ).
n2
| x|2 | x|
Define L' {x$
| x L}.
Then L' DTIME (2 n ) EXP PSPACE.
So, L' DSPACE (n c ) for some c 0.
Hence, L DSPACE (( n ) ) PSPACE EXP.
2 c
Therefore, DTIME (2 ) EXP ().
n2
n2
PSPACE EXPOLY
?
DSPACE(s(n)) DTIME ((n 1)n s ( n) s(n))
Problems in P
• Are they in P?
Sorting
minimum spanning tree
shortest path
maximum flow
Problems in P
• None of following is in P?
Sorting
minimum spanning tree
shortest path
maximum flow
• They are all polynomial-time computable
functions
P contains only languages or decision
problems
• A decision problem is a problem who has
only two answers, YES and NO.
• A decision problem can be described by a
language consisting of all inputs at which
YES answer would be obtained.
Every optimization problem has a
decision version
Minimum spanning tree
Given a graph G (V , E ), compute a spanning
tree with minimum total edge length.
Decision version of minimum spanning tree
Given a graph G (V , E ) and k 0, is a spanning
tree with tota l edge length k ?
Given a graph G (V , E ) and k 0, determine
whether th ere exist a spanning tree with tota l edge
length k .
For optimization problem with integer value,
the decision version is equivalent to it.
Problem in EXP
•
•
•
•
•
Traveling Salesman Problem
Minimum Vertex Cover
Hamiltonian Cycle
Satisfiability
Partition
Edmonds Conjecture in 1965
• Traveling Salesman Problem cannot be
solved in polynomial time.
© Copyright 2026 Paperzz