Skip to content
Official PYQ · 2025

GATE CS 2025 Set 1 Q49 — Regular Expressions and Finite Automata

Explain with AI

Consider a finite state machine (FSM) with one input XX and one output ff, represented by the given state transition table. The minimum number of states required to realize this FSM is _______. (Answer in integer).                                                                                                           

 X=0X=1X=0X=1AFB00BDC00CFE00DGA10EDC00FFB11GGH01HGA10Present state Next state Output f\overset{\Large{\text{Present state Next state Output f}}}{\begin{array}{|c|c|c|c|c|c|} \hline \text{ $\qquad\qquad\qquad$} & \text{X=0} & \text{X=1} & \text{X=0} & \text{X=1} \\ \hline \text{A} & \text{F} & \text{B} & \text{0} & \text{0} \\ \hline \text{B} & \text{D} & \text{C} & \text{0} & \text{0} \\ \hline \text{C} & \text{F} & \text{E} & \text{0} & \text{0} \\ \hline \text{D} & \text{G} & \text{A} & \text{1} & \text{0} \\ \hline \text{E} & \text{D} & \text{C} & \text{0} & \text{0} \\ \hline \text{F} & \text{F} & \text{B} & \text{1} & \text{1} \\ \hline \text{G} & \text{G} & \text{H} & \text{0} & \text{1} \\ \hline \text{H} & \text{G} & \text{A} & \text{1} & \text{0} \\ \hline \end{array}}
View worked solution

Answer: 5:5

To find the minimum number of states required to realize the given finite state machine (FSM), we use the state minimization algorithm (equivalence partitioning).

Step 1: 00-equivalence partition (P0P_0)
We group the states based on their outputs for X=0X = 0 and X=1X = 1:

  • States with output (0,0)(0, 0): {A,B,C,E}\{A, B, C, E\}
  • States with output (1,0)(1, 0): {D,H}\{D, H\}
  • States with output (1,1)(1, 1): {F}\{F\}
  • States with output (0,1)(0, 1): {G}\{G\}

Thus, P0={{A,B,C,E},{D,H},{F},{G}}P_0 = \{\{A, B, C, E\}, \{D, H\}, \{F\}, \{G\}\}.

Step 2: 11-equivalence partition (P1P_1)
We check the next-state transitions of states within each multi-state group of P0P_0:

  • For group {A,B,C,E}\{A, B, C, E\}:
    • A→0FA \xrightarrow{0} F (Group {F}\{F\}) and A→1BA \xrightarrow{1} B (Group {A,B,C,E}\{A, B, C, E\})
    • C→0FC \xrightarrow{0} F (Group {F}\{F\}) and C→1EC \xrightarrow{1} E (Group {A,B,C,E}\{A, B, C, E\})
    • B→0DB \xrightarrow{0} D (Group {D,H}\{D, H\}) and B→1CB \xrightarrow{1} C (Group {A,B,C,E}\{A, B, C, E\})
    • E→0DE \xrightarrow{0} D (Group {D,H}\{D, H\}) and E→1CE \xrightarrow{1} C (Group {A,B,C,E}\{A, B, C, E\})
    Since AA and CC transition to the same groups, and BB and EE transition to the same groups, this group splits into {A,C}\{A, C\} and {B,E}\{B, E\}.
  • For group {D,H}\{D, H\}:
    • D→0GD \xrightarrow{0} G (Group {G}\{G\}) and D→1AD \xrightarrow{1} A (Group {A,B,C,E}\{A, B, C, E\})
    • H→0GH \xrightarrow{0} G (Group {G}\{G\}) and H→1AH \xrightarrow{1} A (Group {A,B,C,E}\{A, B, C, E\})
    Thus, DD and HH remain equivalent.

This gives P1={{A,C},{B,E},{D,H},{F},{G}}P_1 = \{\{A, C\}, \{B, E\}, \{D, H\}, \{F\}, \{G\}\}.

Step 3: 22-equivalence partition (P2P_2)
We check the transitions using the groups in P1P_1:

  • For {A,C}\{A, C\}: A→1BA \xrightarrow{1} B and C→1EC \xrightarrow{1} E. Since BB and EE are in the same group {B,E}\{B, E\} in P1P_1, AA and CC remain equivalent.
  • For {B,E}\{B, E\}: B→1CB \xrightarrow{1} C and E→1CE \xrightarrow{1} C. They transition to the same state, so they remain equivalent.
  • For {D,H}\{D, H\}: Both transition to GG on 00 and AA on 11, so they remain equivalent.

Since no further splitting occurs, P2=P1={{A,C},{B,E},{D,H},{F},{G}}P_2 = P_1 = \{\{A, C\}, \{B, E\}, \{D, H\}, \{F\}, \{G\}\}.

The minimized FSM has exactly 5 states.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular Expressions and Finite Automata questions