Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Intractable Problems - Automata and Complexity Theory - Lecture Slides, Slides of Theory of Automata

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

2012/2013

Uploaded on 04/29/2013

juni
juni 🇮🇳

4

(17)

122 documents

1 / 28

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Intractable Problems
Time-Bounded Turing Machines
Classes Pand NP
Polynomial-Time Reductions
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download Intractable Problems - Automata and Complexity Theory - Lecture Slides and more Slides Theory of Automata in PDF only on Docsity!

1

Intractable Problems

Time-Bounded Turing Machines

Classes

P

and

NP

Polynomial-Time Reductions

2

Time-Bounded TM’s

A Turing machine that, given an input of length n, always halts within T(n)moves is said to be

T(n)-time bounded.

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

Polynomial Equivalence of

Computers and TM’s

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

Examples of Problems in

P

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

A Tricky Case: Knapsack

The

Knapsack Problem

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

Knapsack – (2)

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

Knapsack – (4)

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

Subtlety: Measuring Input Size 

“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

Bad Case – (2)

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

Redefining Knapsack

We are free to describe another problem, call it

Pseudo-Knapsack,

where integers are represented inunary.

Pseudo-Knapsack is in

P

16

Example:

NP

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

P

Versus

NP

Originally a curiosity of Computer Science, mathematicians now recognizeas one of the most important openproblems the question

P

NP

There are thousands of problems that are in

NP

but appear not to be in

P

But no proof that they aren’t really in

P

19

Complete Problems – Intuition

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

Polytime Reductions

Goal: find a way to show problem

L

to

be NP-complete by reducing everylanguage/problem in

NP

to

L

in such a

way that if we had a deterministicpolytime algorithm for

L, then we could

construct a deterministic polytimealgorithm for any problem in

NP