Turing Machine Notes
Turing Machine Notes
Problem − Does the Turing machine finish computing of the string w in a finite number of
steps? The answer must be either yes or no.
Proof − At first, we will assume that such a Turing machine exists to solve this problem and
then we will show it is contradicting itself. We will call this Turing machine as a Halting
machine that produces a ‘yes’ or ‘no’ in a finite amount of time. If the halting machine
finishes in a finite amount of time, the output comes as ‘yes’, otherwise as ‘no’. The
following is the block diagram of a Halting machine −
The Post Correspondence Problem (PCP), introduced by Emil Post in 1946, is an undecidable
decision problem. The PCP problem over an alphabet ∑ is stated as follows −
We can say that there is a Post Correspondence Solution, if for some i1,i2,………… ik, where
1 ≤ ij ≤ n, the condition xi1 …….xik = yi1 …….yik satisfies.
Example 1
Find whether the lists
Solution
x1 x2 x3
M abb aa aaa
N bba aaa aa
Here,
x2x1x3 = ‘aaabbaaa’
x2x1x3 = y2y1y3
Solution
x1 x2 x3
M ab bab bbaaa
N A ba bab
L(G) = L(P)
In the next two topics, we will discuss how to convert from PDA to CFG and vice versa.
Step 3 − The start symbol of CFG will be the start symbol in the PDA.
Step 4 − All non-terminals of the CFG will be the stack symbols of the PDA and all the
terminals of the CFG will be the input symbols of the PDA.
Step 5 − For each production in the form A → aX where a is terminal and A, X are
combination of terminal and non-terminals, make a transition δ (q, ε, A) = (q, aX) and
for each terminal symbol make a transition δ (q, a, a) = (q, ε) forall a ϵ ∑
Problem
S → XS | ε , A → aXb | Ab | ab
Solution
where δ −
δ(q, a, a) = {(q, ε )}
δ(q, 1, 1) = {(q, ε )}
Output − Equivalent PDA, P = (Q, ∑, S, δ, q0, I, F) such that the non- terminals of the
grammar G will be {Xwx | w,x∈ Q} and the start state will be Aq0,F.
Step 2 − For every w, x, y, z ∈ Q, add the production rule Xwx → XwyXyx in grammar G.
A Multi-tape Turing machine can be formally described as a 6-tuple (Q, X, B, δ, q0, F) where
−
● Q is a finite set of states
● X is the tape alphabet
● B is the blank symbol
● δ is a relation on states and symbols where
δ: Q × Xk → Q × (X × {Left_shift, Right_shift, No_shift })k
where there is k number of tapes
● q0 is the initial state
● F is the set of final states
Note − Every Multi-tape Turing machine has an equivalent single-tape Turing machine.
δ(Qi, [a1, a2, a3,....]) = (Qj, [b1, b2, b3,....], Left_shift or Right_shift)
Note − For every single-track Turing Machine S, there is an equivalent multi-track Turing
Machine M such that L(S) = L(M).
An input is accepted if there is at least one node of the tree which is an accept configuration,
otherwise it is not accepted. If all branches of the computational tree halt on all inputs, the
non-deterministic Turing Machine is called a Decider and if for some input, all branches are
rejected, the input is also rejected.
It is a two-track tape −
● Upper track − It represents the cells to the right of the initial head position.
● Lower track − It represents the cells to the left of the initial head position in reverse
order.
The infinite length input string is initially written on the tape in contiguous tape cells.
The machine starts from the initial state q0 and the head scans from the left end marker ‘End’.
In each step, it reads the symbol on the tape under its head. It writes a new symbol on that tape
cell and then it moves the head either into left or right one tape cell. A transition function
determines the actions to be taken.
It has two special states called accept state and reject state. If at any point of time it enters
into the accepted state, the input is accepted and if it enters into the reject state, the input is
rejected by the TM. In some cases, it continues to run infinitely without being accepted or
rejected for some certain input symbols.
Note − Turing machines with semi-infinite tape are equivalent to standard Turing machines.
Here,
The computation is restricted to the constant bounded area. The input alphabet contains two
special symbols which serve as left end markers and right end markers which mean the
transitions neither move to the left of the left end marker nor to the right of the right end marker
of the tape.
A linear bounded automaton can be defined as an 8-tuple (Q, X, ∑, q0, ML, MR, δ, F) where
−
A deterministic linear bounded automaton is always context-sensitive and the linear bounded
automaton with empty language is undecidable.
Examples
● Equivalence of two regular languages: Given two regular languages, there is an
algorithm and Turing machine to decide whether two regular languages are equal or not.
● Finiteness of regular language: Given a regular language, there is an algorithm and
Turing machine to decide whether regular language is finite or not.
● Emptiness of context free language: Given a context free language, there is an
algorithm whether CFL is empty or not.
UndecidableProblems–
The problems for which we can’t construct an algorithm that can answer the problem correctly
in finite time are termed as Undecidable Problems. These problems may be partially decidable
but they will never be decidable. That is there will always be a condition that will lead the
Turing Machine into an infinite loop without providing an answer at all.
We can understand Undecidable Problems intuitively by considering Fermat’s Theorem, a
popular Undecidable Problem which states that no three positive integers a, b and c for any
n>=2 can ever satisfy the equation: a^n + b^n = c^n.
If we feed this problem to a Turing machine to find such a solution which gives a contradiction
then a Turing Machine might run forever, to find the suitable values of n, a, b and c. But we
are always unsure whether a contradiction exists or not and hence we term this problem as
an Undecidable Problem.
Examples
The thesis has been wrongly attributed to many controversial claims in philosophy, that
although related are not implied in the original thesis. Some examples are:
▪ The universe is equivalent to a Turing Machine and non-computable functions are
physically impossible.[1]
▪ The universe isn’t equivalent to a Turing Machine and incomputable.[2]
▪ The human mind is a Turing Machine, the human mind and/or consciousness are equivalent
to and can be instantiated by a computer. [3]
▪ The human mind isn’t a Turing Machine, the human mind and/or consciousness emerge
due to the existence of incomputable process, such as microtubules performing quantum
process in the brain.[4]