GATE / CS ARCHIVE

SIMILAR QUESTIONS / DIGITAL LOGIC

Minimize Mealy machines by partition refinement

4 questions solved the same way, newest first. Back to Digital Logic

How these are solved

Partition states by their complete output vectors, repeatedly split blocks whose successor block signatures differ, and form the quotient table/graph or count stable blocks. Preserves all three existing members.

2 marks · NAT
Report issue

Minimizing a Mealy machine by partition refinement

Finite-State Machine Design

Question 59, GATE 2025: A Mealy FSM has input X∈{0,1}. Each row lists (next on 0,next on 1; output on 0,output on 1): A=(F,B;0,0), B=(D,C;0,0), C=(F,E;0,0), D=(G,A;1,0), E=(D,C;0,0), F=(F,B;1,1), G=(G,H;0,1), H=(G,A;1,0). Find the minimum number of equivalent states.
Tap to enlarge
Answer & solution

Official answer: 5

Step through it (3 steps)

Approach: Equivalent Mealy states must produce the same immediate output for each input and lead to equivalent states. Refine partitions until stable.
Group first by output pair: P0={{A,B,C,E},{D,H},{F},{G}}, corresponding to 00,10,11,01. States in different groups are already distinguishable by a single input.
Within the 00 group, A and C go on input 0 to F, while B and E go to the 10 group {D,H}. Those destination groups differ, so split 00 into {A,C} and {B,E}. On input 1 they all initially went to the 00 group, which did not prevent the split required by input 0.
Now check P1={{A,C},{B,E},{D,H},{F},{G}}. A,C both lead to {F} on 0 and {B,E} on 1. B,E both lead to {D,H} on 0 and {A,C} on 1. D,H both lead to {G} on 0 and {A,C} on 1. Thus every multi-state group has identical destination-group signatures and no further split is required.
The stable equivalence classes are AC, BE, DH, F and G: five states. Partition refinement both constructs a five-state realization and proves that the distinguishable classes cannot be merged.

Original paper, page 59 · Answer key

2 marks · Descriptive
Report issue

Equivalence partition of a Mealy machine

Finite-State Machine Design

Question 70(a), GATE 1997: The Mealy state table gives (next state,output) for inputs 0 and 1:
A: 0→(B,1), 1→(H,1)
B: 0→(F,1), 1→(D,1)
C: 0→(D,0), 1→(E,1)
D: 0→(C,0), 1→(F,1)
E: 0→(D,1), 1→(C,1)
F: 0→(C,1), 1→(C,1)
G: 0→(C,1), 1→(D,1)
H: 0→(C,0), 1→(A,1).
No initial state is specified. Find the equivalence partition of its states.
Question 70(a), GATE 1997: The Mealy state table gives (next state,output) for inputs 0 and 1:
A: 0→(B,1), 1→(H,1)
B: 0→(F,1), 1→(D,1)
C: 0→(D,0), 1→(E,1)
D: 0→(C,0), 1→(F,1)
E: 0→(D,1), 1→(C,1)
F: 0→(C,1), 1→(C,1)
G: 0→(C,1), 1→(D,1)
H: 0→(C,0), 1→(A,1).
No initial state is specified. Find the equivalence partition of its states.
Tap to enlarge
Answer & solution

Answer: {A}, {B}, {C,D}, {E,F,G}, {H}. (no official key was published)

Two Mealy states are equivalent if every finite input string produces the same output string from either state. In particular they must first agree on their immediate output for each input. The output pairs are (1,1) for A,B,E,F,G and (0,1) for C,D,H. This gives the initial partition P0={ABEFG,CDH}.

Refine each block according to the blocks reached on inputs 0 and 1, while retaining the output test. In P0, A and B lead respectively to blocks (ABEFG,CDH); E,F,G lead to (CDH,CDH); and C,D,H lead to (CDH,ABEFG). Hence P1={AB,EFG,CDH}.

Now use P1 to distinguish formerly similar successor states. A reaches (AB,CDH), whereas B reaches (EFG,CDH), splitting A from B. C and D both reach (CDH,EFG), whereas H reaches (CDH,AB), splitting H from CD. The states E,F,G still both transition into CDH. Thus P2={A,B,CD,EFG,H}.

