Minimization of DFA  Steps to minimize the DFA
MINIMISATION OF DFA is the procedure through which we can obtain minimized DFA which consists of a minimum number of states.
There are two classes of states that can be removed or merged from the original DFA without affecting the language it accepts to minimize it.
 Unreachable states are the states that are not reachable from the initial state of the DFA, for any input string.
 Nondistinguishable states are those that cannot be distinguished from one another for any input string.
Let p and q be two states then (p,q) are equivalent states and this two states in a DFA can be replaced by a single state if where state p on seeing input a goes to final state implies that state q also goes to the final state.
STEPS TO MINIMIZE DFA:
 Remove the unreachable states from DFA.
 Draw the transition table for the remaining states.
 Now, divide rows of transition table in 2 states as Set1 consists of all the nonfinal states and Set2 contains final states.
 Search for similar rows(for different sets deriving output states are same on same input symbol)
 Merge them and repeat the procedure for the rest of the table.
 Draw the transition diagram for minimized DFA.
EXAMPLE:
StepI: Delete a state which is unreachable from the initial state. In this problem, there is no dead state, therefore, proceed to next step.
StepII: Draw the transition table.

a 
b 
q_{0} 
q_{1 } 
q_{2} 
q_{1} 
q_{1}

q_{3} 
q_{2} 
q_{1} 
q_{2} 
q_{3 } 
q_{1} 
q_{4 } 
q_{4} 
q_{1 } 
q_{2} 
StepIII: Try to find out equivalent sets(sets of all non final states and final states)
 [q_{0, }q_{1,}q_{2,}q_{3}][q_{4}] (separating final and nonfinal states into different sets)
 [q_{0}q_{2}][q_{1,}q_{3}][q_{4}] (q_{0} and q_{2} equivalent states)
 [q_{0}q_{2}][q_{1}][q_{3}][q_{4}] (q_{1 }and q_{3 }will be in different set as they are not equivalent)
Newly formed states after minimizing the DFA are q_{0}q_{2}, q_{1}, q_{3}, q_{4.}
StepIV: Draw the minimized DFA.