← All writing

Introduction to Theory of Computation (2)

Computability and Complexity

Parts: 1 · 2

Part Two: Computablity Theory

Chapter Three: The Church-Turing Thesis

3.3 Turing Machine

A Turing machine is a 7-tuple (Q,Σ,Γ,δ,q0,qaccept,qrejet)(Q, \Sigma, \Gamma, \delta, q_0, q_{accept}, q_{rejet}), where Q,Σ,ΓQ, \Sigma, \Gamma, and FF are all finite sets, and

  1. QQ is the set of states

  2. Σ\Sigma is the input alphabet not containing the blank symbol ⊔\sqcup

  3. Γ\Gamma is the tape alphabet, where ⊔∈Γ\sqcup \in\Gamma and Σ⊆Γ\Sigma \subseteq \Gamma

  4. δ:Q×Γ→Q×Γ×{L,R}\delta : Q \times \Gamma\rarr Q \times \Gamma \times\{L, R\} is the transiton function

  5. q0∈Qq_0 \in Q is the start states

  6. qaccept∈Qq_{accept} \in Q is the accept state

  7. qreject∈Qq_{reject} \in Q is the reject state, where qreject≠qacceptq_{reject} \ne q_{accept}

As a Turing machine computes, changes occur in the current state, the current tape contents, and the current head location. A setting of these three items is called a configuration of the Turing machine.

3.5 Turing-recognizable

Call a language Turing-recognizable (or recursively enumerable language) if some Turing machine recognizes it.

3.6 Turing-decidable

Call a language Turing-decidable or simply decidable if some Turing machine decides it.

3.13 Theorem (Multitape Turing Machine)

Every multitape Turing machine has an equivalent single-tape Turing machine.

A multitape Turing machine is like an ordinary Turing machine with several tapes.

3.16 Theorem (Nondeterministic Turing Machine)

Every nondeterministic Turing machine has an equivalent deterministic Turing machine.

A nondeterministic Turing machine is defined in the expected way. At any point in a computation, the machine may proceed according to several possibilities. The transition function for a nondeterministic Turing machine has the form

δ:Q×Γ→P(Q×Γ×{L,R})\delta: Q \times \Gamma \rarr P(Q \times \Gamma \times \{L, R\})

3.21 Theorem

A language is Turing-recognizable if and only if some enumerator enumerates it.

Loosely defined, an enumerator is a Turing machine with an attached printer. The Turing machine can use that printer as an output device to print strings.

Church–Turing Thesis

Intuitive notion of algorithms equals Turing machine algorithms

Chapter Four: Decidablity

4.1 Theorem

ADFAA_{DFA} is a decidable language.

ADFA={<B,w> ∣ B is a DFA that accepts input string w}A_{DFA} = \{<B, w> \ | \ B \ is\ a \ DFA \ that \ accepts \ input \ string \ w \}

Hence this theorem shows that the problem of testing whether a given finite automaton accepts a given string is decidable.

4.2 Theorem

ANFAA_{NFA} is a decidable language.

4.3 Theorem

AREXA_{REX} is a decidable language.

AREX={<R,w> ∣ B is a regular expression that generates string w}A_{REX} = \{<R , w> \ | \ B \ is\ a \ regular \ expression \ that \ generates \ string \ w \}

4.4 Theorem

EDFAE_{DFA} is a decidable language.

EDFA={<A> ∣ A is a DFA and L(A)=∅}E_{DFA} = \{ <A> \ | \ A \ is \ a \ DFA \ and \ L(A) = \empty\}

4.5 Theorem

EQDFAEQ_{DFA} is a decidable language.

EQDFA={<A,B> ∣ A and B are DFAs and L(A)=L(B)}EQ_{DFA} = \{<A, B> \ | \ A \ and \ B \ are \ DFAs \ and \ L(A) = L(B)\}

4.7 Theorem

ACFGA_{CFG} is a decidable language.

ACFG={<G,w> ∣ G is a CFG that generates string w}A_{CFG} = \{<G, w> \ |\ G \ is\ a\ CFG \ that\ generates\ string\ w\}

4.8 Theorem

ECFGE_{CFG} is a decidable language.

ECFG={<A> ∣ A is a CFG and L(A)=∅}E_{CFG} = \{ <A> \ | \ A \ is \ a \ CFG \ and \ L(A) = \empty\}

EQCFGEQ_{CFG} is NOT decidable

Next, we consider the problem of determining whether two context-free grammars generate the same language

EQCFG={<G,H> ∣ G and H are CFGs and L(G)=L(H)}EQ_{CFG} = \{<G, H> \ | \ G \ and \ H \ are \ CFGs \ and \ L(G) = L(H)\}

