Title: CSci 5403 Lecture 1
1CSci 5403
COMPLEXITY THEORY
LECTURE I THINGS YOU ALREADY KNOW
2Complexity theory studies the inherent
limitations of computing with bounded resources,
such as
Time
Space
Spacetime
Parallel time
Number of random bits
Ominiscient Advice
Interaction
Communication
Because we are interested in what cannot be
done, we use proofs, mathematics, and logic.
3GRADING
- 15 HOMEWORKS 40
- 5 TAKE HOME EXAMS 40
- 4 HW SOLUTIONS 20
4HOMEWORK
Every Tuesday Homework will be due at the start
of lecture. New Homework will be posted on the
web.
Each Homework is 4 questions.
You may choose to work in groups of up to 3.
Every homework must be typeset using LaTeX.
You must list all references used in every
homework assignment
5EXAMS
5 Take-Home exams dates already set
Each exam is 1 or 2 questions.
Posted at noon, due at beginning of next lecture.
Worst exam score dropped
6HW SOLUTIONS
Each student will be assigned 4 homework problems
and asked to provide an example solution for each.
Example solutions must be textbook-quality.
Iteration may be required. Accepted
solutions will be posted to the class website.
To satisfy the requirement, 3 must be
accepted within one week of due date, and all 4
eventually.
7OVERVIEW
Lectures
Topic
Time Space complexity Complexity in the 70s
1-6
Randomness, nonuniformity, and counting.
7-16
17-19, 26-30
Probabilistic proof systems
20-25
Its easy because its hard Crypto and
Derandomization
8CS5403.info
9TODAY SOME BASICS
10NOTATION
An alphabet S is a finite set (e.g., S 0,1)
A string over S is a finite-length sequence of
elements of S
For x a string, x is
the length of x
The unique string of length 0 will be denoted by
e and will be called the empty or null string
A language over S is a set of strings over S
11COMPUTING OUTPUT FROM INPUT
,
CALCULATING A FUNCTION OF A STRING
,
DECIDING IF A STRING IS IN A SET
12BIG-O AND FRIENDS
Let f and g be two functions f, g N ? R. Then
f(n) O(g(n)) if 9 c 0 . 9 n0 . 8 n ? n0,
f(n) ? cg(n).
f(n) o(g(n)) if 8 c 0. 9 n0 . 8 n ? n0, f(n)
? cg(n).
f(n) O(g(n)) if 9 c 0 . 9 n0 . 8 n ? n0,
f(n) cg(n).
f(n) ?(g(n)) if ? c 0 . 9 n0 . 8 n ? n0,
f(n) cg(n).
f(n) T(g(n)) if f(n) O(g(n)) and g(n)
O(f(n)).
Let f(n) n2 3n, g(n) 17n2, h(n) 72n log n
13TURING MACHINE
q0
q1
I
N
P
U
T
A
UNBOUNDED TAPE
14Definition A Turing Machine is a 7-tuple T
(Q, S, G, ?, q0, qaccept, qreject), where
Q is a finite set of states
S is the input alphabet, where ? ? S
G is the tape alphabet, where ? ? G and S ½ G
? Q ? G ? Q ? G ? L,R
q0 ? Q is the start state
qaccept ? Q is the accept state
qreject ? Q is the reject state, and qreject ?
qaccept
15CONFIGURATIONS
11010q700110
16COMPUTATIONS
When a TM computes on input x x1x2xn (xn 2 S)
It is initialized to configuration C0 q0x
For each i, the TM applies ? to Ci-1 to derive Ci.
If configuration Ck is in state qaccept (or
qreject), the TM halts and accepts (or rejects) x
in k steps.
The sequence C0, C1, , Ck is the computation of
the TM on x.
17C0q0ab C1q2b C2bq4 C3q3b C4q1 C5q
0 C6qr
tableau
18MULTITAPE TURING MACHINES
INPUT TAPE (READ ONLY)
OUTPUT TAPE (WRITE ONLY)
k-1 WORK TAPE(s)
? Q ? Gk ? Q ? Gk ? L,R,Sk
19We can encode a TM as a string of 0s and 1s
ltMgt ltn,m,t,?gtwhere
n number of states m size of input
alphabet t size of tape alphabet ? is
encoded by a list of tuples ltq,?1,,?k,q,?1,,
?k,d1,,dk gt
And q0, qaccept, qreject, ? are implicit.
20Definition Let M be a TM that halts on all
inputs. The running time or time-complexity of M
is the function t N ? N, where t(n) is the
maximum number of steps that M uses on any input
of length n.
Definition M computes f in t(n) time if on input
x it computes f(x) in at most t(x) steps.
Theorem Let t(n) be a function such that t(n) ?
n. Then every t(n)-time multi-tape TM has an
equivalent O(t(n)2) single tape TM
21SIMULATING MULTIPLE TAPES
?
?
?
?
L1000?R
L10001R
L100??R
100
qi
qi1
qi1?
qi1??
qjRSS
qj
qj101RSS
1. Format tape.
2. For each move of the k-tape TM
Scan left-to-right, finding current symbols
Scan left-to-right, writing new symbols
Scan left-to-right, moving each tape head
If a tape head goes off right end, insert
blank. If tape head goes off left end, move back
right.
22WHY USE BIG-O?
Constants dont matter!
Suppose there is a k-state TM for L that runs in
time t(n).
Then there is a O(k2c)-state TM for L that runs
in time t(n)/c
1
0
1
0
1
1
0
1
1
0
1
0
1
1
1
0
10
10
11
01
10
10
11
10
23SIMULATION
Theorem For any t, there exists a TM St
such that St(M,x) accepts iff M accepts x in time
t(x). St runs in time O(nt(n)2).
Proof Idea Use 4 work tapes
Contents of Ms tape(s) and tape head(s)
Ms transition function Ms state
clock ?(t(x) times)?
scratch space current ?, states,
t must be time constructible there is a TM M
s.t. M(x) t(x) and M runs in time O(t(n)).
24FIRST COMPLEXITY CLASS
Definition DTIME(t(n)) L L is a language
decided by a O(t(n)) time Turing Machine
P is the class of problems that can be solved in
polynomial time they are efficiently decidable
25WHY P?
Many t(n) time variants of TMs can be simulated
In time O(t(n)c) by a single-tape TM, including
TMs with double-unbounded tape O(t(n))
Multi-tape TMs O(t2(n))
RAM Machines O(t6(n))
Polynomials are the simplest class of
functions closed under composition,
multiplication, etc
They grow slowly compared to exponentials
26CS5403.info