Question
Consider the following two languages over the alphabet :
Which ONE of the following statements is CORRECT?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2025 answer key
Solution
Simplify by choosing the minimal prefix/suffix , and test using the pumping lemma.
- Analysis of :
- Every string in starts with , ends with , and has length at least .
- Conversely, if any string starts with , ends with , and has , we can write by choosing and .
- Therefore, , which is a regular language.
- Analysis of :
- In , can be any string in . Consider strings of the form , where is the pumping length: the only way to decompose is and , which requires matching the arbitrary count of 's at both ends. By the pumping lemma, is not a regular language.
Hence is not regular, whereas is regular.
Final answer
Option (C)
Common trap
Assuming requires matching arbitrary equal powers at both ends without noticing that already has .
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2025 Computer Science and Information Technology - Session 1 (CS1)
- Question
- 44 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.