TOC Notes
TOC Notes
• A k-track Turing machine(for some k>0) has k-tracks and one R/W head that reads
and writes all of them one by one.
• Infinite tape of two-way infinite tape Turing machine is unbounded in both directions
left and right.
• Two-way infinite tape Turing machine can be simulated by one-way infinite Turing
machine(standard Turing machine).
• The Multi-tape Turing machine is different from k-track Turing machine but
expressive power is the same.
• The multi-tape multi-head Turing machine has multiple tapes and multiple heads
• It has multi-dimensional tape where the head can move in any direction that is left,
right, up or down.
• A multi-head Turing machine contains two or more heads to read the symbols on the
same tape.
• In one step all the heads sense the scanned symbols and move or write
independently.
• For a given state and input symbol has at least one choice to move (finite number of
choices for the next move), each choice has several choices of the path that it might
follow for a given input string.
A Universal Turing Machine can be defined as a theoretical construction that can simulate
the behavior of other machines. This is done specifically by reading, apart from the input
tape it simulates, a description of how this very machine it is simulating would work, and
transition rules showing how it would respond to the input. This gives the UTM the
character of a general-purpose computational device that can execute any arbitrary
computable function. Universal Turing machines have hence been taken to provide the
means for the Church-Turing thesis: anything computable can be computed by a Turing
machine. In this sense, the UTM is more properly considered to be a universal interpreter
that can run any algorithm specified by another machine.
A Universal Turing Machine is a Turing Machine which when supplied with an appropriate
description of a Turing Machine M and an input string w, can simulate the computation of w.
Construction of UTM
• Finally, let us represent R/W head directions by 1 for L (Left) and 11 for R(Right).
UTM Construction
Implementation of UTM
A UTM Mu then has an input alphabet = {0, 1} and the structure of a multi-tape TM.
• Mu looks first at the contents of Tape 2 and Tape 3 to determine the instantaneous
description (ID) of M.
• Finally, Tape 2 and Tape 3 will be modified to reflect the result of the move.
UTM Implementation
• If M halts, when presented with string w then Mu will halt when presented with the
encoded M and the encoded string on its tape.
• Moreover, the final string Mu .s tape will be the encoding of the string.
• When M halts, Mu can tell if it is in the single accepting state and so moves to an
accepting state of its own ( or not).
Church’s Thesis
that can be stated as: “The assumption that the intuitive notion of computable functions can
be identified with partial recursive functions.”
Or in simple words we can say that "Every computation that can be carried out in the real
world can be effectively performed by a Turing Machine."
In 1930, this statement was first formulated by Alonzo Church and is usually referred to as
Church’s thesis, or the Church-Turing thesis. However, this hypothesis cannot be proved. The
recursive functions can be computable after taking following assumptions:
2. Let ‘F’ be the computable function and after performing some elementary operations
to ‘F’, it will transform a new function ‘G’ then this function ‘G’ automatically
becomes the computable function.
3. If any functions that follow above two assumptions must be states as computable
function.
Recursive Enumerable (RE) or Type -0 Language
A recursive language (subset of RE) can be decided by Turing machine which means it will
enter into final state for the strings of language and rejecting state for the strings which are
not part of the language. e.g.; L= {anbncn|n>=1} is recursive because we can construct a
turing machine which will move to final state if the string is of the form anbncn else move to
non-final state. So the TM will always halt in this case. REC languages are also called as
Turing decidable languages. The relationship between RE and REC languages can be shown
in Figure 1.
Also Known
Turing decidable languages Turing recognizable languages
as
Undecidable Problems
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.
Example
• Whether a CFG generates all the strings or not: As a Context Free Grammar (CFG)
generates infinite strings, we can’t ever reach up to the last string and hence it is
Undecidable.
• Whether two CFG L and M equal: Since we cannot determine all the strings of any
CFG, we can predict that two CFG are equal or not.
• Ambiguity of CFG: There exist no algorithm which can check whether for the
ambiguity of a Context Free Language (CFL). We can only check if any particular string
of the CFL generates two different parse trees then the CFL is ambiguous.
The most well-known undecidable problem is the Halting Problem, which asks whether a
given program will stop running (halt) or continue running forever for a particular input. It
has been proven that no algorithm can solve this problem for all programs and inputs.
Definition: The Halting Problem asks whether a given program or algorithm will eventually
halt (terminate) or continue running indefinitely for a particular input. "Halting" means that
the program will either accept or reject the input and then terminate, rather than going into
an infinite loop.
Proof by Contradiction
Problem statement: Can we design a machine which if given a program can find out if that
program will always halt or not halt on a particular input?
Solution:
1. Assumption: Suppose we can design such a machine, called HM(P, I), where:
• P is the program.
• I is the input.
When provided with these inputs, HM will determine whether program P halts or not.
2. Constructing a Contradiction: Using HM, we can create another program, called CM(X),
where X is any program passed as an argument as shown in figure.
3. Behavior of CM(X): In CM(X), we call HM with inputs (X, X), meaning we pass program X
both as the program and as its input. HM(X, X) will return either "Halt" or "Not Halt."
• If HM(X, X) predicts that X does not halt, CM(X) will halt immediately.
• If HM predicts that CM(CM) does not halt, CM will halt immediately (again
contradicting HM).
In both scenarios, we face a contradiction. Therefore, our initial assumption that such a
machine HM could exist must be false. Hence we can conclude that Halting Problem is
undecidable. No general algorithm can determine whether every program will halt or not.