GATE CS 2025 Set 1 | Question 44

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

  1. Question 44Theory of Computationmcq2 marks
    Consider the following two languages over the alphabet :
    Which ONE of the following statements is CORRECT?
    • A.
      Both and are regular languages.
    • B.
      is a regular language but is not a regular language.
    • C.
      is not a regular language but is a regular language.
      ✓
    • D.
      Neither nor is a regular language.

    Answer: C

    Solution

    Answer: (C) is not regular but is regular. is regular. Since consists only of 's, we can always take (a single ) and let be the middle. So is exactly the set of strings that start with , end with , and have length — described by the regular expression . is not regular. Here may be any non-empty string, and the same must appear as both a prefix and a suffix. When the first and last symbols differ (e.g. ), a single-symbol border no longer works, and the automaton would have to match an arbitrarily long prefix against the suffix — which a finite automaton cannot do (provable by the pumping lemma). Hence is not regular.

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 →