Check stability: C and D have equal outputs and both go into CD on 0 and EFG on 1. Each of E,F,G has output 1 on both inputs and goes into CD on both inputs. No further split is needed. The singleton blocks trivially satisfy stability, so P2 is the equivalence partition.

Refinement never separates equivalent states: a split witnesses a finite input on which outputs eventually differ. For example, A and B are distinguished by 000, producing 111 and 110 respectively; H and C are distinguished by 100, producing 111 and 110. Conversely, a stable equal-output partition guarantees equal output sequences by induction on input length. This proves both directions, rather than guessing equivalent states from one-step transitions alone.

Original paper, page 10

3 marks · Descriptive
Report issue

Five-state minimal Mealy quotient

Finite-State Machine Design

Question 70(b), GATE 1997: The Mealy state table gives (next state,output) for inputs 0 and 1:
A: 0→(B,1), 1→(H,1)
B: 0→(F,1), 1→(D,1)
C: 0→(D,0), 1→(E,1)
D: 0→(C,0), 1→(F,1)
E: 0→(D,1), 1→(C,1)
F: 0→(C,1), 1→(C,1)
G: 0→(C,1), 1→(D,1)
H: 0→(C,0), 1→(A,1).
No initial state is specified. Give the minimal equivalent state table, naming merged states by their members.
Question 70(b), GATE 1997: The Mealy state table gives (next state,output) for inputs 0 and 1:
A: 0→(B,1), 1→(H,1)
B: 0→(F,1), 1→(D,1)
C: 0→(D,0), 1→(E,1)
D: 0→(C,0), 1→(F,1)
E: 0→(D,1), 1→(C,1)
F: 0→(C,1), 1→(C,1)
G: 0→(C,1), 1→(D,1)
H: 0→(C,0), 1→(A,1).
No initial state is specified. Give the minimal equivalent state table, naming merged states by their members.
Tap to enlarge
Answer & solution

Answer: Five quotient states A,B,CD,EFG,H with the transition/output table below. (no official key was published)

The equivalence blocks are {A},{B},{C,D},{E,F,G},{H}. Replace every original destination by its block name, keeping the original output. The reduced table is:

Present state   input 0: next/output   input 1: next/output
A               B/1                    H/1
B               EFG/1                  CD/1
CD              CD/0                   EFG/1
EFG             CD/1                   CD/1
H               CD/0                   A/1

For example, C goes to D/0 and E/1, whereas D goes to C/0 and F/1. Once C,D are both named CD and E,F,G are all named EFG, those two rows become identical. Similarly, E,F,G all reduce to the row CD/1, CD/1. Therefore the choice of a representative inside a merged block does not affect the quotient table.

Why is this minimal rather than merely smaller? Output-based refinement begins with {ABEFG,CDH}, refines to {AB,EFG,CDH}, and then to the five displayed blocks, which are stable. Distinct resulting blocks have some finite distinguishing input, so no further merger preserves all output behavior. Five states are necessary to represent the behavior of all states in the given table.

No start state is printed, so the table does not justify inventing one or removing states as unreachable from it. This is minimization of the supplied machine's state behaviors. If a separate initial-state specification were supplied, one would additionally check reachability before reporting the size of a recognizer from that particular start. The table remains a Mealy table: outputs label transitions, not states, and a Moore-machine reinterpretation would be a different problem.

Original paper, page 10

2 marks · MCQ
Report issue

Minimizing a Mealy machine

Finite-State Machine Design

Question 2.23, GATE 1996: For inputs 0,1, the next-state/output pairs are A:(D,0),(B,1); B:(A,0),(C,1); C:(A,0),(B,1); D:(A,1),(C,1). How many states remain?
Question 2.23, GATE 1996: For inputs 0,1, the next-state/output pairs are A:(D,0),(B,1); B:(A,0),(C,1); C:(A,0),(B,1); D:(A,1),(C,1). How many states remain?
Tap to enlarge
Your answer
Answer & solution

Answer: B: 3 (no official key was published)

First group states by their immediate output pairs. A,B,C output (0,1), while D outputs (1,1), so D is separate. On input 0, A moves to D but B and C move to A, which belongs to the other initial group; therefore A must split from B,C. Now B and C both move to A on 0 and to the block {B,C} on 1, with identical outputs. They remain equivalent and no further split occurs. The stable partition is {A},{B,C},{D}, giving three states.

Original paper, page 6