Documente Academic
Documente Profesional
Documente Cultură
Tasos Viglas
tasos@it.usyd.edu.au
COMP3310- Week 2
Non-determinism
example: Non-deterministic FA
empty transitions
many outgoing arrows for the same symbol
Examples of NFAs
alphabet = {a, b}
L2 = {w|length of w is a multiple of 3}
L3 = L1 L2
Definition of an NFA
a non-deterministic FA is a 5-tuple
(Q, , , q0 , F ):
Q is a finite set of states
is a finite alphabet (set of symbols)
: Q ( {}) P(Q) is the transition function
q0 Q is the starting state
F Q are the final (accepting) states
(Def 1.37p53)
(Th 1.39p55)
Proof: by construction
Q = P(Q)
for R Q , a define
(R, a) = {q Q|q (r, a), r R}
or define (R, a) = rR (r, a)
q0 = {q0 }, and
F = {R Q |R contains a final state of N }
define E(R) =
{all states reachable from R by moves only}
modify definition
(R, a) = {q Q|q E((r, a)), r R}
(end of proof)
A language is regular if and only if
some NFA accepts it
(Corollary 1.40p56)
(Theorems 1.45-49p59)
Proof: by construction
Regular expressions
Assume an alphabet
(Definition 1.52p64)
a
(the empty string)
the empty regular ecpression
(R1 R2 ) , (R1 R2 ) , (R), where R, R1 , R2 are
regular expressions
examples
0 10 = {w|w contains exactly one 1}
1
(0 1) 1(0 1)
(Theorem 1.54p66)
(Lemma 1.55p67)
(Lemma 1.60p69)
Non-regular languages
B = {0n 1n |n 0}
Non-regular languages
Pumping lemma
If A is regular then i
there exists p (pumping length) such that,
if s is any string in A of length at least p
then s may be divided in 3 parts, s = xyz satisfying:
1. for each i 0, xy i z A
2. |y| > 0 and
3. |xy| p
(Theorem 1.70p78)
COMP3310- Week 3
Regular expressions
Assume an alphabet
(Definition 1.52p64)
a
the empty string
the empty regular expression
(R1 R2 ) , (R1 R2 ) , (R), where R, R1 , R2 are
regular expressions
examples
0 10 = {w|w contains exactly one 1}
1
(0 1) 1(0 1)
(Theorem 1.54p66)
(Lemma 1.55p67)
(Lemma 1.60p69)
Generalized NFAs
R1
R4
q
rip
q
j
q
i
(R1)(R2)*(R3)+(R4)
q
R
3
R2
Non-regular languages
B = {0n 1n |n 0}
q1 , . . . , qi , . . . , qi , . . . , qk
(Theorem 1.70p78)
M = (Q, , , q1 , F ), Q = {q1 , . . . , qp }
computational path of M on s is
r1 , . . . , rn+1 , r1 = q1 , and rn+1 F ,
rt+1 = (rt , st ) for 1 t n
Pumping examples -1
Pumping examples -2
Pumping examples -3
E = {O i 1j |i j} (ex. 1.75p81)
consider s = 0p 1p . cases as first example
cases 2 and 3 still give contradictions. but pumping
up the zeroes will not give a contradiction xyyz E
Pump down s = xz = 0pk 1p
COMP3310- Week 3
Problems on FAs
Descriptions
self-reference
Membership
theorem 4.1p166
simulate M on w
Emptiness
theorem 4.4p168
Equivalence
theorem 4.5p169
L = (L(A) L(B))
(L(A)
L(B))
Equivalence of states
Equivalence of states- 1
q1
q2
qk
q0 q1 . . . qk1
a,b
A
a,b
D
a
B X
C X X
D X
X
A B C
a,b
A
BD
a,b
Minimizing automata
Minimizing automata- 1
minimality
minimality- 1
COMP3310- Week 3
CF grammars definition
Derivations
none) is denoted by
L(G) = {w |S w}
notation: A B|01|AA
the first rule usualy refers to the start symbols
(unless stated otherwise)
CF grammars- example
S 0S1|0Z1
Z 0Z|
{0i 1j |i j}
natural languages
Parse trees
leftmost derivations
Ambiguity
RL and CFL
RL CF L
V = Q, S = q0 and R is as follows:
qi x(qi , x), for all qi V and all x
qi , for all qi F
after
B xAy and A
B xAy|xy
A B and B xCy
A xCy , B xCy
A B1 B2 . . . Bk
A B1 A1 , . . . , Ak2 Bk1 Bk
ill-placed terminals a
replace by Ta and add Ta a
c Tasos Viglas, 2005
Chomsky example
CFG S aSb|
COMP3310- Week 5
outline
Stack automata
RL CF L
Stack automaton
Example of a PDA
Definition of a PDA
a push down automaton is a 6-tuple
(Q, , , , q0 , F ):
Q is the finite set of states
is the finite input alphabet
is the finite stack alphabet
: Q P(Q ) is the transition
function
q0 Q is the starting state
F Q are the final (accepting) states
(Def 2.13p111)
Example of a PDA
context free language
L = {a b c |i = j or i = k}
(Example 2.16p113)
i j k
(Theorem 2.20p115)
(Lemma 2.21p115)
(Lemma 2.27p119)
CF grammar to PDA
2. Repeat:
(a) if the top is a variable, non-det. choose a rule for it
and replace A on the stack using that rule. match
any terminals in the beginning of the rules right
part from the input.
(b) if the top is a terminal read the next input symbol
and repeat if they match. if they dont, stop
("reject")
(c) if the stack is empty accept
PDA to CF grammar
RL and CFL
(Corollary 2.32p122)
(Theorem 2.34p115)
v x
u v R
R
x
y
v x y
c Tasos Viglas, 2005
pumping example
(Example 2.36p126)
free
s = ap bp cp = uvxyz
Closure properties
COMP3310- Week 5
outline
This lecture:
Turing machines
multi-tape Turing machines
non-deterministic Turing Machines
Computability
Alan Turing
Alan Turing
1912-1954, UK
Cambridge University, Princeton University
1936, universal machines and the halting problem
Alonzo Church
1903-1995, USA
Princeton University
1936, lambda calculus and undecidable problems
Turing machines
Turing machines
A configuration of a TM consists of
current state, tape contents, head position
Decidable problems
A language is called Turing
recognizable if some Turing machine recognizes it
(definition 3.5p142)
(definition 3.6p142)
Example
(example 3.7p143)
2n
Non-deterministic machines
Enumerators
(theorem 3.13p149)
Dove-tailing
Enumerators
(theorem 3.21p153)
Church-Turing thesis
COMP3310- Week 6
Decidable problems
A language is called Turing
recognizable if some Turing machine recognizes it
A recognizer accepts all yes-inputs. may loop for
ever on no-inputs
Also called recursively enumerable
(definition 3.5p142)
(definition 3.6p142)
Dove-tailing
Enumerators
(theorem 3.21p153)
Defining Computation
Church-Turing thesis
Church-Turing thesis:
computable means
computable by a Turing machine
all proposed computation models are equivalent,
including
Turing machines
-calculus
Recursive functions
Quantum Turing machines
COMP3310- Week 6
Announce
Undecidable problems
Counting infinities
2k
f is ...
if f (a) = f (b) whenever a = b
onto if f (A) = B
correspondence if it is both 1-to-1 and onto
one-to-one
Example: Q = { m
n |m, n N }, the set of rational
numbers is countable
Proofs: by diagonalization
B is uncountable
0 0 0 0 1 0
1 0 0 1 0 0
2 1 1 0 1 0
3 0 1 1 1 0
4 ... ... ... ... ...
...
...
...
...
...
proof by diagonalization
P( )
The set of all infinite binary sequences B is
uncountable
is countable (arrange alphabetically)
Every language corresponds to a characteristic
sequence from B
More on counting
0
1
2
3
4
5
6
0
+1
1
+2
2
+3
3
(0, 0) (0, 1) (1, 0) (0, 2) (1, 1) (2, 0) (0, 3)
a
aa
aaa aaaa aaaaa
...
a
b
aa
ab
ba
bb
Counting N
N is countable,
there is a bijection between N and N
primes p1 = 2, p2 = 3, p3 = 5, p4 = 7, . . .
x = pe11 pe22
525 = p2 p3 p3 p4
Counting N
Consider (n1 , n2 , . . . , nk )
proof by contradiction
Proof by contradiction
Un-recognizable languages
AT M is Turing recognizable
(theorem 4.22p181)
Un-recognizable languages
AT M is not Turing-recognizable
but it is co-Turing-recognizable
Classifying problems
Decidable (Recursive)
Context free
Regular
coRecognizable (coRE)
Recognizable (RE)
Classifying problems
EQ
TM
ATM
nnn
abc
Decidable (Recursive)
Context free
Regular
(0+1)*1
coRecognizable (coRE)
Recognizable (RE)
__
ATM
ww R
Multistack machines
Counter machines
Counter machines
Counter machines
COMP3310- Week 7
Announce
Classifying problems
Decidable (Recursive)
Context free
Regular
coRecognizable (coRE)
Recognizable (RE)
Classifying problems
EQ
TM
ATM
nnn
abc
Decidable (Recursive)
Context free
Regular
(0+1)*1
coRecognizable (coRE)
Recognizable (RE)
__
ATM
ww R
(theorem 5.1p188)
Construct S as follows:
S : On input < M, w >
1. Run R(< M, w >)
2. if R rejects, reject
3. if R accepts, simulate M on w
S solves AT M if R exists
Reductions
Emptiness
(theorem 5.2p189)
undecidable
Emptiness
Regularity
(theorem 5.3p191)
Regularity
Construct M2 : on input x
1. if x is 0n 1n accept
2. otherwise run M (w) and accept if it accepts
Deciding equality
(theorem 5.4p192)
EQT M is undecidable
Reduce ET M to equality
S : on input M
1. run EQT M on < M, T > where T rejects all
inputs
is L(M )
1. context free
2. finite
3.
Rices Theorem
Let P be a non-trivial property of
the language of a TM. Prove that determining if the
language of a given TM has this property is
undecidable
(problem 5.28p213)
Rices theorem
P non-trivial implies T P
Rices theorem
is L(M )
1. context free
2. finite
3.
Reductions
Computation histories
An accepting computation history
of M on w is a sequence of configurations C1 , . . . Ck
(definition 5.5p193)
Ck is an accepting configuration
Computation histories
Deciding CF properties
(theorem 5.13p197)
ALLCF L is undecidable
AT M : does M accept w ?
CFL
x = (C1 , . . . Ck ) G iff
1. C1 is not proper start configuration, or
2. there is an invalid Ci Ci+1
3. last configuration in x is not accepting
CFL
CFL equality
theorem:
EQCF L = {< G1 , G2 >
|G1 , G2 are CFG and L((G1 ) = L(G2 )}
COMP3310- Week 7
bc
a collection of dominos
() * & ' & ' )
*+
b
a
ca
abc
,
,
,
ca
ab
a
c
a collection of dominos
() * & ' & ' )
*+
b
a
ca
abc
,
,
,
ca
ab
a
c
PCP
PCP is undecidable
(theorem 5.15p200)
PCP is undecidable
t1
b1
PCP is undecidable
PCP is undecidable
. qa /
(q, a) = (r, b, R)
br /
. cqa
(q, a) = (r, b, L)
.rcb
/
a
a
& ' a& '
#
#
copy #, add a blank
,
#
&
' &4#
'
aqaccept
qaccept a
a
,
qaccept
qaccept
PCP is undecidable
for u = u1 u2 un define
u = u1 u2 un
u = u1 u2 un
u = u1 u2 un
,& ' & '
& 't1
t2
tk
convert
,
,
.
.
.
,
b1
b2
bk
,& ' & ' & '
& ' & 't1
t1
t2
tk
to
,
,
,
.
.
.
,
,
b1
b1
b2
bk
Mapping reducibility
(definition 5.17p206)
A is mapping reducible to B
written A m B if there is a computable function
f : such that for all w
(definition 5.20p207)
w A f (w) B
The function f is called the reduction from A to B
c Tasos Viglas, 2005
Reducibility
A m B is the same as A m B
Equality of TM languages
EQT M is neither T-recognizable
nor co-T-recognizable
(theorem 5.30p210)
AT M m EQT M
AT M reduces to EQT M
F : on input M, w
1. construct two machines
M1 = reject all inputs
M2 = run M (w) if it accepts, accept
2. output < M1 , M2 >
M (w) accepts
M1 nothing, M2 everything
AT M m EQT M
AT M reduces to EQT M
G: on input M, w
1. construct two machines
M1 = accept all inputs
M2 = run M (w) if it accepts, accept
2. output < M1 , M2 >
M1 nothing, M2 nothing
COMP3310- Week 8
Recursion theory
proving undecidability:
self reference leading to a paradox
Self-reference
define A to be P<B>
A = P<B>
self-reference:
print out this sentence
"this" is a self-reference
no self-reference:
print out two copies of the following, the second in quotes:
Recursion theorem
let t : be a
computable function. There is a TM R that computes
r : such that
(theorem 6.3p220)
recursion theorem
1 , 2 , . . . , m , . . .
AT M is undecidable
define B = on input w
obtain own description < B >
use AT M on < B, w > and
if B(w) halts, loop for ever
otherwise, halt
Minimal TMs
(theorem 6.5p222)
define C = on input w
1. obtain own description < C >
2. run the enumerator E until a machine D appears
with longer description than C
3. simulate D on w
Minimal TMs
(theorem 6.8p223)
(theorem 6.8p223)
define F = on input w
1. obtain own description < F >
2. compute t(< F >) =< G >
3. simulate G on w
Rices theorem
Assume X decides P
define R = on input w :
obtain own description < R >
using the recursion theorem
Run X on < R >
if X accepts, simulate B , else simulate A
COMP3310- Week 8
Logical theories
Examples
Language definition
alphabet
{, , , (, ), , }
Variables x, y, z, w, . . . , x1 , x2 , . . .
Relation symbols R1 , R2 , . . .
Constants and functions can be represented as
relations
Quantifiers ,
Formulas
atomic formula
Ri (xi , . . . , xj )
Formulas
Examples of models
let M = (N , )
a b or b a for all natural numbers
Definition of truth
Theory of M
decidable theory:
the set T h(M) must be decidable
T h(M) is a set of formulas
given a formula, is it a member of T h(M)?
in other words, given a formula, is there a way to
decide if it is true?
Decidable theories
(theorem 6.12p227)
T h(N , +) is decidable
proof:
FAs can (kind of) add numbers
(see problem 1.32p88)
many FA properties are decidable
given a sentence = Q1 x1 Qk xk []
define i = Qi+1 xi+1 Qk xk []
0 = and k =
Decidable theories
Decidable theories
An undecidable theory
(theorem 6.13p229)
T h(N , +, ) is undecidable
(lemma 6.14p229)
An undecidable theory
Given a TM M and a string w we
can construct M,w in the language of T h(N , +, )
with a single free variable x, and
(lemma 6.14p229)
what is a proof?
in a different language
x(0 = Sx)
xy((x = y) (x = y))
(P (0) x(P (x) P (Sx))) xP (x)
arithmetic: (N , +, )
about arithmetic
Provable statements in
T h(N , +, ) is Turing-recognizable
(theorem 6.15p230)
(theorem 6.16p231)
about arithmetic
Some true statement in
T h(N , +, ) is not provable
(theorem 6.16p231)
on input
run P the theorem recognizer of 6.15 in parallel
for both and .
at least one of them will finish
soundness of the system implies that we can
decide the validity of
about arithmetic
There is a sentence u in
T h(N , +, ) that is unprovable
(theorem 6.17p231)
about arithmetic
Turing reducibility
Turing reductions
Example: ET M T AT M
(example 6.19p232) ET M T AT M
ET M is decidable relative to AT M
given an oracle for AT M we can solve ET M
T AT M = on input M
1. construct N = on any input
(a) run M in parallel on all strings
(b) if M accepts any string accept
2. Query the oracle to determine whether N, 0 is in
AT M
3. if NO accept, if YES reject
Turing reducibility
(theorem 6.21p233)
A is decidable
If A m B then A T B
Information
0101010101010101010101010101. . .
0100110101000111010010111101. . .
Descriptions
what is a description?
Encodings
encodings of TM
1. many ways to encode a TM
2. interested in efficient descriptions, so good
encodings will make a difference
3. use this encoding < M > w
Minimal descrptions
the minimal description of x
denoted d(x) is the shortest string < M, w > such
that M (w) outputs x. Define the descriptive or
Kolmogorov complexity of x as
(definition 6.23p236)
K(x) = |d(x)|
(theorem 6.24p236)
cx[K(x) |x| + c]
Descriptive complexity
(theorem 6.25p236)
cx[K(xx) K(x) + c]
cx[K(x) Kp (x) + c]
and c depends only on the choice of p
Incompressible strings
(definition 6.28p239)
x is c-compressible if
K(x) |x| + c
length exist
proof: count
binary strings of length n: 2n
number of descriptions of length up to n 1
0
2i = 2n 1
0in1
Incompressible strings
at least 2n 2nc+ + 1 strings of
length n are incompressible by c
(corollary 6.30p240)
proof:
strings of length n: 2n
descriptions of length up to n c: 2nc+1
Incompressible strings
(theorem 6.31p240)
Incompressible strings
proof idea:
define machine M that on input i finds the i-th
string s that fails f
x can be described as < M, ix > where i is the
index on the above fail-list
the description is short because almost all strings
have the property f and therefore the fail-list is
short
Incompressible strings
Density of primes
we know that
therefore m
log n
log log n
COMP3310- Week 9
Complexity theory
main question:
computability: what is computable ?
complexity: what is computable ?
efficient computation
Classifying problems
Decidable (Recursive)
Context free
Regular
coRecognizable (coRE)
Recognizable (RE)
Complexity
Example: is x N prime?
primality
independent of size of the number x
abstract the complexity of determining primality from the fact
Asymptotics
Running time
(definition 7.1p248)
we say M is a f (n)-time TM or
the running time of M is f (n)
Big Oh
let f, g : N R+ . f (n) = O(g(n))
if positive constants c, n0 exist such that for every
integer n n0
f (n) cg(n)
(definition 7.2p249)
some examples
O(1), nO(1) , O(n + m), . . .
small-oh
(definition 7.5p250)
f (n)
lim
=0
n g(n)
Omegas, ,
(g), (g)
checking {0k 1k }
repeat
1. check odd-even parity of all 0s and 1s.
if odd reject
2. cross-off every other 0 and every other 1
until no 0s or no 1s remain
T IM E(t(n))
for t : N R+ , define T IM E(t(n))
to be the collection of all languages that are
decidable by an O(t(n))-time TM
(definition 7.7p251)
Model dependencies
L = {0k 1k } is in
T IM E(n log n) for single tape deterministic TMs
T IM E(n) for two tape deterministic TMs
for t(n) n any t(n) time multi-tape
TM can be simulated by a single tape t2 (n) machine
(theorem 7.8p254)
non-deterministic computation
(theorem 7.9p256)
Polynomial time
(definition 7.12p258)
Unreasonable models
Problems in P
P AT H P
Problems in P
(theorem 7.16p262)
CFLs in P
COMP3310- Week 9
Polynomial time
(definition 7.12p258)
Problems in P
P AT H P
(theorem 7.15p261)
RELP RIM E P
on input (x, y)
1. repeat until y = 0
(a) x = x mod y = x xy y
(b) swap x and y
2. Output x
Problems in P
(theorem 7.16p262)
CFLs in P
The class N P
N P , a class of problems
Hamiltonian paths
On N P
(definition 7.18p265)
Verifying certificates
examples of certificates
HAM P AT H : a directed path
COM P OSIT ES : a divisor
what about primality?
Definitions of N P
N P is the class of languages that
have polynomial time verifiers
(definition 7.19p266)
(theorem 7.20p266)
N P and non-determinism
(theorem 7.20p266)
N P and non-determinism
(theorem 7.20p266)
non-deterministic time
N T IM E(t(n)) =
{L|L is a language decided by a O(t(n)) NTM }
(definition 7.21p267)
(corollary 7.22p267)
NP =
N T IM E(nk )
non-determinism
views of non-determinism:
1. several choices, computation tree
2. ability to guess: guess (a poly-length string that
defines a path down the tree to an accept) and
verify that your guess was correct
3. for input w , c : P olyCheck(c, w)
P does not need the quantifier. for input w,
P olyCheck(x)
Examples of problems in N P
is P = N P ?
Boolean Satisfiability
for example = (x y) (x z)
literal x, x, clause (x y)
example of cnf: = (x y) (x z)
Boolean Satisfiability
SAT N P
Reducibility
A is mapping reducible to B
written A m B if there is a computable function
f : such that for all w
(definition 5.20p207)
w A f (w) B
The function f is called the reduction from A to B
Poly-time reducibility
a function f : is a
poly-time computable function if some polynomial time
TM on input w halts with f (w) on its tape
(definition 7.28p272)
(definition 7.29p272)
w A f (w) B
The function f is called the polynomial time
reduction from A to B
(theorem 7.32p274)
CLIQU E
N P -completeness
A language B is N P -complete if it
satisfies two conditions:
1. B N P
2. all A in N P polynomially reduce to B :
A N P : A P B
(definition 7.34p276)
Proving N P -completeness
(theorem 7.35p276)
if B is N P -complete and B P
then P = N P
(theorem 7.36p276)
if B is N P -complete and
1. B P C and
2. C N P
then C is N P -complete
N P -completeness
3SAT
(corollary 7.42p282)
3SAT is N P -complete
COMP3310- Week 10
The class N P
N P , a class of problems
Hamiltonian paths
On N P
Definitions of N P
N P is the class of languages that
have polynomial time verifiers
(definition 7.19p266)
(theorem 7.20p266)
(definition 7.18p265)
non-deterministic time
N T IM E(t(n)) =
{L|L is a language decided by a O(t(n)) NTM }
(definition 7.21p267)
(corollary 7.22p267)
NP =
N T IM E(nk )
Boolean Satisfiability
for example = (x y) (x z)
literal x, x, clause (x y)
example of cnf: = (x y) (x z)
Boolean Satisfiability
SAT N P
Poly-time reducibility
a function f : is a
poly-time computable function if some polynomial time
TM on input w halts with f (w) on its tape
(definition 7.28p272)
(definition 7.29p272)
w A f (w) B
The function f is called the polynomial time
reduction from A to B
(theorem 7.32p274)
CLIQU E
N P -completeness
A language B is N P -complete if it
satisfies two conditions:
1. B N P
2. all A in N P polynomially reduce to B :
A N P : A P B
(definition 7.34p276)
Proving N P -completeness
(theorem 7.35p276)
if B is N P -complete and B P
then P = N P
(theorem 7.36p276)
if B is N P -complete and
1. B P C and
2. C N P
then C is N P -complete
N P -completeness
3SAT
(corollary 7.42p282)
3SAT is N P -complete
Cliques
CLIQU E is N P -complete
CLIQU E is in N P and
3SAT reduces to CLIQU E ,
3SAT P CLIQU E
Vertex cover
(theorem 7.44p284)
V ERT EXCOV ER is
N P -complete
Hamiltonian paths
(theorem 7.46p286)
HAM P AT H is N P -complete
U HAM P AT H is N P -complete
Sub-set sums
(theorem 7.55p291)
SU BSET SU M is N P -complete
2SAT
2SAT P
COMP3310- Week 11
Space complexity
Space complexity
The space complexity of a
deterministic TM M is the function f : N N where
f (n) is the maximum number of tape cells that M
uses on any input of length n
(definition 8.1p303)
Space complexity
the space complexity classes
SP ACE(f (n)) and N SP ACE(f (n)) are defined as
follows:
SP ACE(f (n)) = {L| there exists a deterministic
TM that decides L in space f (n)}
N SP ACE(f (n)) = {L| there exists a
non-deterministic TM that decides L in space
f (n)}
(definition 8.2p304)
Example
Example
Savitchs theorem
(theorem 8.5p306)
Savitchs theorem
CAN Y IELD(c1 , c2 , t) :
1. t = 1, test c1 = c2 or c1 leads to c2 directly (check
N s transition function)
2. for each configuration cm of N on input w
3. run CAN Y IELD(c1 , cm , t/2)
4. run CAN Y IELD(cm , c2 , t/2)
5. if such a mid-point is found, accept
6. otherwise reject
P SP ACE
P SP ACE is the class of
languages that are decidable in polynomial space on
a deterministic TM
(definition 8.6p308)
P SP ACE = k SP ACE(nk )
P SP ACE -completeness
a language B is called
P SP ACE -complete if it satisfies two conditions:
1. B P SP ACE
2. for every A P SP ACE , A P B
(definition 8.8p309)
COMP3310- Week 11
On N P
Fagins theorem
P SP ACE
P SP ACE is the class of
languages that are decidable in polynomial space on
a deterministic TM
1
P SP ACE =
SP ACE(nk )
(definition 8.6p308)
P SP ACE -completeness
a language B is called
P SP ACE -complete if it satisfies two conditions:
1. B P SP ACE
2. for every A P SP ACE , A P B
(definition 8.8p309)
Quantified formulas
examples:
x(x + 1 > x)
xy[(x y) (x y)]
T QBF
proof:
T QBF P SP ACE : try out all possible
assignments, reusing space
all of P SP ACE reduces to T QBF : encode the
simulation of any P SP ACE computation by a
formula
T QBF P SP ACE
Logspace
L and N L
Is there a path ?
(open) question L = N L?
log-space reducibility
a log -space transducer is a TM
with a read only input tape and a write-only output
tape that works in O(log n) space. the transducer
computes a function f :
(definition 8.21p324)
N L-completeness
(definition 8.22p324)
a language B is N L-complete if
1. B N L
2. every A N L is log-space reducible to B
Path is N L-complete
(theorem 8.25p325)
PATH is N L-complete
(corollary 8.26p326)
NL P
N L versus co-N L
(theorem 8.27p327)
N L = co-N L
Complexity classes
L N L = co-N L P P SP ACE
COMP3310- Week 12
Complexity classes
complexity within P ? or N P ?
Hierarchies
L P N P P SP ACE
Time hierarchies
Constructibility
a function t : N N, where
t(n) = (n log n) is called time-constructible if it is
computable in time O(t(n))
(definition 9.8p340)
(definition 9.1p336)
(theorem 9.10p341)
D on input w:
1. let n be the length of w
2. compute t(n) and store the value t/ log t in a
counter. decrement this counter before every TM
step of 3,4,5
3. if w is not < M > 10 reject
4. simulate M on w
5. if M accepts then reject. if M rejects, accept
time hierarchy
(corollary 9.12p343)
0 1 2
DT IM E(n1 ) DT IM E(n2 )
(corollary 9.13p343)
P EXP T IM E
Space hierarchy
for any space constructible function
f a language A exists that is decidable in space
O(f (n)) but not in o(f (n))
(theorem 9.3p337)
space hierarchy
(corollary 9.4p339)
0 1 2
SP ACE(n1 ) SP ACE(n2 )
(corollary 9.4p339)
N L P SP ACE
non-deteministic hierarchies
Probabilistic algorithms
Approximation algorithms
More complexity
randomization, pseudo-randomness
lower bounds
COMP3310- Week 12
Problems in N P
Probabilistic algorithms
Approximation algorithms
P versus N P
Algorithmica
P = N P (or N P BP P )
practical stuff
VLSI design, layout optimization
programming: no need to describe how to do
things, just describe what the output should be
machine learning, AI, natural languages
proofs for any theorem
Algorithmica
Heuristica
Heuristica
Heuristica
Pessiland
crypto
privacy, anonymity