Deterministic
Finite
Automaton
(DFA)
-Sampath Kumar S,
AP/CSE, SECE
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.
21 November 20172
Formal definition of DFA:
A DFA can be represented by a 5-tuples (Q, ∑, δ, q0,
F) where −
 Q is a finite set of states.
 ∑ is a finite set of symbols, called the alphabet of
the automaton.
 δ is the transition function.
 q0 is the initial state from where any input is
processed (q0 ∈ Q).
 F is a set of final state/states of Q (F ⊆ Q).
Note: δ is called Delta and ∑ is called Sigma
21 November 20173
Graphical Representation of a DFA
A DFA is represented by digraphs called state
diagram or Transition Diagram .
 The vertices represent the states.
 The arcs labeled with an input alphabet show the
transitions.
 The initial state is denoted by an empty single
incoming arc.
 The final state is indicated by double circles.
21 November 20174
Transition Table:
 It is a tabular representation of a function like δ that
takes 2 arguments and returns a value.
 The rows of the table correspond to the state and
the columns correspond to the inputs.
 The entry for the row corresponding to state q and
the column corresponding to input a is the state
δ(q, a)
21 November 20175
Example
Let a deterministic finite automaton be →
 Q = {a, b, c},
 ∑ = {0, 1},
 q0={a},
 F={c}, and
 Transition function δ as shown by the following
table −
21 November 20176
Present State Next State for Input 0 Next State for Input 1
->a a b
b c a
c* b c
Example Cont..,
Its graphical representation would be as follows:
Can you guess the language of above DFA?
21 November 20177
Extended Transition Function:
 Describes what happens when we start in any state
and follow any sequence of inputs
 If δ is our transition function, then the extended
transition function is denoted by δ*
 The extended transition function is a function that
takes a state q and a string w and returns a state p
(the state that the automaton reaches when starting
in state q and processing the sequence of inputs
w)
 Formal definition :δ*(q, ǫ) = q
21 November 20178
Problems to Discuses:
1. Design DFA to accept string over ∑={0,1} with 2
consecutive 0’s.
2. Construct a DFA that accepts all strings on
∑={0,1} except those contains substring 101.
3. L= { w|w is of even length and begins with 01
over ∑={0,1} }.
4. Give DFA accepting the string starting with
substring 101 over ∑={0,1}
5. Design DFA to accept string contain number of
1’s is in multiples of 3 over ∑={0,1}.
6. Design DFA to accept string contain number of
1’s is not in multiples of 3 over ∑={0,1}.
21 November 20179
Problems (Cont..,):
7. Construct a DFA that accepts all strings on
∑={0,1} that contain exactly 4 zeros.
8. Construct a DFA over ∑={a,b} where the number
of b’s is divisible by 3.
9. Construct a DFA that accepts even binary
numbers on ∑={0,1}.
10. Construct a DFA that accepts odd binary numbers
on ∑={0,1}.
21 November 201710
21 November 201711
நன்றி
21 November 201712

1.3.1 deterministic finite automaton

  • 1.
  • 2.
    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. 21 November 20172
  • 3.
    Formal definition ofDFA: A DFA can be represented by a 5-tuples (Q, ∑, δ, q0, F) where −  Q is a finite set of states.  ∑ is a finite set of symbols, called the alphabet of the automaton.  δ is the transition function.  q0 is the initial state from where any input is processed (q0 ∈ Q).  F is a set of final state/states of Q (F ⊆ Q). Note: δ is called Delta and ∑ is called Sigma 21 November 20173
  • 4.
    Graphical Representation ofa DFA A DFA is represented by digraphs called state diagram or Transition Diagram .  The vertices represent the states.  The arcs labeled with an input alphabet show the transitions.  The initial state is denoted by an empty single incoming arc.  The final state is indicated by double circles. 21 November 20174
  • 5.
    Transition Table:  Itis a tabular representation of a function like δ that takes 2 arguments and returns a value.  The rows of the table correspond to the state and the columns correspond to the inputs.  The entry for the row corresponding to state q and the column corresponding to input a is the state δ(q, a) 21 November 20175
  • 6.
    Example Let a deterministicfinite automaton be →  Q = {a, b, c},  ∑ = {0, 1},  q0={a},  F={c}, and  Transition function δ as shown by the following table − 21 November 20176 Present State Next State for Input 0 Next State for Input 1 ->a a b b c a c* b c
  • 7.
    Example Cont.., Its graphicalrepresentation would be as follows: Can you guess the language of above DFA? 21 November 20177
  • 8.
    Extended Transition Function: Describes what happens when we start in any state and follow any sequence of inputs  If δ is our transition function, then the extended transition function is denoted by δ*  The extended transition function is a function that takes a state q and a string w and returns a state p (the state that the automaton reaches when starting in state q and processing the sequence of inputs w)  Formal definition :δ*(q, ǫ) = q 21 November 20178
  • 9.
    Problems to Discuses: 1.Design DFA to accept string over ∑={0,1} with 2 consecutive 0’s. 2. Construct a DFA that accepts all strings on ∑={0,1} except those contains substring 101. 3. L= { w|w is of even length and begins with 01 over ∑={0,1} }. 4. Give DFA accepting the string starting with substring 101 over ∑={0,1} 5. Design DFA to accept string contain number of 1’s is in multiples of 3 over ∑={0,1}. 6. Design DFA to accept string contain number of 1’s is not in multiples of 3 over ∑={0,1}. 21 November 20179
  • 10.
    Problems (Cont..,): 7. Constructa DFA that accepts all strings on ∑={0,1} that contain exactly 4 zeros. 8. Construct a DFA over ∑={a,b} where the number of b’s is divisible by 3. 9. Construct a DFA that accepts even binary numbers on ∑={0,1}. 10. Construct a DFA that accepts odd binary numbers on ∑={0,1}. 21 November 201710
  • 11.
  • 12.

Editor's Notes

  • #2 School of EECS, WSU