IAE Academy

ISRO CS 2023 Q.56: solution and answer

ISRO 2023 · CSQ.56 · 1 mark · MCQ

Consider the Nondeterministic Finite-State Automaton (NFA) below. States with a small incoming arrow are initial states, while a double circle state denotes a final state. The number of states in the MINIMAL Deterministic Finite-State Automaton (DFA) for this language is:

ISRO CS 2023 question 56: An NFA with three states in a row, left to right.Tap to open full size
Figure from the ISRO CS 2023 paper. It is part of the question.
Figure description

An NFA with three states in a row, left to right. The leftmost state is initial (small incoming arrow from the left) and has a self-loop labelled a,b. A transition labelled b goes from the leftmost state to the middle state. A transition labelled a,b goes from the middle state to the rightmost state, which is drawn as a double circle (final). No other transitions.

  1. (A)

    2

  2. (B)

    4

  3. (C)

    6

  4. (D)

    8

Answer and solution

ANSWER

The minimal DFA has states, option (b).

Official answer: BSource: ISRO's revised and final answer key of 16 February 2024

  1. Name the states (initial, loops on ), (reached from on ) and (final, reached from on or ).

  2. The only way to accept is to finish in , and the move into consumes the last symbol of the string. The move before it must have been on a . So the second-to-last symbol must be .

  3. Hence , which is .

  4. Subset construction. Start state : on it goes to , on to .

  5. : on to , on to . : on to , on to . : on to , on to . Exactly 4 subsets are reachable, and the final ones are and .

  6. Read each subset as the last two symbols read: is (also the start), is , is , is . A string is accepted exactly when the last two symbols are or .

  7. Distinguish the states. A final state differs from a non-final one by the empty string, so are separated from .

  8. and : append . From we reach (reject), from we reach (accept). So separates them.

  9. and : append . From we reach (reject), from we reach (accept). So separates them.

  10. All 4 states are pairwise distinguishable, so the DFA is minimal. Equivalently, the Myhill-Nerode classes of are determined by the last two symbols, giving classes. The minimal DFA has 4 states, option (b).

KEY IDEA

The NFA accepts strings whose second-to-last symbol is , so a DFA must remember the last two symbols, which gives distinguishable states (Myhill-Nerode).

WATCH OUT FOR

Expecting the DFA to have states because the NFA has 3 states, or stopping at the subset construction without noting that only 4 subsets are reachable. A worst-case bound is not the count of reachable, distinguishable states.

From the ISRO CS 2023 paper. Every question of this paper · The full paper (PDF, ISRO) · All 5 ISRO Finite automata questions, with notes

More ISRO Finite automata questions