- 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

# What is minimizing of DFA in compiler design?

Minimizing means reducing the number of states in DFA. We have to detect those states of DFA whose presence or absence in DFA does not affect language accepted by DFA. These states can be eliminated from DFA.

## Algorithm: Minimization of DFA

**Input** − DFA D1 with a set of states Q with a set of final states F.

**Output** − DFA D2 which accepts the same language as D1 and having a minimum number of states as possible.

**Method**

Make a partition 'π' of a set of states with two subsets −

- Final state 'F'
- Non-Final States 'Q-F'

∴ π={F,Q−F}

To apply the following procedure to make π

_{new}from π.

For each set S of π

**Partition** S into subsets such that two states p & q of S are in the same subset of S if for each input symbol 'a' states p & q have transitioned to states in the same set of π. It can replace S in π_{new} with a set of subsets formed.

If π

_{new}=π,let π_{final}=π & continue with step 4. Else repeat step 2 for π =π_{new}.Choose one state from each set of π

_{final}as representative of that set.

These states will be states of Minimized DFA D2.

**Example1** − Convert following DFA to Minimized DFA.

**Solution**

Make a transition table

Make a partition ′π′ of set of states i.e., π ={F,Q−F}

∴ π_{0}={{E},{A,B,C,D}}

For input symbol a, on {A, B, C, D} of π

_{0}

All B’s lie in the same set {A, B, C, D} of π_{0}

For input symbol b, on {A, B, C, D} of π

_{0}

∴ {A,B,C,D}of π_{0} will be split into {A,B,C}and {D}

π_{1}={{E},{A,B,C},{D}}

For input a, on {A, B, C} of π

_{1}

All B’s lie in the same set of π_{1}

For input b on {A, B, C} of π

_{1}

∴ {A,B,C}in π_{1} will be split into {A, C} and {B}

∴ π_{2}={{E},{A,C},{B},{D}}

Check if {A, C} can be splitted further (a)

- For input a, on {A, C} of π
_{2}

- For input a, on {A, C} of π

For input b, on {A, C} of π

_{2}

∴ {A,C} will not be splitted

∴ π_{3}={{E},{A,C},{B},{D}}

∴ π_{3}=π_{2}=π_{final}={{E},{A,C},{B},{D}}

∴ There will be 4 states of Minimized DFA corresponding to 5 states of given DFA.

{A, C} can be renamed as A1

B D E

states of Minimized DFA, i.e., A1, B, D, E will be joined by seeing the transitions from the given DFA table.

Minimized or Reduced Automata will be

- Related Questions & Answers
- What is the Representation of DFA in compiler design?
- What is the difference between DFA and NFA in compiler design?
- What is Compiler Design?
- What is Design of Lexical Analysis in Compiler Design?
- What is Chomsky Hierarchy in compiler design?
- What is error handling in compiler design?
- What is Input Buffering in Compiler Design?
- What is Finite Automata in Compiler Design?
- What is Components of LR Parsers in compiler design?
- What is types of LR Parser in compiler design?
- What is translation of control statements in compiler design?
- What is techniques of storage allocation in compiler design?
- What is Language Processing Systems in Compiler Design?
- What is role of different data structures in compiler design?
- What is Implementation of Block Structured Language in compiler design?