2. Introduction
• What is Finite Automata?
▫ It is the simplest machine to recognize patterns.
• A Finite Automata consists of the following :
Q : Finite set of states.
∑ : set of Input Symbols.
q : Initial state.
F : set of Final States.
δ : Transition Function.
2
3. Example
• Let us consider the controller of an automatic door.
• The controller is in either of two states: OPEN or CLOSED
CLOSED OPEN
FRONT
NEITHER
FRONT
REAR
BOTH
REAR
NEITHER
BOTH
FRONT – a person is standing in front
of the doorway.
REAR – a person is standing to the rear
of the doorway.
BOTH – people are standing on both
sides.
NEITHER – none is standing on either
side.
3
4. Example
States NEITHER FRONT REAR BOTH
CLOSED CLOSED OPEN CLOSED CLOSED
OPEN CLOSED OPEN OPEN OPEN
Input Signals
4
5. Notation of Formal Definition
• We can describe the finite automaton as M = (Q, ∑, δ, q1, F)
where,
Q = {q1, q2, q3},
∑ = {0, 1},
δ is described as
q1 is the start state, and
F = {q2}.
0 1
q1 q1 q2
q2 q3 q2
q3 q2 q2
5
6. Formal Definition
• In the example, let A be the language of Machine M.
• A = {w|w contains at least one 1 and
an even number of 0’s follow the last 1}
• So L(M) = A or equivalently M recognizes A.
6
7. Drawing State Diagrams
• A finite automaton is described as
M = ({q1, q2}, {0, 1}, δ, q1, {q2}).
The transition function δ is
7
0 1
q1 q1 q2
q2 q1 q2
8. Designing Finite Automata
• Design a finite automaton which has input symbols {0,
1} and accepts the language L = {w|w is the empty string
ϵ or ends with a 0}
8
As this machine accepts the language L, it is called regular
language.
9. Designing Finite Automata
• Suppose a machine has ∑ = {a, b} and accepts all the
strings that start and end with a or that start and end
with b.
9
sa b
q1 r1
a b
q2
b r2 a
b baa