Lecture 2
Lecture 2
Lec-2
Type-1 Problems
In Type-01 problems, we will discuss the construction of DFA for languages consisting of strings ending with a particular
substring.
Step-01:
RULE
Calculate the length of substring.
All strings ending with ‘n’ length substring will always require minimum (n+1) states in the DFA.
Step-02:
Step-03:
RULE
While constructing a DFA,
Always prefer to use the existing path.
Create a new path only when there exists no path to go with.
Step-04:
E.g. 001
0 0,1
0 0 1
1
0,1
E.g 101
Dead or trap state
1 0 1
DFA (Example-2)
Draw a DFA for the language accepting strings ending with ’01’ over input alphabets ∑ = {0, 1}
Solution-
Step-01:
Step-03:
Step-01:
Step-03:
Draw a DFA for the language accepting strings ending with ‘abba’ over input alphabets ∑ = {a, b}
Practice Session Solution
Draw a DFA for the language accepting strings ending with ‘abba’ over input alphabets ∑ = {a, b}
Draw a DFA for the language accepting strings starting with ‘101’ over input alphabets ∑ = {0, 1}
Practice Session Solution
Draw a DFA for the language accepting strings starting with ‘101’ over input alphabets ∑ = {0, 1}