FAFL Final Lecture 5.1
FAFL Final Lecture 5.1
Lecture 5.1
Deterministic Finite Automata
School of Computing and Information
Technology
Ms. Shruthi G
shruthi.g@reva.edu.in
AY:2020-2021
OUTLINE
Recap of Previous Lecture
Lecture Discussion
Course Description
DFA accepting strings that containing given Substring
Solution
δ a b
a, b
q0 q1 *q0 q1 q1
a, b
q1 q0 q0
DFA ACCEPTING STRINGS BASED ON LENGTH OF
Problem
T H E S TSolving
RING
Construct a DFA to accept the string over { a, b } such that the length of the string
is multiple of 3.
Here
Ʃ={a, b} and L = {λ, aaa, aab, aba, abb, baa, bab, bba, … }
Solution δ a b
a, b a, b *q0 q1 q1
q0 q1 q2
q1 q2 q2
a, b
q2 q0 q0
DFA ACCEPTING STRINGS BASED ON LENGTH OF
Problem
T H E S TSolving
RING
Construct a DFA to accept the string over { a, b } such that the string begin with
“a” and length of the string when divided by 3 results reminder as 2.
Here
Ʃ={a, b} and L = {aa, ab, aaaaa, aaaab, aaaba, aaabb, aabaa, aabab, aabba, … }
Solution a, b δ a b
qx q1 ɸ
a a, b a, b q1 q2 q2
qx q1 q2 q0
q2 q0 q0
b
ɸ a, b q0 q1 q1
ɸ ɸ ɸ
Deterministic Finite Automata
DFA accepting strings based on symbols Count
DFA ACCEPTING STRINGS BASED ON SYMBOLS
Problem
C OUNT Solving
Construct a DFA to accept the strings that contain even number of symbols “a”
and odd number of symbols “b” over an alphabet {a, b}.
Here
Ʃ={a, b} and L = {b, aab, baa, aba, abaaa, baaaa, aabaa, aaaba, bbb, babab, …}
Solution a δ a b
q00 a q10
q00 q10 q01
b b b b *q01 q11 q00
Construct a DFA to accept strings that contain the substring λ over an alphabet {a, b}.