However, there is a double run that can distinguish states
with
. Example: S tarting from state
(
) if we apply 1, we go to state
(
) generating output 1 (1). Now if we apply input 1, to state
(
) , we go to state
(
) generating output 1 (0)—different output. So run with input “11” from state
and
give outputs as “11” and “10”, respectively, thereby differentiating
from
. Similarly, we may verify that is a double run that can differentiate
from
.
There are triple runs that can distinguish between states
with
. Example: S tarting from state
(
) if we apply 1, we go to state
(
) generating output 0 (0). Now if we apply input 1, to state
(
) , we go to state
(
) generating output 1 (1). Now if we apply input 1, to state
(
) , we go to state
(
) generating output 1 (0)—different output. So run with input “111” from state
and
give outputs as “011” and “010”, respectively, thereby differentiating
from
. Similarly, we may verify that there are triple runs (no single or double runs) that can differentiate
from
.
Therefore, we see that in this example,
and
. We merge
and
. Figure 5 represents modified STG of Figure 4 when the equivalent sates (i.e.,
and
) are merged.

From the discussion on the above example, it may be felt that the generalized procedure for finding state equivalence in FSM should be simple. We start with all the states of the STG in a set and partition it into equivalence classes based on difference in outputs produced for any given input. Following that, we apply all possible inputs to all the equivalence classes. The states that either generate different outputs or whose destination states belong to different equivalence classes are partitioned. The same procedure is repeated for all the equivalence classes until one of the terminating conditions (discussed earlier) are met.
Also, merging of equivalent states is a simple procedure. We need to put all equivalent states to one super state. For a state s , that lies in a super state su1 , if there is an outgoing transition t , to another state b , then we put the transition t from su1 to b . If b (after state merging) falls in another super state su2 , then we add t from su1 to su2. It may be noted that su1 and su2 may be the same super state. Similar logic also holds for incoming transitions. For a state s , that lies in a super state su1 , if there is an incoming transition t , from another state b , then we put the transition t from b to su1 . If b falls in another super state su2 , then we add t from su2 to su1. These facts can be verified from the STGs of Figure 4 and Figure 5. For example, transition
of Figure 4 is now reflected in Figure 5 as
.