Professional Documents
Culture Documents
1
Pushdown Automata
• A pushdown automata is a way to implement a context-free
grammar in a similar way we design a DFA for a regular
grammar.
• A DFA can remember a finite amount of information, but a PDA
can remember an infinite amount of information.
• Basically, a PDA is “Finite State Machine”+ a “Stack”
• A pushdown automaton is simply an NFA augmented with an
"external stack memory". The addition of stack is used to provide
a last-in-first-out memory management capability to Pushdown
automata.
• Pushdown automata can store an unbounded amount of
information on the stack.
2
Cont….
PDA Components
• A push down automata has three components:
1. Input tape: The input tape is divided in many cells or
symbols. The input head is read-only and may only move
from left to right, one symbol at a time.
2. Finite control: The finite control has some pointer which
points the current symbol which is to be read.
3. Stack: The stack is a structure in which we can push and
remove the items from one end only. It has an infinite size.
In PDA, the stack is used to store the items temporarily.
• A PDA is more powerful than FA.
• Any language which can be acceptable by FA can also be acceptable
by PDA.
• PDA also accepts a class of language which even cannot be accepted
by FA. Thus PDA is much more superior to FA. 4
Cont…
The stack head scans the top symbol of stack.
A PDA may or may not read a input symbol, but it has to read the top
of the stack in every transition.
A PDA can push an element onto the top of the stack and pop off an
element from the top of the stack.
To read an element into the stack, the top elements must be popped off
8
Representation of PDA
• The nodes correspond to the states of the PDA.
• An arrow labeled start indicates the start state
• Doubly circled states are accepting.
• If (q; a; X) contains a pair (p; a),
then there is an arc from q to p labeled a;
• The only thing that the diagram does not tell us is which
stack symbol is the start symbol. Conventionally, it is Z.
9
Transition diagram of PDA
• The following diagram shows a transition in a
PDA from a state q1, to state q2, labled as “a, b/c”
10
Example of PDA:
• Define the push down automata for the language
L= where Q={q0, q1}, Σ={a, b ={a, z} and
is given by
(q0, a, z) = {q0, az} ··· push first a
11
Cont…
12
Chapter-5
Turing Machine
2014 E.C
Alan Mathison Turing
14
Cont…
• So far, we have learned about FA and PDA.
• Finite Automata(FA): it is a good device with small amount of
limited memory, relatively simple control.
• Push-down Automata (PDA): is a stack based automation.
• But both have limitations for even simple tasks, too restrict as
general purpose computers.
• Turing machine (TM) is more powerful device than either of FA
and PDA.
• Turing machine is essentially a finite automata but it has an
unlimited memory.
• TM is a type 0 acceptor or recognizer as per Chomsky hierarchy of
formal language.
• TM accepts type 0 language i.e Recursively Enumerable
Language (REL)
A Thinking Machine
• First Goal of Turing’s Machine:
– A model that can compute anything that a human can
compute.
• It has a tape head that can read and write symbols and move
around on the tape.
• Initially the tape contains only the input string and is blank
everywhere else. 17
• If the machine needs to store information, it may write this
information on the tape.
2. Read-write head
3. Control Unit
Formal definition of Turning Machine
• End Of Chapter
21
End of chapter
22