However, it is NOT decidable.

4.9 Theorem

Every context-free language is decidable.

4.11 Theorem

ATMA_{TM} is undecidable.

ATM={<M,w> ∣ M is a TM that accepts string w}A_{TM} = \{<M, w> \ |\ M \ is\ a\ TM \ that\ accepts\ string\ w\}

4.18 Corollary

Some languages are not Turing-recognizable.

4.22 Theorem

A language is decidable exactly when both it and its complement are Turing-recognizable.

Recall that the complement of a language is the language consisting of all strings that are not in the language.

Chapter Five: Reduciblity

5.1 Theorem

HALTTMHALT_{TM} is undecidable

HALTTM={<M,w> ∣ M is a TM and M halts on input w}HALT_{TM} = \{<M, w> \ | \ M \ is \ a\ TM\ and\ M \ halts\ on\ input\ w \}

5.2 Theorem

ETME_{TM} is an undecidable language.

ECFG={<M> ∣ M is a TM and L(M)=∅}E_{CFG} = \{ <M> \ | \ M \ is \ a \ TM \ and \ L(M) = \empty\}

5.3 Theorem

REGULARTMREGULAR_{TM} is a undecidable.

We let REGULARTMREGULAR_{TM} be the problem of determining whether a given Turing machine has an equivalent finite automaton

5.4 Theorem

EQTMEQ_{TM} is undecidable.

5.5 Computation History

An accepting computation history for MM on ww is a sequence of configurations, C1,C2,...,ClC_1, C_2, . . . , C_l, where C1C_1 is the start configuration of MM on ww, ClC_l is an accepting configuration of MM, and each CiC_i legally follows from Ci−1C{i-1} according to the rules of MM.

Computation histories are finite sequences.

5.6 Linear Bounded Automaton

A linear bounded automaton is a restricted type of Turing machine wherein the tape head isn’t permitted to move off the portion of the tape containing the input. If the machine tries to move its head off either end of the input, the head stays where it is—in the same way that the head will not move off the left-hand end of an ordinary Turing machine’s tape.

Despite their memory constraint, linear bounded automata (LBAs) are quite powerful. For example, the deciders for ADFA,ACFG,EDFA,and ECFGA_{DFA}, A_{CFG}, E_{DFA}, and\ E_{CFG} all are LBAs. Every CFL can be decided by an LBA.

5.8 Lemma

Let M be an LBALBA with qq states and gg symbols in the tape alphabet. There are exactly qngnqng^n distinct configurations of MM for a tape of length nn.

5.9 Theorem

ALBAA_{LBA} is decidable.

ALBA={<M,w> ∣ M is an LBA that accepts string w}A_{LBA} = \{<M, w> \ |\ M \ is\ an\ LBA \ that\ accepts\ string\ w\}

5.10 Theorem

ELBAE_{LBA} is undecidable.

5.13 Theorem

ALLCFGALL_{CFG} is undecidable.

ALLCFG={<G> ∣ G is a CFG and L(G)=Σ∗}ALL_{CFG} = \{<G>\ |\ G\ is\ a\ CFG\ and\ L(G) = \Sigma^∗\}

5.17 Computable Function

AA function f:Σ∗→Σ∗f : \Sigma^∗\rarr\Sigma^∗ is a computable function if some Turing machine MM, on every input ww, halts with just f(w)f(w) on its tape.

5.18 Mapping Reducible

Language AA is mapping reducible to language B, written A≤mBA \le_m B, if there is a computable function f:Σ∗→Σ∗f : \Sigma^∗\rarr\Sigma^∗, where for every ww,

w∈A⇔f(w)∈Bw \in A \Lrarr f(w) \in B

The function ff is called the reduction from AA to BB.

5.19 Theorem

If A≤mBA \le_m B and BB is decidable, then AA is decidable.

5.23 Theorem

If A≤mBA \le_m B and BB is Turing-recognizable, then AA is Turing-recognizable.

5.30 Theorem

EQTME_{QTM} is neither Turing-recognizable nor co-Turing-recognizable.

Chapter Six: Advanced Topics in Computability Theory

6.1 Lemma

There is a computable function q:Σ∗→Σ∗q : \Sigma^∗\rarr\Sigma^∗, where if ww is any string, q(w)q(w) is the description of a Turing machine PwP_w that prints out ww and then halts.

SELF-REFERENCE

Let’s begin by making a Turing machine that ignores its input and prints out a copy of its own description. We call this machine SELF.

6.3 Recursion Theorem

Let TT be a Turing machine that computes a functiont: Σ∗×Σ∗→Σ∗\Sigma^∗ × \Sigma^∗→\Sigma^*. There is a Turing machine RR that computes a functionr :Σ∗→Σ∗\Sigma^∗→\Sigma^∗, where for every ww,

