Flat Turing Machines Material
Flat Turing Machines Material
Undecidability; the Church-Turing Thesis The Church-Turing thesis: A Turing machine that
halts on all inputs is the precise, formal notion corresponding to the intuitive notion of an
algorithm.
Note that algorithms existed before Turing machines were invented; for example, Euclids
algorithm to compute the greatest common divisor of two positive integers, and algorithms to
multiply two integers. The Church-Turing thesis cannot be proved because it relates a formal
concept (Turing machines) to a vaguely defined informal one.
An algorithm is defined as a sequence of instructions that can be unambiguously carried out by
a human to obtain some kind of a result. However, this thesis can be supported in various ways.
1. No one has yet found a natural example of an algorithm that could not be simulated by a
Turing machine. 2. Also, the fact that all reasonable extensions to Turing machines do not
increase their power, is a justification of the Church-Turing thesis.
Using the Church-Turing thesis, if one can show that a problem cannot be solved on a Turing
machine, then it is reasonable to conclude that it cannot be solved by any computer or by any
human. This brings up the question of the relative strengths of Turing machines and humans. Of
course people can do a lot of things that do not make sense for a Turing machine, such as
enjoying a musical composition, or playing a game for fun. Computers are very good at some
games, including chess. They have had a harder time with others
Definition
Turing machine MMM on any input www. Given the encoding ⟨M,w⟩\langle M, w \
A Universal Turing Machine (UTM) is a Turing machine UUU that can simulate any other
rangle⟨M,w⟩ of MMM and www, the universal Turing machine UUU produces the same output
as M(w)M(w)M(w).
Key Components
3. Output:
o The UTM halts with the same result (accept, reject, or loop forever) as
M(w)M(w)M(w).
Formal Definition
where:
o UUU starts by reading ⟨M⟩\langle M \rangle⟨M⟩ and www from the input tape.
1. Initialization:
3. Simulating MMM:
o UUU emulates MMM's state transitions:
Reads a symbol from MMM's tape.
Writes a symbol to MMM's tape.
Moves MMM's head (left or right).
Updates MMM's state.
4. Output:
o If M(w)M(w)M(w) accepts or rejects, UUU enters its qacceptq_{accept}qaccept
or qrejectq_{reject}qreject state.
o If M(w)M(w)M(w) loops indefinitely, UUU also loops indefinitely.
Definition
LD={w∣the Turing machine encoded by w does not accept w}.L_D = \{ w \mid \text{the Turing
machine encoded by } w \text{ does not accept } w \}.LD
={w∣the Turing machine encoded by w does not accept w}.
Here:
www is both the description of a Turing machine MwM_wMw and the input to
MwM_wMw.
Key Properties
2. Non-Recognizability:
o LDL_DLD is not semi-decidable because no Turing machine can consistently
decide whether w∈LDw \in L_Dw∈LD.
3. Proof of Undecidability:
Diagonalization is a fundamental method to show that the set of all Turing
o
machines is countable, while the set of all possible languages over an alphabet is
uncountable, leaving many languages (like LDL_DLD) unrecognizable.
4. Comparison of LUL_ULU and LDL_DLD
Formally, we say:
if there exists a computable function fff (called the reduction function) such that:
Key Idea
If L2L_2L2 is decidable (or semi-decidable), then L1L_1L1 must also be decidable (or semi-
decidable). Conversely, if L1L_1L1 is undecidable (or non-semi-decidable), then L2L_2L2 must
also be undecidable (or non-semi-decidable).
2. Types of Reductions
The reduction function fff uses logarithmic space with respect to the input size.
3. Importance of Reduction
a. Proving Undecidability
b. Proving NP-Completeness
c. Comparing Complexity
1. If PPP is non-trivial:
o There exists at least one Turing machine M1M_1M1 such that the language
L(M1)L(M_1)L(M1) has property PPP.
o There exists at least one Turing machine M2M_2M2 such that the language
L(M2)L(M_2)L(M2) does not have property PPP.
2. The decision problem:
is undecidable.
2. Key Terms
a. Property of a Language
b. Non-Trivial Property
There exists at least one Turing machine M1M_1M1 such that L(M1)L(M_1)L(M1)
satisfies PPP.
There exists at least one Turing machine M2M_2M2 such that L(M2)L(M_2)L(M2) does
not satisfy PPP.
Trivial properties:
The language L(M)L(M)L(M) of a Turing machine MMM is the set of strings w∈Σ∗w \in \
Sigma^*w∈Σ∗ that MMM accepts.
2. Limits of Computability:
o Rice's theorem underscores the limits of algorithmic solutions, even for seemingly
simple questions about languages.
3. Generalization:
o The theorem applies to all computational models equivalent to Turing machines,
such as λ-calculus, Post machines, etc.
Undecidability in computer science refers to problems for which no algorithm exists to provide a
definitive "yes" or "no" answer for all possible inputs. Many undecidable problems arise in the
context of languages recognized by computational models like Turing machines.
Below is a detailed explanation of some of the most important undecidable problems related to
languages, their formal definitions, and the implications.
1. Halting Problem
The Halting Problem is one of the most famous undecidable problems, and it serves as the basis
for proving many other problems undecidable.
Problem Statement
Given a Turing machine MMM and an input www, does MMM halt when run on www?
Formal Language
Undecidability
The Halting Problem is undecidable, as proven by Alan Turing in 1936. There is no general
algorithm that can determine whether MMM halts for all possible MMM and www.
2. Emptiness Problem
The Emptiness Problem for Turing machines asks whether the language recognized by a given
Turing machine is empty.
Problem Statement
Given a Turing machine MMM, is L(M)=∅L(M) = \emptysetL(M)=∅?
Formal Language
Undecidability
This problem is undecidable because we can reduce the Halting Problem to the Emptiness
Problem:
Construct a machine M′M'M′ that simulates MMM on www and halts if MMM halts.
L(M′)=∅L(M') = \emptysetL(M′)=∅ if and only if MMM does not halt on www.
3. Membership Problem
The Membership Problem asks whether a specific string www is in the language recognized by
a Turing machine MMM.
Problem Statement
Given a Turing machine MMM and a string www, is w∈L(M)w \in L(M)w∈L(M)?
Formal Language
Undecidability
This problem is undecidable in general because determining membership would require solving
the Halting Problem:
4. Finiteness Problem
The Finiteness Problem asks whether the language recognized by a Turing machine is finite.
Problem Statement
Formal Language
Undecidability
This problem is undecidable because we can reduce the Halting Problem to the Finiteness
Problem:
Construct a machine M′M'M′ that halts on a specific set of inputs if MMM halts.
L(M′)L(M')L(M′) is finite if and only if MMM halts on a specific input www.
5. Universality Problem
The Universality Problem asks whether a Turing machine recognizes all possible strings over
its alphabet.
Problem Statement
Formal Language
Undecidability
This problem is undecidable because we can reduce the Halting Problem to it:
Construct a machine M′M'M′ that halts on all strings except when simulating MMM on a
specific input.
L(M′)=Σ∗L(M') = \Sigma^*L(M′)=Σ∗ if and only if MMM does not halt on that input.
6. Equivalence Problem
The Equivalence Problem asks whether two Turing machines recognize the same language.
Problem Statement
Formal Language
Undecidability
This problem is undecidable because we can reduce the Halting Problem to it:
Time complexity for Turing machines provides a way to measure how the runtime of an
algorithm grows as the size of the input increases. Here’s an introductory explanation focusing
on deterministic and nondeterministic Turing machines:
4. Simple Analogy:
Imagine you’re trying to find a key in one of 100 boxes:
o On a DTM, you must open each box one by one. This could take up to 100 steps.
o On an NTM, you magically “try all boxes at once,” finding the key immediately
if it’s in any box. This might take only 1 step.
Understanding time complexity for these machines sets the stage for studying computational
complexity theory and the nature of efficient problem-solving.
Definition
The class PPP consists of all decision problems (yes/no problems) that can be solved by a
deterministic Turing machine in polynomial time. In simpler terms, PPP includes problems for
which we can find a solution efficiently.
Key Features
Deterministic Algorithm: The algorithm follows a specific sequence of steps to find the
solution.
Polynomial Time: The time to solve the problem is bounded by a polynomial function of
the input size (O(nk)O(n^k)O(nk), where kkk is a constant).
Examples
Significance
Definition
The class NPNPNP consists of all decision problems for which a solution can be verified in
polynomial time by a deterministic Turing machine.
Key Features
Verification vs. Solving: While the problem might not be efficiently solvable, any given
solution can be checked efficiently.
Nondeterministic Machine: A nondeterministic Turing machine can explore all possible
solutions simultaneously and "guess" the correct one in polynomial time.
Examples
Subset sum problem: Does a subset of numbers in a list add up to a given value?
Graph coloring: Can a graph be colored with kkk colors without adjacent nodes sharing
the same color?
Hamiltonian cycle: Does a cycle exist that visits every vertex exactly once?
Relationship to PPP
Clearly, P⊆NPP \subseteq NPP⊆NP, since any problem solvable in polynomial time can
also be verified in polynomial time.
3. NP-Complete Problems
Definition
Key Features
Examples
Significance
NPNPNP-complete problems are the benchmark for intractability. They are widely believed to
require non-polynomial time to solve.
4. P vs. NP Question
5. NP-Hard Problems
Definition
Examples
TSP Optimization Problem: Find the shortest possible route that visits each city exactly
once.
Halting Problem: Undecidable and not in NPNPNP, but NPNPNP-hard.
Relationship to NP-Complete
Every NPNPNP-complete problem is NPNPNP-hard, but not all NPNPNP-hard problems are
NPNPNP-complete.
6. Cook’s Theorem
Statement
Proof Outline
1. Show SAT is in NPNPNP: Any satisfying assignment for a Boolean formula can be
verified in polynomial time.
2. Show every problem in NPNPNP can be reduced to SAT in polynomial time:
o Simulate a nondeterministic Turing machine solving a problem in NPNPNP using
a Boolean formula.
o Construct a formula such that the formula is satisfiable if and only if the machine
accepts the input.
Significance
Cook’s theorem provides the foundation for the concept of NPNPNP-completeness. By reducing
SAT to other problems, we can prove those problems are also NPNPNP-complete.
7. Summary of Relationships
Class Definition
NPNPNP- Problems in NPNPNP that are at least as hard as every other problem in
Complete NPNPNP.