Docsity

Complexity of Problems in Advanced Computational Complexity, Slides of Advanced Computational Complexity

Partial preview of the text

Download Complexity of Problems in Advanced Computational Complexity and more Slides Advanced Computational Complexity in PDF only on Docsity!

Lecture 2: Complexity of Problems

Matthew Johnson

[email protected]

Our Aim

Easy Problems

Impossible Problems

Hard Problems

All languages

Simulations

The following machines can be simulated by a TM with one tape and alphabet { 0 , 1 }: TMs with more than one tape TMs tapes infinite in both directions TMs with 2-dimensional tape (or more!) TMs with several read/write heads on each tape Non-deterministic TMs Random Access Machines

Turing’s Thesis

Any function which can be computed by any well-defined procedure can be computed by a Turing machine.

(Also called Church’s Hypothesis, Sequential Computing Hypothesis)

Decidable Languages

Definition A language L is decidablea^ if there exists an acceptor TM T (with 2 final states qA and qR ), such that If x ∈ L then T (x) halts in state qA If x 6 ∈ L then T (x) halts in state qR aalso known as recursive

T is said to decide the language L — it gives a yes or no answer for each possible string from Σ∗.

Examples

The following languages are decidable: Σ∗ ∅ {x | |x| = 20 } {x | |x| is prime} {x | x encodes a graph G, and a Hamiltonian circuit of G} {x | x is a valid encoding of a TM} (see next slide) all language accepted by finite automata (see Sipser) all languages generated by context-free grammars (see Sipser) Are there undecidable languages? To answer this question we need some preparation ...

Coding Up a TM

Now we can code the elements of the transition function:

[(q 0 , s 2 ), (q 1 , s 3 , L)] ⇒ 01001001000100 [(q 2 , 4 ), (q 3 , s 3 , S)] ⇒ 000110000100010 ... ... ...

Now we can code the whole machine by giving the whole transition function:

1 01001001000100︸ ︷︷ ︸ [(q 0 ,s 2 ),(q 1 ,s 3 ,L)]

[(q 2 , 4 ),(q 3 ,s 3 ,S)]

The Halting Problem

HALTING

Instance : A Turing machine T and an input string x. Question: Does T (x) halt?

Once we choose an encoding for Turing machines, the corresponding language is: LHALTING = {“T ; x” | T (x) terminates} The HALTING problem is undecidable (see Models of Computation)

Other Undecidable Problems

EMPTINESS

Instance : A Turing machine T Question: Is L(T ) empty?

EQUIVALENCE

Instance : Two Turing machines T 1 and T 2 Question: Is it true that L(T 1 ) = L(T 2 )?

Diophantine equations, Penrose tilings; Undecidable problems in software engineering: see http://tinyurl.com/o9e

Classifying Problems

We have seen that decision problems (and their associated languages) can be classified into decidable and undecidable.

Easy Problems Hard Problems

All languages

Decidable languages

Undecidable languages

Dynamic complexity measures

A dynamic complexity measure is a numerical function that measures the maximum resources used by an algorithm to compute the answer to a given instance. To define a dynamic complexity measure we have to define for each possible algorithm M a numerical function φM on the same inputs.

Blum’s Axioms

Blum proposed^2 that any useful dynamic complexity measure should satisfy the following properties: φM (x) is defined exactly when M(x) is defined. The problem: for given M, x, r , does φM (x) = r , is decidable.

(^2) see “A machine-independent theory of the complexity of recursive functions”, Blum, Journal of the ACM 14, pp 322-336, (1967)

Space Complexity

Another important computational resource is the amount of memory used by an algorithm, that is, space. The corresponding complexity measure is called space complexity. Definition The space complexity of a Turing Machine T is the function SpaceT such that SpaceT (x) is the number of distinct tape cell visited during the computation T (x) (Note that if T (x) does not halt, then SpaceT (x) is undefined.)

Plan for the next 10 lectures

Time complexity of decision problems — 6 lectures Space complexity of decision problems — 4 lectures