




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Some concept of Automata and Complexity Theory are Administrivia, Closure Properties, Context-Free Grammars, Decision Properties, Deterministic Finite Automata, Intractable Problems, More Undecidable Problems. Main points of this lecture are: Intractable Problems, Time-Bounded Turing Machines, Classes, Polynomial-Time Reductions, Multitape, Nondeterministic, Deterministic, Multitape, Running-Time Algorithm, Corresponds
Typology: Slides
1 / 28
This page cannot be seen from the preview
Don't miss anything!
1
Time-Bounded Turing Machines
Classes
and
Polynomial-Time Reductions
2
A Turing machine that, given an input of length n, always halts within T(n)moves is said to be
The TM can be multitape.
Sometimes, it can be nondeterministic.
The deterministic, multitape case corresponds roughly to “an O(T(n))running-time algorithm.”
4
A multitape TM can simulate a computer that runs for time O(T(n)) inat most O(T
2
(n)) of its own steps.
If T(n) is a polynomial, so is T
2
(n).
5
Is w in L(G), for a given CFG G?
Input = w.
Use CYK algorithm, which is O(n
3
).
Is there a path from node x to node y in graph G?
Input = x, y, and G.
Use Dijkstra’s algorithm, which is O(n log n)on a graph of n nodes and arcs.
7
The
is: given positive
integers i
1
, i
2
,…, i
n
, can we divide them
into two sets with equal sums?
Perhaps we can solve this problem in polytime by a dynamic-programmingalgorithm:
Maintain a table of all the differences we can
achieve by partitioning the first j integers.
8
Basis: j = 0.
Initially, the table has
“true” for 0 and “false” for all otherdifferences.
Induction: To consider i
j
, start with a
new table, initially all false.
Then, set k to true if, in the old table, there is a value m that was true, and kis either m+i
j
or m-i
j
10
Since n < m, we can build the final table in O(m
2
) time.
From that table, we can see if 0 is achievable and solve the problem.
11
“Input size” has a specific meaning: the length of the representation of theproblem instance as it is input to a TM.
For the Knapsack Problem, you cannot always write the input in a number ofcharacters that is polynomial in eitherthe number-of or sum-of the integers.
13
Thus, the proposed “polynomial” algorithm actually takes time O(n
2
n
) on
an input of length O(n
2
Or, since we like to use n as the input size, it takes time O(n
sqrt(n)
) on an
input of length n.
In fact, it appears no algorithm solves Knapsack in polynomial time.
14
We are free to describe another problem, call it
where integers are represented inunary.
Pseudo-Knapsack is in
16
The Knapsack Problem is definitely in NP
, even using the conventional binary
representation of integers.
Use nondeterminism to guess one of the subsets.
Sum the two subsets and compare.
17
Originally a curiosity of Computer Science, mathematicians now recognizeas one of the most important openproblems the question
There are thousands of problems that are in
but appear not to be in
But no proof that they aren’t really in
19
A complete problem for a class embodies every problem in the class,even if it does not appear so.
Compare: PCP embodies every TM computation, even though it does notappear to do so.
Strange but true: Knapsack embodies every polytime NTM computation.
20
Goal: find a way to show problem
to
be NP-complete by reducing everylanguage/problem in
to
in such a
way that if we had a deterministicpolytime algorithm for
construct a deterministic polytimealgorithm for any problem in