Piyush Kumar
Piyush Kumar
Piyush Kumar
2. Introduction:
o DFA refers to deterministic finite automata. Deterministic refers to the uniqueness of
the computation. The finite automata are called deterministic finite automata if the
machine is read an input string one symbol at a time.
o In DFA, there is only one path for specific input from the current state to the next
state.
o DFA does not accept the null move, i.e., the DFA cannot change state without any
input character.
o DFA can contain multiple final states. It is used in Lexical Analysis in Compiler.
In the following diagram, we can see that from state q0 for input a, there is only one path
which is going to q1. Similarly, from q0, only one path for input b goes to q2.
1. δ: Q x ∑→Q
Example :
5. Q = {q0, q1, q2}
6. ∑ = {0, 1}
7. q0 = {q0}
8. F = {q2}
Solution:
Transition Diagram:
Transition Table:
→q0 q0 q1
q1 q2 q1
*q2 q2 q2
❖ CONSTRUCTION OF DFA
TYPE-01 PROBLEMS-
In Type-01 problems, we will discuss the construction of DFA for languages consisting of strings ending
with a particular substring.
PROBLEM-01:
Draw a DFA for the language accepting strings ending with ’01’ over input alphabets ∑ = {0, 1}
SOLUTION-
Regular expression for the given language = (0 + 1)*01
Step-01:
• All strings of the language ends with substring “01”.
• So, length of substring = 2.
Thus, Minimum number of states required in the DFA = 2 + 1 = 3.
It suggests that minimized DFA will have 3 states.
Step-02:
We will construct DFA for the following strings-
• 01
• 001
• 0101
Step-03: The required DFA is-
TYPE-02 PROBLEMS-
In Type-02 problems, we will discuss the construction of DFA for languages consisting of strings starting with a
particular substring.
Step-03:
• Construct a DFA for the strings decided in Step-02.
Remember the following rule while constructing the DFA-
• Always prefer to use the existing path.
• Create a new path only when there exists no path to go with.
Step-04:
• Send all the left possible combinations to the dead state.
• Do not send the left possible combinations over the starting state.
PROBLEM-02:
Draw a DFA for the language accepting strings starting with ‘ab’ over input alphabets ∑ = {a, b}
Solution-
Regular expression for the given language = ab(a + b)*
Step-01:
• All strings of the language starts with substring “ab”.
• So, length of substring = 2.
Step-03:
The required DFA is--
Practical Applications:
1.Pattern Recognition Examine how DFAs are employed in pattern recognition tasks, such as string
matching and DNA sequence analysis.
2.Lexical Analysis Discuss the role of DFAs in lexical analysis and tokenization within compiler design.
4.Conclusion:
In conclusion, this technical report has delved into the realm of deterministic finite automata (DFA),
providing a comprehensive understanding of their fundamental concepts, structure, and applications. We
explored the theoretical underpinnings of DFAs, emphasizing their deterministic nature and finite state
representation. Additionally, practical examples and real-world applications were examined to highlight the
versatility and relevance of DFAs in various domains, including pattern recognition, lexical analysis, and
language processing.
Through the exploration of DFA design principles and the analysis of their computational capabilities, it is
evident that DFAs offer a powerful and efficient approach for solving specific classes of problems. The
report has also discussed the limitations and challenges associated with DFAs, such as their inability to
handle certain complex patterns or efficiently represent non-regular languages.
In summary, this report has provided a thorough exploration of deterministic finite automata, offering a
foundation for further research and practical implementations. As we continue to push the boundaries of
computational systems, the knowledge gained from understanding DFAs will undoubtedly contribute to the
development of more sophisticated and efficient solutions in the realm of automata theory and beyond.
5 .References:
1. Introduction to Automata Theory, Languages, and Computation, by John E. Hopcroft, Rajeev Motwani.
2. Theory of Computer Science: Automata, Languages, and Computation, by K.L.P Mishra
and N. Chandrasekaran
Third Edition, 2006.
Page 3