IAE Academy

ISRO CS 2023 Q.55: solution and answer

ISRO 2023 · CSQ.55 · 1 mark · MCQ

Consider the deterministic finite-state automaton (DFA) below. The alphabet is {a, b}. The state with a small incoming arrow is the initial state, while the double circle state denotes a final state. Which of the following regular expressions defines the language accepted by the DFA?

ISRO CS 2023 question 55: A DFA with three states.Tap to open full size
Figure from the ISRO CS 2023 paper. It is part of the question.
Figure description

A DFA with three states. The left state has a small incoming arrow (initial state). The right state is drawn with a double circle (final state) and has a self-loop labelled b. The bottom state is a single circle with a self-loop labelled a,b. Transitions: initial --a--> final (arrow to the right); initial --b--> bottom state (arrow down and to the right); final --a--> bottom state (arrow down and to the left).

  1. (A)

    ab*

  2. (B)

    a*b*

  3. (C)

    (ab)*

  4. (D)

    a*b

Answer and solution

ANSWER

The DFA accepts the language , which is option (A).

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

  1. Name the states: (initial), (final, double circle) and (bottom state).

  2. Read the transitions from the diagram: , , , , and loops to itself on both and .

  3. is a dead (trap) state: once entered it is never left, and it is not final, so any string that reaches it is rejected.

  4. From the only way to avoid the trap is to read first, so every accepted string starts with and is then in . The start state is not final, so the empty string is rejected.

  5. In , reading keeps the automaton in , while reading sends it to the trap. So after the first only 's may follow, and the string is accepted exactly when it ends in . The language is

  6. Check the other options. would accept and , but is not final and from goes to the trap. would accept , but the second is read in and goes to the trap. would accept , but already reaches the trap. Only matches.

KEY IDEA

Identify the dead state, then follow the only path that avoids it. Here that path is one from the start, followed by any number of 's looping on the final state.

WATCH OUT FOR

Picking because the final state has a loop, without noticing that the start state is not final and that from the start goes to the trap. Another slip is forgetting that a second from the final state also goes to the trap.

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