0% found this document useful (0 votes)
109 views43 pages

Chapter 6

1. The document introduces the Turing machine, which is described as a mathematical model of computation that consists of an infinite tape divided into cells, a head that reads the tape, and a state register. 2. A Turing machine is defined as having a tape that can be read from and written to based on its internal state. It can move left and right on the tape and change states and symbols. If it reaches an accepting state, the input is accepted. 3. Turing machines are more powerful than context-free grammars and can recognize some non-context free languages by having an unlimited tape for storage rather than just a stack. They provide a model for computation that is equivalent to algorithms

Uploaded by

Dee
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)
109 views43 pages

Chapter 6

1. The document introduces the Turing machine, which is described as a mathematical model of computation that consists of an infinite tape divided into cells, a head that reads the tape, and a state register. 2. A Turing machine is defined as having a tape that can be read from and written to based on its internal state. It can move left and right on the tape and change states and symbols. If it reaches an accepting state, the input is accepted. 3. Turing machines are more powerful than context-free grammars and can recognize some non-context free languages by having an unlimited tape for storage rather than just a stack. They provide a model for computation that is equivalent to algorithms

Uploaded by

Dee
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/ 43

CHAPTER SIX

Turing Machine
Introduction
 We have encountered some fundamental ideas, in particular
the concepts of regular and context-free languages and their
association with finite automata and pushdown accepters. Our
study has revealed that the regular languages form a proper
subset of the context-free languages, and therefore, that
pushdown automata are more powerful than finite automata.
 We also saw that context-free languages, while fundamental
to the study of programming languages, are limited in scope.
 Some simple languages such as {anbncn} and ww are not
context-free. This prompts us to look beyond context-free
Languages and investigate how one might define new
Language families that include these examples. To do so, we
return to the general picture of an automaton.
 We can expect to discover even more powerful language
families if we give the automaton more flexible storage.
Chomsky Hierarchy
Cont’d…
Definition

 A Turing Machine (TM) is a mathematical model which consists of an


infinite length tape divided into cells on which input is given. It consists of
a head which reads the input tape. A state register stores the state of the
Turing machine. After reading an input symbol, it is replaced with another
symbol, its internal state is changed, and it moves from one cell to the
right or left. If the TM reaches the final state, the input string is accepted,
otherwise rejected.

1. Standard Turing Machine
 A Turing Machine is an accepting device which accepts the languages (recursively
enumerable set or unrestricted grammar)
 A language is recursively enumerable (generated by Type-0 grammar) if it is accepted by a
Turing machine.
 A Turing machine is an automaton whose temporary storage is a tape.
 A Turing machine's storage is actually quite simple. It can be visualized as a single, one-
dimensional array of cells, each of which can hold a single symbol. This array extends
indefinitely in both directions. and is therefore capable of holding an unlimited amount
of information. The information can be read and changed in any order. we will call such a
storage device a tape because it is analogous to the magnetic tapes
 used in actual computers.
Cont’d…

 This tap is divided into cells, each of which is capable of holding one symbol.
Associated with the tape is a read-write head that can travel right or left.

 On the tape and that can read and write a single symbol on each move.

 whatever input and output is necessary will be done on the machine's tape.

 We can think of a Turing machine as a rather simple computer. It has a


processing unit, which has a finite memory and in its tape, it has a secondary
storage of unlimited capacity.
Cont’d…
 It can sense a symbol on its tape and use the result to decide what to do next' the
only actions the machine can perform is to rewrite the current symbol, to change
the state of the control, and to move the read-write head. This small instruction
set may seem inadequate for doing complicated things, but this is not so. Turing
machines are quite powerful in principle.
 The contents of any cell on the tape may be examined and changed many times.
Eventually, the whole process may terminates, which we achieve in a Turing
machine by putting it into a halt state.
 A Turing machine is said to halt whenever it reaches a configuration for which δ is
not defined;
Features of a standard Turing machine

1. The Turing machine has a tape that is unbounded in both directions,


allowing any number of left and right moves.

2. The Turing machine is deterministic in the sense that δ defines at most one
move for each configuration.

3. There is no special input file. We assume that at the initial time the tape
has some specified content. Some of this may be considered input.
Similarly, there is no special output device. Whenever the machine halts,
some or all of the contents of the tape may be viewed as output.
Cont’d…
Comparison with the previous
automaton:
Cont’d…
The Tape
Input String
Cont’d…
Halting
Cont’d...
Cont’d…
2. Turing Machines as Language Accepters
 Turing machines can be viewed as accepter in the following
sense.
 A string w is written on the tape, with blanks filling out the
unused portions. The machine is started in the initial state q0
with the read-write head positioned on the leftmost symbol of
w. If after a sequence of moves, the Turing machine enters a
final state and halts, then w is considered to be accepted.
Cont’d…
 The definition tells us what must happen when w Є M(L) It says nothing
about the outcome for any other input. When w is not in L(M), One of two
things can happen: the machine can halt in a non final state or it can enter
an infinite loop and never halt. Any string for which M does not halt is by
definition not in L(M).
Cont’d…
Cont’d…
 Example:- Design a Turing machine that accepts L= {anbncn :
n≥1}
 Notice that even though {anbn} is a context-free language and
{anbncn} is not, they can be accepted by Turing machines with
very similar structures
 Conclusion :- Turing machine can recognize some languages
that are not context-free, a first indication that Turing
machines are more powerful than pushdown automata.
Chapter 7: Computational complexity

7.1. Big-O notations(read by your own)


7.2. Class P vs class NP
7.3. Polynomial time reduction and NP-complete problems
7.4. Cook’s Theorem

You might also like