0% found this document useful (0 votes)
16 views10 pages

FLAT - Ch. 4 (Lecture Notes)

The document discusses the concept of Turing machines, a theoretical model introduced by Alan Turing in the 1930s to explore the limitations of algorithmic methods. It outlines the structure of Turing machines, including their components and functions, and differentiates between Turing-recognizable and decidable languages. Additionally, it covers various types of Turing machines and their properties, such as determinism, non-determinism, and closure properties of languages.
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)
16 views10 pages

FLAT - Ch. 4 (Lecture Notes)

The document discusses the concept of Turing machines, a theoretical model introduced by Alan Turing in the 1930s to explore the limitations of algorithmic methods. It outlines the structure of Turing machines, including their components and functions, and differentiates between Turing-recognizable and decidable languages. Additionally, it covers various types of Turing machines and their properties, such as determinism, non-determinism, and closure properties of languages.
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/ 10

Chapter: 4 Turing machine

I. Introduction

The model we will study instead was designed in the 1930s by the English
mathematician Alan Turing and is referred to today as a Turing machine. It was not
obtained by adding data structures onto a finite automaton, and it predates the finite-
automaton and pushdown-automaton models. Turing’s objective was to demonstrate
the inherent limitations of algorithmic methods. He began with the idea of formulating a
model capable in principle of carrying out an algorithm whatsoever; this allowed him to
assert that any deficiencies of the model were in fact deficiencies of the algorithmic
method. The Turing machine was intended as a theoretical model, not as a practical
way to carry out a computation. However, it anticipated in principle many of the features
of modern electronic computers.
Turing considered a human-computer working with a pencil and paper. He decided that
without any loss of generality, the human-computer could be assumed to operate under
simple rules: First, the only things written on the paper are symbols from some fixed
finite alphabet; second, each step taken by the computer depends only on the symbol
he is currently examining and on his “state of mind” at the time; third, although his state
of mind may change as a result of his examining different symbols, only a finite number
of distinct states of mind are possible.
With these principles in mind, Turing isolated what he took to be the primitive steps that
a human-computer carries out during a computation:
1. Examining an individual symbol on the paper;
2. Erasing a symbol or replacing it by another;
3. Transferring attention from one symbol to another nearby symbol.

➢ In our version of a Turing machine, which is similar though not identical to the
one proposed by Turing, a single move is determined by the current state and
the current tape symbol, and consists of three parts:
1. Changing from the current state to another, possibly different state;
2. Replacing the symbol in the current square by another, possibly different symbol;
3. Leaving the tape head on the current square, or moving it one square to the right, or
moving it one square to the left if it is not already on the leftmost square.
➢ Formally, a Turing machines a 7- tuple M= (Q, Σ , Γ, δ, q0, B, F) where
Q is the finite set of states of the finite control
Σ is the finite set of input symbols.
Γ is the finite set of tape symbols; Σ⊂Γ.
δ: Q × Γ → Q × Γ × {L, R} is the transition function, which is a partial function.
q ∈ Q is the start state.
B ∈ Γ is the blank symbol; B ∈/ Σ.
F ⊆ Q is the set of final or accepting states.

For example
➢ TM that checks its third symbol is 0, accepts if so, and runs forever, if not (note it
never rejects).
M=({p,q,r,s,t},{0,1,},{0,1,B},p,s,d)
δ(p,X) = (q,X,R) for X=0,1
δ(q,X) = (r, X , R) for X=0,1
δ(r,0) = (s,0,L)
δ(r,1) = (t,1,R)
δ(t,X) = (t,X,R) for X=0,1,B

Read Update

Shift (L or R)

➢ Ex2
TM for {0n1n : n >= 1}
M = ({q0, q1, q2, q3, q4}, {0, 1}, {0, 1,X, Y,B}, ±, q0,B, {q4})

➢ Ex3
A Turing machine accepting {xx|x∈{a, b}∗}
➢ Ex4
➢ A Turing machine accepting { a i b a j | 0 ≤ I , j}

➢ Ex5
A Turing machine computing the reverse function.
➢ Ex6
A Turing machine to copy strings.
➢ Turing Recognizable and Decidable
A Turing machine M recognizes language L if L=L(M). We say L is Turing-recognizable
(or simply recognizable) if there is a TM M such that L=L(M).
A Turing machine decides language L if L=L(M) and M halts on all inputs. We say L is
decidable if there is a TM M that decides L.
Both types of machines halt in the Accept state on strings that are in the language.
A Decider also halts if the string is not in the language.
A Recognizer MAY or MAY NOT halt on strings that are not in the language.
On all input:
A Decider MUST halt (in Accept or Reject state)
A Recognizer MAY or MAY NOT halt on some strings.

➢ Closure properties

