- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain with an example how to convert NFA to DFA.
Problem
Convert the following Non-Deterministic Finite Automata (NFA) to Deterministic Finite Automata (DFA).
Solution
The transition diagram is as follows −
The transition table of NFA is as follows −
State | a | b |
---|---|---|
->q0 | q0 | q0,q1 |
q1 | - | *q2 |
*q2 | - | - |
The DFA table cannot have multiple states. So, make q0q1 as a single state.
Let’s convert the given NFA to DFA by considering two states as a single state.
The transition table of DFA is as follows −
State | a | b |
---|---|---|
->q0 | q0 | [q0,q1] |
[q0q1] | [q0] | [q0q1q2] |
*[q0q1q2] | [q0] | [q0q1q2] |
In the above transition table, q2 is the final state. Wherever, q2 is present that becomes the final state.
Note −
- After conversion the number of states in the final DFA may or may not be the same as in NFA.
- The maximum number of states present in DFA may be 2pow (number of states in NFA)
- The relationship between number of states in NFA and DFA is: 1<=n<=2m
Where n= number of states in DFA
m= number of states in NFA
- The final DFA all states that contain the final states of NFA are treated as final states.
- Related Articles
- How to convert NFA with epsilon to DFA in TOC?
- Give an example problem of converting NFA to DFA.
- Convert NFA to DFA and explain the difference between them
- How to convert from NFA to DFA in TOC?
- How to convert NFA with epsilon to without epsilon?
- Explain Arden’s theorem to convert DFA to Regular Expression
- How to process SQL statements with JDBC explain with an example?
- Explain NFA with epsilon transition.
- How to sort an array in JavaScript?Explain with example?
- What is the difference between DFA and NFA?
- (a)How do metals react with hydrogen? Explain with an example.(b)How do non-metals react with hydrogen? Explain with an example.
- How to create a JSON object in JavaScript? Explain with an example.
- How to explain Android Shared preferences with example?
- Explain trial balance with an example
- What is HCF and LCM ? Explain how to find them with an example.

Advertisements