- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Give an example problem of converting NFA to DFA.

## Problem

Consider a Non-deterministic finite automata (NFA) and convert that NFA into equivalent Deterministic Finite Automata (DFA).

## Solution

Let’s construct NFA transition table for the given diagram −

States\inputs | a | b |
---|---|---|

->q0 | {q0,q1} | q0 |

q1 | q2 | q1 |

q2 | q3 | q3 |

q3 | - | q2 |

DFA cannot have multiple states. So, consider {q0,q1} as a single state while constructing DFA.

Let’s convert the above table into equivalent DFA

States\inputs | a | b |
---|---|---|

->q1 | [q0,q1] | q0 |

[q0,q1] | [q0q1q2] | [q0q1] |

*[q0q1q2] | [q0q1q2q3] | [q0q1q3] |

*[q0q1q2q3] | [q0q1q2q3] | [q0q1q2q3] |

*[q0q1q3] | [q0q1q2] | [q0q1q2] |

In DFA the final states are q2 and q3, wherever q2 and q3 are present that state becomes a final state.

Now the **transition diagram for DFA** is as follows −

- Related Questions & Answers
- Explain with an example how to convert NFA to DFA.
- How to convert from NFA to DFA in TOC?
- Give an example of a triple column cash book
- What is the difference between DFA and NFA?
- How to convert NFA with epsilon to DFA in TOC?
- Convert NFA to DFA and explain the difference between them
- What is the difference between DFA and NFA in compiler design?
- What is mirage effect? Can you give me an example?
- State the worst case number of states in DFA and NFA for a language?
- What is Fixed-list SELECT? Give the syntax and explain with help of an example
- How can a COBOL-DB2 program call a STORED PROCEDURE? Give an example.
- Can someone give one exact example of webview implementation in android
- When should a sequential model be used with Tensorflow in Python? Give an example
- Converting array of objects to an object in JavaScript
- What is an acceptance of language by NFA with Epsilon?

Advertisements