0% found this document useful (0 votes)
10 views

FAFL Final Lecture 1.9 CMH

Uploaded by

Hanith Cg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

FAFL Final Lecture 1.9 CMH

Uploaded by

Hanith Cg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Established as per the Section 2(f) of the UGC Act, 1956

Approved by AICTE, COA and BCI, New Delhi

Lecture 1.9
Deterministic Finite
Automata
School of CSE
OUTLINE
Recap of Previous Lecture

Topic of the Lecture

Objective and Outcome of Lecture

Lecture Discussion

• DFA accepting strings based on length of the string.


• DFA accepting strings based on symbols count.
• DFA accepting strings based on binary to decimal conversions.
• Miscellaneous problems on DFA construction.
Deterministic Finite Automata
Recap of Previous Lecture
RECAP OF PREVIOUS
LECTURE

DFA accepting strings that containing given Suffix

Course Description
DFA accepting strings that containing given Substring

The Language Accepted and Rejected by the DFA

DFA accepting strings that do not contain given Suffix/Prefix/Substring


Deterministic Finite Automata
To p i c o f t h e L e c t u r e
TOPIC OF THE LECTURE

DFA accepting strings based on length of the string.

DFA accepting strings based on symbols count.


Deterministic Finite Automata
Objective and Outcome of Lecture
OBJECTIVE AND OUTCOME OF LECTURE

• Explain the construction of DFA to accept the strings based


Lecture on the length of the string, symbols count, binary to decimal
Objective conversions and the strings that hold miscellaneous
properties.

• Construction of DFA to accept the strings based on the


Lecture length of the string, symbols count, binary to decimal
Outcome conversions and the strings that holds miscellaneous
properties.
Deterministic Finite Automata
D FA a c c e p t i n g s t r i n g s b a s e d o n l e n g t h o f
the String
D FA A C C E P T I N G S T R I N G S B A S E D O N
L E N G TSolving
Problem H OF THE STRING
Construct a DFA to accept the string over { a, b } such that the
length of the string is even.
Here
Ʃ={a, b} and L = {λ, aa, ab, ba, bb, aaaa, aaab, aaba, aabb, abaa, … }

Solution
δ a b
a, b
q0 q1 *q0 q1 q1
a, b
q1 q0 q0
D FA A C C E P T I N G S T R I N G S B A S E D O N
L E N G TSolving
Problem H OF THE STRING
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
D FA A C C E P T I N G S T R I N G S B A S E D O N
L E N G TSolving
Problem H OF THE STRING
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
Here reminder as 2.
Ʃ={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
qx q1 q2 q0 q1 q2 q2
q2 q0 q0
b
ɸ a, b q0 q1 q1
ɸ ɸ ɸ
Deterministic Finite Automata
D FA a c c e p t i n g s t r i n g s b a s e d o n s y m b o l s
Count
D FA A C C E P T I N G S T R I N G S B A S E D O N
S YMBO
Problem LS COUNT
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,Here
b}.
Ʃ={a, b} and L = {b, aab, baa, aba, abaaa, baaaa, aabaa, aaaba, bbb, babab, …}

Solution a δ a b
q00 q10
a q00 q10 q01

b b b b *q01 q11 q00


q10 q00 q11
a
q01 q11
q11 q01 q10
a
D FA A C C E P T I N G S T R I N G S B A S E D O N
S YMBO
Problem LS COUNT
Solving
Construct a DFA to accept the binary strings that contain number
of “0”s multiple of 3 and number of “1”s multiple of 4 over an
alphabet {0, 1}.
Here Ʃ={a, b} and L = {λ, 000, 1111, 0001111,1000111, 0101011, 1100011, 1110001, …}
Solution 1

q00 1 q01 1 q02 1 q03


0 0 0 1 0

q10 1 q11 1 q12 1 q13


0 0 0 1 0

q20 1 q21 1 q22 1 q23


0 0 0 0
DISCUSSION
5 MINUTES

Construct a DFA to accept strings that contain the substring λ over an alphabet {a, b}.

You might also like