2. Non-deterministic Automaton.
• In NDFA, for a particular input symbol, the machine can move to any
combination of the states in the machine. Hence, it is called Non-
deterministic Automaton.
• Formal Definition of an NDFA
• An NDFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where −
• Q is a finite set of states.
• ∑ is a finite set of symbols called the alphabets.
• δ is the transition function where δ: Q × ∑ → 2Q
• (Here the power set of Q (2Q) has been taken because in case of NDFA,
from a state, transition can occur to any combination of Q states)
3. Deterministic Finite Automaton (DFA)
• Deterministic Finite Automaton (DFA)
• In DFA, for each input symbol, one can determine the state to which the machine will
move.
• Hence, it is called Deterministic Automaton.
• As it has a finite number of states, the machine is called Deterministic Finite Machine
or Deterministic Finite Automaton
•Q is a finite set of states.
•∑ is a finite set of symbols called the alphabet.
•δ is the transition function where δ: Q × ∑ → Q
4. Properties
NFA
• “NFA” stands for “Nondeterministic
Finite Automata.”
• In NFA each pair of state and input
symbol can have many possible next
states.
• NFA can use empty string transition
• NFA is easier to construct
• NFA requires less space
DFA
• DFA” stands for “Deterministic Finite
Automata”
• In DFA the next possible state is
distinctly set
• DFA cannot use empty string
transition.
• It is more difficult to construct DFA.
• DFA requires more space
5. Conversion of NFA TO DFA
• Every DFA is an NFA But not vice versa
DFA δ = Q x ∑ -> Q NFA δ = Q x ∑ -> 2Q
• But there is an equivalent DFA For every NFA
NFA ˜ DFA=
6. Important point
• In DFA we combine two state into single state.
• In DFA there is only one transition to only one state
7. EXAMPLE NO1 ON CONVERSION
• L = {set of all strings over (0,1) that start with ‘0’}
∑ = {0,1)
NFA:
A B
O,1
State 0 1
->A B ɸ
B B B
11. Example 3
• L = {Set of all string over(0,1) that end with ‘01’}
• NFA
A C
O,1
State 0 1
->A {A,B} A
B ɸ C
ɸ ɸ
B
O 1
C
12. NFA converted into DFA
A
AB
State 0 1
->A AB A
AB AB AC
AB A
0
1 0
1
AB
0 1
AC
13. Example 4 NFA
• M= [ {A,B,C},(a,b), δ,A,{C}]
• NFA AND DFA is represented by 5 tuple
State a b
->A {A,B} C
B A B
ɸ {A,B}
AB
AB
a
A
b
a
a
b
bb
C
14. NFA converted into DFA
A
BC
State 0 1
->A AB C
AB AB BC
A AB
D AB
D D D
a
b a
a
AB
b b
C
D
a
a,b
b
BC
C
15. Assignment for home
• Assignment : try to find out what type of string this NFA and
Equivalent DFA accepted
16. Transition Graph
• Properties:
• Can have more than one initial state
• Empty transaction is allowed
• We allow the machine to real move than one character at a time
• If ∑ = {a,b} Draw TG for all string containing bbb or aaa
• (a+b)* (aaa+bbb) (a+b)*
• TG reduced the complexity of NFA and DFA
18. MINIMIZATION OF DFA
• Minimization of DFA is required to obtain the minimal version of any
DFA which consists of the minimum number of states possible
• DFA 5 state 4 state
00000 0000
These two are equivalent Two state ‘A’ and ‘B’ are said to be equivalent
δ(A,X) -> F δ(A,X) -> F
and and
δ (B,X) ->F δ (B,X) -> F
19. MINIMIZATION OF DFA
• If |X| = 0, then A and B are said to be 0 equivalent
• If |X| = 1, then A and B are said to be 1 equivalent
• If |X| = 2, then A and B are said to be 2 equivalent
.
.
.
if|X| = n then A and B are said to be n equivalent
We need these properties to combined two state and make one state
to get minimal version DFA
21. Example Part1
• 0 equivalence {A,B,C,D} {E}
• 1 equivalence {A,B,C) {D} {E}
• 2 equivalence {A,C} {B} {D} {E}
• 3 equivalence {A,C} {B} {D} {E}
When you find two row gives consecutive result than it time to stop the
process
Result both are
same