FLAT Unit 5 Question Bank Solutions
FLAT Unit 5 Question Bank Solutions
(OR)
16. List and explain the types of Turing machines. [July 2023, Set-1]
[Remembering ]
1. Standard Turing Machine:
The standard Turing machine consists of a tape divided into cells, a read/write head, and a finite
control unit with a set of states. It can move left or right along the tape, read symbols from the
tape, write symbols to the tape, and change its state according to a transition function.
Diagram:
2. Multi-Tape Turing Machine:
A multi-tape Turing machine is similar to the standard Turing machine but with multiple tapes
instead of one. Each tape has its own read/write head and can move independently. The
transition function may involve simultaneous operations on multiple tapes.
Diagram:
Diagram:
4. Multi-Head Turing Machine:
A multi-head Turing machine has multiple read/write heads that can move independently on the
tape. Each head has its own state and transition function, allowing for parallel computations on
the same tape.
Diagram:
Diagram:
These are some of the variations of Turing machines commonly studied in theoretical computer
science. Each type serves different purposes and helps in understanding the capabilities and
limitations of computation.
A turing machine consists of a tape of infinite length on which read and writes operation can
be performed. The tape consists of infinite cells on which each cell either contains input
symbol or a special symbol called blank. It also consists of a head pointer which points to cell
currently being read and it can move in both directions.
Construction of UTM
Without loss of generality, we assume the following for M:
The Chomsky hierarchy and the halting problem are two distinct concepts in computer science,
but they both relate to the broader field of theoretical computer science.
Chomsky Hierarchy: This hierarchy, as mentioned earlier, is a classification system for formal
grammars, which are used to describe the syntax of languages. It was developed by linguist
Noam Chomsky in the 1950s. The Chomsky hierarchy categorizes grammars into four types
based on their expressive power, with each type being a proper subset of the one above it. These
types are Type 0 (unrestricted grammars), Type 1 (context-sensitive grammars), Type 2
(context-free grammars), and Type 3 (regular grammars). The Chomsky hierarchy is
fundamental in the study of formal languages and automata theory, providing a framework for
understanding the computational capabilities of different language classes.
Halting Problem: Proposed by Alan Turing in 1936, the halting problem is a classic problem in
computer science and mathematics. It asks whether it's possible to determine, given a program
and an input, whether that program will eventually halt (terminate) when run with that input or
whether it will run forever. Turing proved that there is no algorithm that can solve the halting
problem for all possible inputs and programs. This result has significant implications,
demonstrating that there are fundamental limitations to what computers can compute. It is a
cornerstone in the theory of computation and has profound implications for the design and
analysis of algorithms.
While these two concepts are distinct, they both contribute to our understanding of computation
and the capabilities and limitations of computational systems. The Chomsky hierarchy provides
a framework for classifying languages based on their grammatical structure, while the halting
problem highlights the fundamental limitations of algorithmic computation.
18. Construct Turing Machine to compute the function 𝐥𝐨𝐠 𝟐 𝒏
The value of ⌈log2(n)⌉⌈log2(�)⌉ is more or less equal to the number of bits in the binary
representation of n� (except if n� is a power of 2).
You can then imagine a Turing Machine with an input tape (on which is written the number), a
work tape and an output tape. First, you need to convert your unary number on the input tape,
into binary on the work tape. This can be done with a simple incrementation Turing Machine
(you can decide on the side of the least significant bit, but imho left is easier). Then, you need to
count the number of bits in the binary number, and write a 11 for each bit counted. You can use
an additionnal state, to detect is the number is a power of 2 (a 11 followed only by 00).
This machine can be reduced to two tapes by replacing bits by 11 on the work tape (except
maybe for the last one which needs to become ## if n� is a power of 22). It can be further
reduced to one tape by using the read part of the tape to write the binary number (and another
symbol than ## to replace the 11 which are read).
Let's be more formal:
State 00 11 $$ ##
q0�0 - 1,q1,→1,�1,→ - #,qf,→#,��,→
q1�1 - 1,q2,→1,�2,→ - #,q11,←#,�11,←
q2�2 - $,q3,→$,�3,→ - #,q11,←#,�11,←
q3�3 - $,q4,←$,�4,← $,q3,→$,�3,→ #,q7,←#,�7,←
q4�4 0,q4,←0,�4,← 1,q4,←1,�4,← $,q4,←$,�4,← #,q5,→#,�5,→
q5�5 1,q6,→1,�6,→ 0,q5,→0,�5,→ 1,q6,→1,�6,→ -
q6�6 0,q6,→0,�6,→ 1,q6,→1,�6,→ $,q3,→$,�3,→ -
q7�7 0,q7,←0,�7,← 1,q7,←1,�7,← #,q7,←#,�7,← #,q8,→#,�8,→
q8�8 1,q8,→1,�8,→ 1,q9,→1,�9,→ - -
q9�9 1,q9,→1,�9,→ 1,q10,→1,�10,→ - #,q11,←#,�11,←
q10�10 1,q10,→1,�10,→ 1,q10,→1,�10,→ - #,qf,←#,��,←
q11�11 - #,qf,→#,��,→ - -