1. Union
Both decidable and Turing recognizable languages are closed under union.
For decidable languages the proof is easy. Suppose L1 and L2 are two decidable
languages accepted by halting TMs M1 and M2 respectively. The machine for L1 ∪ L2
is designed as follows:
Given an input x, simulate M1 on x. If M1 accepts then accept, else simulate M2 on x. If
M2 accepts then accept else reject.
Now suppose L1 and L2 are two Turing recognizable languages accepted by TMs
M1and M2 respectively. Since L1 and L2 are Turing recognizable languages, therefore
for strings that do not belong to these languages, the corresponding machines may not
even halt. The previous strategy will not work because we can have a scenario where
M2 accepts x but M1 loops forever.
2. Concatenation
Both decidable and Turing recognizable languages are closed under concatenation.
I will give the proof for Turing recognizable languages. The proof for decidable
languages is similar. Let L1and L2 be two Turing recognizable languages. Given an
input w, use non-determinism and guess a partition w (say w=xy). Now run the
respective Turing machines of L1and L2 on x and y respectively. If both accepts then
accept else reject.
3. Star
Both decidable and Turing recognizable languages are closed under star operation.
This is also similar to concatenation. Non deterministically first guess a number k, and
then guess a k partition of the given input. Now for each string in the partition, check
whether it belongs to the original language.
4. Intersection
Both decidable and Turing recognizable languages are closed under intersection. Run
the TMs of both the languages on the given input. Accept if and only if both the
machines accept. In the case of an intersection, we can run the TMs of L1 and L2 one
after the other (as opposed to the union).
5. Complementation
Decidable languages are closed under complementation. To design a machine for the
complement of a language L, we can simulate the machine for L on an input. If it
accepts then accept and vice versa.

➢ Variants of Turing machines


1. Multiple track Turing Machine:
A k-tack Turing machine(for some k>0) has k-tracks and one R/W head that reads and
writes all of them one by one.
A k-track Turing Machine can be simulated by a single track Turing machine
2. Two-way infinite Tape Turing Machine:
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 a one-way infinite Turing
machine(standard Turing machine).
3. Multi-tape Turing Machine:
It has multiple tapes and controlled by a single head.
The Multi-tape Turing machine is different from the k-track Turing machine but
expressive power is the same.
Multi-tape Turing machine can be simulated by a single-tape Turing machine.
4. Multi-tape Multi-head Turing Machine:
The multi-tape Turing machine has multiple tapes and multiple heads
Each tape controlled by a separate head. Multi-Tape Multi-head Turing machine can be
simulated by a standard Turing machine.
5. Multi-dimensional Tape Turing Machine:
It has multi-dimensional tape where the head can move any direction that is left, right,
up, or down. Multidimensional tape Turing machine can be simulated by a one-
dimensional Turing machine
6. Multi-head Turing Machine:
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.
Multi-head Turing machine can be simulated by a single head Turing machine.
7. Non-deterministic Turing Machine:
A non-deterministic Turing machine has a single, one-way infinite tape. For a given
state and input symbol has atheist one choice to move (finite number of choices for the
next move), each choice several choices of a path that it might follow for a given input
string.
A non-deterministic Turing machine is equivalent to a deterministic Turing machine.
➢ Deterministic vs. non-determinism Turing Machines
Deterministic TM’s owe their name to the fact that each computation can be viewed as a
linear ordered sequence (finite or infinite) of configurations. The first element contains
the initial state and each configuration C′ follows directly configuration C in the
sequence if the TM can change C into C′ as a consequence of a legal move of the
machine.
Nondeterministic machines are not restricted to such ordered computations. At each
moment in time, a non-deterministic TM may be allowed to make several moves (or
equivalently to choose among several possibilities). Hence its computation may
“branch” in many possible ways. The resulting computation is best described therefore
as a rooted tree of configurations. Each deterministic computation corresponding to a
particular sequence of choices is called a computation path.
➢ Unrestricted grammars.

Definition: an unrestricted grammar is a 4-tuple (T, N, P, S), consisting of:


T = set of terminals (the legal "tokens" of the language)
N = set of non-terminals (aka variables)
P = as a set of productions, each of the form:
v -> w
where v and w are strings consisting of non-terminals and terminals.
S = a special nonterminal called the start symbol.
This type of grammar is also known as a Type 0 grammar. It is equivalent to a Turing
Machine. Given a Type 0 grammar, there exists a TM that can "recognize" the same
language as that grammar. And, conversely, a Type 0 grammar can always be found for
the language recognized or generated by any TM.

Example: Grammar for L={ WW: w∈(a, b)∗}


S→S′Z
S′→aS′A
S′→bS′B
S′→ ø

➢ TMS Enumerator.

An enumerator is a multi-tape Turing Machine, with a special output tape which is write-
only.
Write only means (a) symbol on output tape does not affect transitions, and (b) tape
head only moves right.
Initially, all tapes blank (no input). During computation, the machine adds symbols to the
output tape. Output considered being a list of words (separated by special symbol #).
Definition: An enumerator M is said to enumerate a string W if and only if at some point
M writes a word W on the output tape.
Enumerate all the strings for L={an bn cn |n≥0}
Solution. The L can be generated by two-tape TM E with the following steps:
(1) Write # # on tape 1 and 2 for ε.
(2) Add an on tape 2,
(3)Copy an equal to the size of tape 2 on tape 1, then by the same size the b is written
on tape 1, then by same size c is written tape 1, followed with #
(4) go to step 2.

You might also like