- 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

# How to convert from NFA to DFA in TOC?

In Non-Deterministic Finite Automata, for any current state and input symbol, there exists more than one next output state.

Any string is accepted if and only if there exists at least one transition path which is starting at initial state and ending at final state.

The following steps are followed to convert a given NFA to a DFA −

## Algorithm

### Step-01

- Let's take ' q’ as a new set of states of the DFA. It is declared null in the beginning.
- Let's take T’ be a new transition table of the DFA.

### Step-02

- Add the start state of the NFA to q’.
- Add transitions from the start state to the T’.
- If the start state has transition to multiple states for some input alphabet, then accept those multiple states as a single state in the DFA.

### Step-03

If any new state is present in T’,

- Add the new state in q’.
- Add transitions of state in the transition table T’.

### Step-04

- Keep repeating the third step until no new state is present in the transition table T’.
- Finally, the transition table T’ so obtained is the complete transition table of the required DFA.

**Note** −

After conversion, the number of states in DFA may or may not be the same as NFA.

The max number of states that are present in the DFA are two numbers of states in the NFA.

The number of states in NFA and DFA −

1 <= n <= 2m

Here,

- n = Number of states in the DFA
- m = Number of states in the NFA

In the resulting DFA, all those states that contain the final state(s) of NFA are treated as final states.

- Related Articles
- How to convert NFA with epsilon to DFA in TOC?
- Explain with an example how to convert NFA to DFA.
- Convert NFA to DFA and explain the difference between them
- Give an example problem of converting NFA to DFA.
- How to convert NFA with epsilon to without epsilon?
- What is the difference between DFA and NFA?
- How to convert FA to Left Linear Grammar in TOC?
- What is the difference between DFA and NFA in compiler design?
- Construct NFA for the following language and convert it into DFA using the algorithm - L = (aa+ (bb*)c*)
- Explain the operation of DFA with block diagram in TOC
- Explain Arden’s theorem to convert DFA to Regular Expression
- State the worst case number of states in DFA and NFA for a language?
- How to use Turing machines to recognize languages in TOC?
- Convert RE 1(0+1)*0 into equivalent DFA.
- How to convert from string to date data type in MongoDB?

Advertisements