Docsity

Computational Complexity: Turing Machines, Computational Problems, and Complexity Measures, Study notes of Computational Methods

Toggle sidebar
bg1
CS221: Computational Complexity Prof. Salil Vadhan
Lecture 2: Turing Machines,Computational Problems,
and Complexity Measures
9/20 Scribe: Noam Zeilberger
Contents
1 Announcements 1
2 Turing Machines 1
3 Computational Problems 2
4 Measuring Complexity 3
1 Announcements
•There will be no class on Monday.
•Professor Vadhan’s office hours next week are Tuesday 10-12, 1-4.
•Reading: Papadimitrou §2, §7.2 (can also scan §1,§3)
2 Turing Machines
To measure complexity, we must fix a precise model of computation. The choice is inessential, but
we shall use multitape Turing Machines (TMs), with the following organization:
1 2 3 a b . . . read-only input tape
h e l l o . . . write-only output tape
...
...
work tapes
finite
state
control
At the start, the input tape contains the input string followed by blanks, while all other tapes are
fully blank. The TM has a special halt state so that we can define the output of a TM Mon input
xas follows:
1
pf3
pf4

Partial preview of the text

Download Computational Complexity: Turing Machines, Computational Problems, and Complexity Measures and more Study notes Computational Methods in PDF only on Docsity!

CS221: Computational Complexity Prof. Salil Vadhan

Lecture 2: Turing Machines,Computational Problems,

and Complexity Measures

9/20 Scribe: Noam Zeilberger

Contents

1 Announcements 1

2 Turing Machines 1

3 Computational Problems 2

4 Measuring Complexity 3

1 Announcements

  • There will be no class on Monday.
  • Professor Vadhan’s office hours next week are Tuesday 10-12, 1-4.
  • Reading: Papadimitrou §2, §7.2 (can also scan §1,§3)

2 Turing Machines

To measure complexity, we must fix a precise model of computation. The choice is inessential, but we shall use multitape Turing Machines (TMs), with the following organization:

1 2 3 a b... read-only input tape

h e l l o... write-only output tape

work tapes

finite state control

At the start, the input tape contains the input string followed by blanks, while all other tapes are fully blank. The TM has a special halt state so that we can define the output of a TM M on input x as follows:

M (x) =

contents of output tape M halts on input x ⊥ otherwise

Formally, a TM is defined as a quadruple M = (K, Σ, δ, s), where K is the set of states, Σ is the alphabet, δ is the transition function (i.e. a function from states to states) and s is the start state. (We will rarely refer to this formalism.)

3 Computational Problems

The most general type of computational problem is the search problem. For a given function S : Σ∗^ → finite subsets of Σ∗, M solves S if ∀x.M (x) ∈ S(x).

There are special cases of the search problem:

  • if ∀x.|S(x)| = 1, then the TM must compute a function.
  • if ∀x.S(x) ∈ {{ 0 } , { 1 }}, then the TM must decide a language, i.e. compute its characteristic function.

3.1 Example: Satisfiability

Let ϕ be a formula in conjunctive normal form (CNF) (e.g. ϕ(x 1 , x 2 , x 3 ) = (x 1 ∨ ¬x 2 ) ∧ (x 1 ∨ x 3 ∨ ¬x 3 )). ϕ is satisfiable if there exists a truth assignment ~x such that ϕ(~x) = true. Satisfiability gives rise to the following computational problems:

  • “decision” — S(ϕ) =

{ 1 } ϕ satisfiable { 0 } otherwise (o.w.)

  • “search” — S(ϕ) =

{satisfying assignments to ϕ} ϕ satisfiable Σ∗^ o.w.

  • “counting” — S(ϕ) = {# satisfying assignments}
  • “approximate counting” — S(ϕ) = {N |. 99 N ≤ # satisfying assignments ≤ 1. 01 N }

You may recall from earlier courses that the decision problem is “hard” (specifically, NP-complete, by Cook’s theorem) for formulas in CNF. All of the other problems listed are hard at least as hard as the decision problem because an algorithm for any of them can be used to solve the decision problem (e.g., if M solves approximate counting, then ϕ is satisfiable if and only if M (ϕ) > 0).

However, it’s not true in general that all of these problems have the same complexity. In the case of DNF (disjunctive normal form, i.e. OR of ANDs), the decision and search problems are easy (examine each conjunction individually). On the other hand, the DNF counting problem is hard, as for each CNF formula ϕ there is a corresponding DNF formula ¬ϕ (by de Morgan’s law), and we have

satisfying assignments to ϕ = 2n^ − # satisfying assignments to ¬ϕ

It is not obvious, but the approximate DNF counting problem is easy.

We’ll touch upon all of these types of problems (and many others) during the course.

  • For any fixed set of inputs and outputs, there exists a TM that computes the function in linear time (by hardwiring a lookup table into the finite-state control). Hence, we are mainly interested in the asymptotics of computational problems.