Minimization of DFA (original) (raw)

Last Updated : 7 Apr, 2026

DFA minimization stands for converting a given DFA to its equivalent DFA with minimum number of states. DFA minimization is also called as Optimization of DFA and uses partitioning algorithm.

Suppose there is a DFA D = ( Q, Σ, δ, q0, F ) which recognizes a language L. Then the minimized DFA D = ( Q, Σ, δ, q0, F ) can be constructed for language L as:

**Step 1: We will divide Q (set of states) into two sets. One set will contain all final states and other set will contain non-final states. This partition is called P0.
**Step 2: Initialize k = 1
**Step 3: Find Pk by partitioning the different sets of Pk-1. In each set of Pk-1, we will take all possible pair of states. If two states of a set are distinguishable, we will split the sets into different sets in Pk.
**Step 4: Stop when Pk = Pk-1 (No change in partition)
**Step 5: All states of one set are merged into one. No. of states in minimized DFA will be equal to no. of sets in Pk.

**How to find whether two states in partition P k are distinguishable ?
Two states ( qi, qj ) are distinguishable in partition Pk if for any input symbol a, Δ ( qi, a ) and Δ ( qj, a ) are in different sets in partition Pk-1.
**Example
Consider the following DFA shown in figure.

fig 1

**Step 1. P0 will have two sets of states. One set will contain q1, q2, q4 which are final states of DFA and another set will contain remaining states. So P0 = { { q1, q2, q4 }, { q0, q3, q5 } }.

**Step 2. To calculate P1, we will check whether sets of partition P0 can be partitioned or not:

****(i) For the set { q1, q2, q4 }:**

To check whether this block can be further partitioned, we compare the transitions of each state on input symbols 0 and 1.

State δ(0) δ(1)
q1 q2 q5
q2 q2 q5
q4 q2 q5

Since all states in the set { q1, q2, q4 } have identical transition behavior for both input symbols, they are not distinguishable, hence, the block { q1, q2, q4 } cannot be partitioned further.

****(ii) For the set { q0, q3, q5 }:**

To check whether this block can be partitioned, we compare the transitions of the states on input symbols **0 and **1.

State δ(0) δ(1)
q0 q3 q1
q3 q0 q4
q5 q5 q5

For states q0 and q3:

Hence, q0 and q3 are not distinguishable.

For states q0 and q5:

Hence, q0 and q5 are distinguishable. Therefore, the block {q0, q3, q5 } is partitioned into { q0, q3 } and { q5}, so, P1={{q1, q2, q4}, {q0, q3}, {q5}}

****(iii) For the set { q1, q2, q4 } in P1:**

To compute P2, we again check whether this block can be further partitioned.

State δ(0) δ(1)
q1 q2 q5
q2 q2 q5
q4 q2 q5

Thus, all states have identical transition behavior, Hence, the block { q1, q2, q4 } cannot be partitioned further in P2.

****(iv) For the set { q0, q3 }:**

We compare transitions of q0 and q3 on both input symbols.

State δ(0) δ(1)
q0 q3 q1
q3 q0 q4

Since both transitions lead to the same blocks, q0 and q3 are not distinguishable, Hence, the block { q0, q3 } cannot be partitioned further.

****(v) For the set { q5 }:**

This block contains only one state.

Hence, the block { q5 } remains unchanged.

**Final Result

Since no further partitioning is possible, P1 = {{q1​ ,q2​, q4​}, {q0​, q3​}, {q5​}}. As P1 = P2, this is the final partition.

This gives the minimized DFA. Minimized DFA corresponding to DFA of Figure 1 is shown in Figure 2 as:

fig 2**Example :
Consider a DFA **A over the alphabet {0, 1}. Analyze the following statements about A:

  1. The complement of L(A) is context-free.
  2. L(A) = L((11__0 + 0)(0 + 1)01_)
  3. A is the minimal DFA for the language it accepts.
  4. A accepts all strings over {0, 1} of length at least two.

**Analysis:

example

**Conclusion: Statements 3 and 4 are false.
**Correct Option: D

Advantages

Disadvantages