r(w)=t(<R>,w)r(w) = t(<R>, w)

For a turing machine T that can get RR as its input and then do some compute, RR can do the same thing. So this RR can do something with its own description.

The recursion theorem states that Turing machines can obtain their own description and then go on to compute with it.

6.6 Minimal TM

If MM is a Turing machine, then we say that the length of the description <M><M> of MM is the number of symbols in the string describing MM. Say that MM is minimal if there is no Turing machine equivalent to MM that has a shorter description.

6.7 Theorem

MINTMMIN_{TM} is not Turing-recognizable.

MINTM={<M>∣ M is a minimal TM}MIN_{TM} = \{<M> |\ M\ is\ a\ minimal\ TM\}

6.8 Fixed Point Theorem

Let t:Σ∗→Σ∗t: \Sigma^∗→\Sigma^∗ be a computable function. Then there is a Turing machine FF for which t(<F>)t(<F>) describes a Turing machine equivalent to FF. Here we’ll assume that if a string isn’t a proper Turing machine encoding, it describes a Turing machine that always rejects immediately.

In this theorem, tt plays the role of the transformation, and FF is the fixed point.

Model

A universe together with an assignment of relations to relation symbols is called a model. Formally, we say that a model MM is a tuple (U,P1,...,Pk)(U, P_1, . . . , P_k), where UU is the universe and P1P_1 through PkP_k are the relations assigned to symbols R1R_1 through RkR_k

Let φφ be the sentence ∀x∀y[R1(x,y)∨R1(y,x)]∀x ∀y[ R_1(x, y) ∨ R_1(y, x)] . Let model M1=(N,≤)M_1 = (N , ≤) be the model whose universe is the natural numbers and that assigns the “less thanor equal” relation to the symbol R1R_1

Thus, with model M1M_1 in mind, we could write φφ as ∀x∀y[x≤y∨y≤x]∀x ∀y [ x≤y ∨ y≤x] .

If M is a model, we let the theory of MM, written Th(M)Th(M), be the collection of true sentences in the language of that model.

6.12 Theorem

Th(N,+)Th(N , +) is decidable.

6.14 Theorem

Th(N,+,×)Th(N, +, \times) is undecidable.

6.3 Turing Reducibility

To be learned.

6.23 Minimal Description

Let xx be a binary string. The minimal description of xx, written d(x)d(x), is the shortest string <M,w><M, w> where TM MM on input ww halts with xx on its tape. If several such strings exist, select the lexicographically first among them. The descriptive complexity of xx, written K(x)K(x), is

K(x)=∣d(x)∣K(x) = |d(x)|

6.24 Theorem

∃c∀x[K(x)≤∣x∣+c]∃c ∀x [K(x) ≤ |x| + c]

This theorem says that the descriptive complexity of a string is at most a fixed constant more than its length. The constant is a universal one, not dependent on the string.

6.28 Incompressible

Let xx be a string. Say that xx is c-compressible if K(x)≤∣x∣−cK(x) ≤ |x| − c. If xx is not c-compressible, we say that xx is incompressible by c. If xx is incompressible by 1, we say that xx is incompressible.

6.29 Theorem

Incompressible strings of every length exist.

Part Three: Complexity Theory

Chapter Seven: Time Complexity

7.1 Time Complexity

Let MM be a deterministic Turing machine that halts on all inputs. The running time or time complexity of M is the function f:N→Nf : N →N , where f(n) is the maximum number of steps that MM uses on any input of length nn. If f(n)f(n) is the running time of MM, we say that MM runs in time f(n)f(n) and that MM is an f(n)f(n) time Turing machine. Customarily we use nn to represent the length of the input.

7.7 Time Complexity Class

Let t:N→R+t: N →R^+ be a function. Define the time complexity class, TIME(t(n))TIME(t(n)), to be the collection of all languages that are decidable by an O(t(n))O(t(n)) time Turing machine.

In fact, any language that can be decided in o(nlogn)o(n log n) time on a single-tape Turing machine is regular.

7.8 Theorem

Let t(n)t(n) be a function, where t(n)≥nt(n) ≥ n. Then every t(n)t(n) time multitape Turing machine has an equivalent O(t2(n))O(t^2(n)) time single-tape Turing machine.

7.9 Nondeterministic Turing Machine Running Time

Let NN be a nondeterministic Turing machine that is a decider. The running time of NN is the function f:N→Nf : N →N , where f(n)f(n) is them aximum number of steps that NN uses on any branch of its computation on any input of length nn, as shown in the following figure.

7.10 Theorem

