First, we check there are some states which are not reachable from the start state in the DFA. Here this is not the case since every state is reachable from the start state. (If there are some states which are not reachable from the start then we will remove them first)
Transition Table of the Given DFA in the question
|
a
|
b
|
q0
|
q1
|
q4
|
q1
|
q5
|
*q2
|
*q2
|
q3
|
q6
|
q3
|
q3
|
q3
|
q4
|
q1
|
q4
|
q5
|
q1
|
q4
|
q6
|
q3
|
*q7
|
*q7
|
q3
|
q6
|
Partitions are :
P0={ {q0,q1,q3,q4,q5,q6} {q2,q7} }
P1={ {q0,q3,q4,q5} {q1,q6} {q2,q7} }
P2={ {q0,q4,q5} {q3} {q1,q6} {q2,q7} }
P3={ {q0,q4,q5} {q3} {q1} {q6} {q2,q7} }
P4={ {q0,q4,q5} {q3} {q1} {q6} {q2,q7} }
Therefore finally we need total of 5 states in Minimal DFA.