Chapter 02 - Finite Automata
Chapter 02 - Finite Automata
Chapter 02 - Finite Automata
Chapter 2
Finite Automata (include Lecture 2 and 3)
Lecture 2
Recap
Automata:
Abstract model of a digital computer
Automata can read the input but not change
Temporary storage available
Two types:
Deterministic Automata
Nondeterministic Automata
Accepter:
Automaton output response is limited to simple YES or NO i
s called accepter
Transducer:
Automaton output response is strings of symbols, is called tran
sducer
Transparency No. 2-3
Finite Automata
Finite Automata ( FA ):
Simplest form of an automaton
It consists of only input tape and finite control unit not temporar
y storage
Tape has a read only head
Input tape is divided in to cells and each
cell can hold one symbol
It will read the left to right, it can read
one symbol at a time
While reading if it found no symbol then it stop the operation of
automata
Control unit determines the state of the automata and control th
e movement of the head on the input tape
It will accepts the regular languages
Transparency No. 2-4
Cont.,
Cont.,
Transition diagram:
Transition diagram is defined as collection of:
Finite set of states K
Finite set of symbols
Non empty set S of K, S is called start state
Set of F of K, F is called final state
Transition function
Final State
Cont.,
Examples 1:
Example 2:
Cont.,
Cont.,
Transition Function:
Transition or Mapping function is denoted by . Two parameter
s are passed to this transition function: one is current state and ot
her is input symbol. The transition function returns a state which c
an be called as next state.
For example
= (, a)
current state
a input
next state
Cont.,
Cont.,
Try Yourself
Cont.,
Cont.,
Transition Table:
Cont.,
Cont.,
Definition:
NFA formally defined as a collection of five tuple:
A = ( Q, , , , F)
Q finite set of states
finite set of input symbols
transition function
start state (initial)
F set of final state
Cont.,
Example 2.6: Construct the NFA for the given transition table
Cont.,
Example 2.8: Draw transition diagram for NFA over {0, 1} cont
aining substring 01 and 10
This example is similar to Example 2.7:
Substring 01
Substring 10
Combine both:
= =>
Try Yourself
Lecture 3
NFA equivalence of DFA & NFA
NFA with
Significance of NFA:
Basically computers are deterministic machines
DFA will produce the predictable output for the certain input
Constructing deterministic machine is very difficult
NFA easy to construct
NFA can easily convert to DFA
This conversion mechanism is majorly used in compiler
NFA serves as a bridge between input given and DFA constructed
Cont.,
Cont.,
Cont.,
Definition of closure:
set of all states which are reachable from particular one state on
transition.
Example 2.9: Find the closure for the following NFA with
NFA with can be converted to NFA without and this NFA without
can be converted to DFA. Here we are going to discuss these conv
ersions and will find them equivalent to each others
Cont.,
Cont.,
Cont.,
Cont.,
Cont.,
Cont.,
Cont.,
Cont.,
Cont.,
Example 2.12: Construct the DFA for the given NFA transition
table.
From the given transition table:
left side and states are
available. In right side {, }
new state is available. For this
new state, we have to find the transition for new state {, } on each i
nput {0, 1}
Cont.,
Cont.,
Cont.,
Cont.,
In the given NFA q is a final state so in DFA where ever exits that s
3
Try yourself
End of Chapter - 02
Transparency No. 2-43
Problems
Solved Problems
Cont.,
Cont.,
Cont.,
Cont.,
Cont.,
Sample input string: 00, 000, 100, 0000, 0100, 000, 001, 0001, 00
10
Cont.,
6. Design NFA accepting all strings end with 01, over = {0,
1}
Automata for 01