Let t(n)t(n) be a function, where t(n)≥nt(n) ≥ n. Then every t(n) time nondeterministic single-tape Turing machine has an equivalent 2O(t(n))2^{O(t(n))} time deterministic single tape Turing machine.

7.12 Class P

P is the class of languages that are decidable in polynomial time on a deterministic single-tape Turing machine. In other words,

P=⋃kTIME(nk)P = \bigcup_{k} TIME(n^k)

7.16 Theorem

Every context-free language is a member of P.

Hamiltonian Path

HAMPATH=<G,s,t>∣G is a directed graph with a Hamiltonian path from s to t.HAMPATH = {<G, s, t>| G\ is\ a\ directed\ graph\ with\ a\ Hamiltonian\ path\ from\ s\ to\ t}.

7.18 Verififier

A verifier for a language A is an algorithm V , where

A={w∣ V accepts <w,c>for some string c}.A = \{w|\ V\ accepts\ <w, c> for\ some\ string\ c\}.

We measure the time of a verifier only in terms of the length of ww, so a polynomial time verifier runs in polynomial time in the length of ww. A language A is polynomially verifiable if it has a polynomial time verifier.

7.19 Class NP

NP is the class of languages that have polynomial time verifiers.

7.20 Theorem

A language is in NP iff it is decided by some nondeterministic polynomial time Turing machine.

7.21 NTIME(t(n))NTIME(t(n))

NTIME(t(n))={L ∣ L is a language decided by an O(t(n)) time nondeterministic Turing machine}NP=⋃kNTIME(nk)NTIME(t(n)) = \{L\ |\ L\ is\ a\ language\ decided\ by\ an\ O(t(n))\ time\ nondeterministic\ Turing\ machine\}\\ NP = \bigcup_{k} NTIME(n^k)

7.28 Polynomial Time Computable Function

A function f:Σ∗→Σ∗f : Σ^∗→Σ^∗ is a polynomial time computable function if some polynomial time Turing machine MM exists that halts with just f(w)f(w) on its tape, when started on any input ww.

7.29 Polynomial time mapping reducible

Language AA is polynomial time mapping reducible, or simply polynomial time reducible, to language BB, written A≤PB,A ≤_P B, if a polynomial time computable function f:Σ∗→Σ∗f : Σ^∗→Σ^∗exists, where for every ww,

w∈A⇔f(w)∈Bw \in A \Lrarr f(w) \in B

The function ff is called the polynomial time reduction of AA to BB.

7.32 Theorem (To Be Proved)

3SAT3SAT is polynomial time reducible to CLIQUECLIQUE.

7.34 NP-Completeness

A language BB is NP-complete if it satisfies two conditions:

  1. BB is in NP, and
  2. every AA in NP is polynomial time reducible to BB.

7.37 The Cook-Levin Theorem (To Be Proved)

SATSAT is NP-complete.

Chapter Eight: Space Complexity

8.1 Space Complexity

Let MM be a deterministic Turing machine that halts on all inputs. The space complexity of MM is the function f:N→Nf : N →N , where f(n)f(n) is the maximum number of tape cells that MM scans on any input of length nn. If the space complexity of MM is f(n)f(n), we also say that MM runs in space f(n)f(n).

If MM is a nondeterministic Turing machine wherein all branches halt on all inputs, we defifine its space complexity f(n)f(n) to be the maximum number of tape cells that MM scans on any branch of its computation for any input of length nn.

8.2 Space Complexity Classes

Let f:N→R+f : N →R^+ be a function. The space complexity classes, SPACE(f(n))SPACE(f(n)) and NSPACE(f(n))NSPACE(f(n)), are defined as follows

SPACE(f(n))={L∣L is a language decided by an O(f(n)) spacedeterministic Turing machine}NSPACE(f(n))={L∣L is a language decided by an O(f(n)) spacenondeterministic Turing machine}SPACE(f(n)) = \{L| L\ is\ a\ language\ decided\ by\ an\ O(f(n))\ space\\ deterministic\ Turing\ machine\}\\ NSPACE(f(n)) = \{L| L\ is\ a\ language\ decided\ by\ an\ O(f(n))\ space\\ nondeterministic\ Turing\ machine\}\\

8.5 Savitch’s Theorem

For any function f:N→R+f : N →R^+, where f(n)≥nf(n) ≥ n, NSPACE(f(n))⊆SPACE(f2(n))NSPACE(f(n)) \subseteq SPACE(f^2(n)).

Savitch’s theorem shows that any nondeterministic TM that uses f(n)f(n) space can be converted to a deterministic TM that uses only f2(n)f^2(n) space.


← Previous

← Back to ArchiveBack to top ↑

Comments

No approved comments yet.

Your display name and plain-text comment become public only after owner approval. No account or email is required.