GATE CS 2025 Set 1 | Question 50

Theory of Computation › Regular Grammar · MSQ · 2 marks · Answer: C

  1. Question 50Theory of Computationmsq2 marks
    Consider the deterministic finite automaton (DFA) shown, over . Identify which of the following language(s) is/are accepted by the given DFA.
    GATE CS 2025 Set 1 Question 50 figure
    • A.
      The set of all strings containing an even number of 's.
    • B.
      The set of all strings containing the pattern .
    • C.
      The set of all strings ending with the pattern .
      ✓
    • D.
      The set of all strings not containing the pattern .

    Answer: C

    Solution

    Answer: (C) The set of all strings ending with the pattern . The DFA is the standard 4-state minimal automaton that tracks the longest suffix matching a prefix of : (nothing) () () (, accepting); with , , , and the self-loops shown. The only accepting state is reached exactly after reading a suffix . If another follows, leaves the accepting state — so e.g. "" contains but is rejected, ruling out (B). The DFA accepts precisely strings ending in . (A) and (D) are easily refuted by the same automaton.

More GATE PYQ on Regular Grammar

All GATE CS Theory of Computation PYQ →

Attempt GATE CS 2025 Set 1 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →