0% found this document useful (0 votes)
182 views

FLAT Unit 5 Question Bank Solutions

The document discusses different types of Turing machines including standard, multi-tape, non-deterministic, multi-head, oracle, probabilistic, and universal Turing machines. Diagrams and explanations are provided for each type. The last section constructs a Turing machine to compute the logarithm function.

Uploaded by

Gopl Kuppa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
182 views

FLAT Unit 5 Question Bank Solutions

The document discusses different types of Turing machines including standard, multi-tape, non-deterministic, multi-head, oracle, probabilistic, and universal Turing machines. Diagrams and explanations are provided for each type. The last section constructs a Turing machine to compute the logarithm function.

Uploaded by

Gopl Kuppa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

8. List and explain various Turing Machines with suitable diagrams.

(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:

3. Non-deterministic Turing Machine (NTM):


 A non-deterministic Turing machine can transition to multiple states from a given configuration.
It explores all possible paths simultaneously during computation. If at least one path leads to
acceptance, the NTM accepts the input.

 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:

5. Oracle Turing Machine:


 An oracle Turing machine is an abstract machine that can query an oracle for answers to certain
computational problems. It can perform a limited number of oracle queries during its
computation.
 Diagram: (No specific diagram as it's a theoretical concept)

6. Probabilistic Turing Machine:


 A probabilistic Turing machine incorporates randomness into its computation. It can make
probabilistic choices at each step, leading to different possible outcomes with associated
probabilities.
 Diagram: (No specific diagram as it's a theoretical concept)

7. Universal Turing Machine:


 A universal Turing machine is a theoretical model capable of simulating any other Turing
machine. It takes as input the description of another Turing machine and its input and simulates
the computation of the given machine.

 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.

12.define the TM with Formal notations.


(OR)
5.list the elements of turing machine and explain the block diagram
A TM is expressed as a 7-tuple (Q, T, B, ?, ?, q0, F) where:

 Q is a finite set of states


 T is the tape alphabet (symbols which can be written on Tape)
 B is blank symbol (every cell is filled with B except input alphabet initially)
 ? is the input alphabet (symbols which are part of input alphabet)
 ? is a transition function which maps Q × T ? Q × T × {L,R}. Depending on its present
state and present tape alphabet (pointed by head pointer), it will move to new state,
change the tape symbol (may or may not) and move head pointer to either left or right.
 q0 is the initial state
 F is the set of final states. If any state of F is reached, input string is accepted.
Turing machines are an important tool for studying the limits of computation and for
understanding the foundations of computer science. They provide a simple yet powerful
model of computation that has been widely used in research and has had a profound impact on
our understanding of algorithms and 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.

12. EXPLAIN THE CONCEPT OF UNIVERSAL TURING MACHINE


Universal Turing 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.
Universal Turing Machine

Construction of UTM
Without loss of generality, we assume the following for M:

 Q = {q1, q2, ….qn} where q1=initial state and q2=Final State


 τ = {σ1, σ2,,…σn} where σ represent blanks
 Select an encoding on which q1 is representable by 1, q2 by 11, and so on.
 Similarly, σ1 is encoded as 1, σ2 as 11, etc.
 Finally, let us represent R/W head directions by 1 for L (Left) and 11 for R(Right).
 The symbol 0 will be used as a separator between 1s.
With this scheme, any transition of M can be given as :

7. explain the chamskey hypothesis halting problem

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:

I consider a Turing Machine (Q,Σ,Γ,δ,q0,qf,#)(�,Σ,Γ,�,�0,��,#) where Q� is the set of states


of the TM; Σ={1}Σ={1} is the input alphabet; Γ={0,1,$,#}Γ={0,1,$,#} is the work alphabet
($$ is a symbol to separate the input and the output), δ� is the transition
function, q0∈ Q�0∈ � is the initial state, qf∈ Q��∈ � is the final state and ## is the blank
symbol. The Turing Machine I imagined is composed of 13 states, it may be possible to do
better. Here is the detail on each state (to understand how the TM works) :

 q0�0: initial state


 q1�1: I have read only one 11 in the input
 q2�2: I have read only two 11's in the input
 q3�3: I am reading another 11 in the input (q1�1 and q2�2 make it easier to separate the
input and the output)
 q4�4: I am returning to the most left to increment the binary representation
 q5�5: I am incrementing, and there is still a carry
 q6�6: I have finished incrementing, I return to the input to read 11's
 q7�7: I have finished reading completely the input, I am returning to the most left to
transform the binary representation of n� into unary representation of ⌈ log2n⌉ ⌈ log2⁡�⌉
 q8�8: I am replacing 00's by 11's without having seen a single 11
 q9�9: I am replacing 00's by 11's having seen a single 11
 q10�10: I am replacing 00's by 11's having seen at least two 11's (therefore n� is not a
power of 22)
 q11�11: I have concluded that n� is a power of 22, so the last 11 must be replaced by ##
 qf��: final state
Here is the detail of the transition function, state by state. The first column is the current state of
the Turing Machine, the last 4 correspond to the read tape symbol. Each box is given as a
triple (α,q,d)(�,�,�) where α� is the symbol written on the tape, q� is the next state and d� is
the direction of the head shift.

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,→#,��,→ - -

You might also like