Question
Let . For , and , let denote the number of occurrences of in .
Which one or more of the following option(s) define(s) regular language(s)?
Official answer and solution
- Official answer
- A and C
- From
- Official GATE 2025 answer key
Solution
Test each language for finite-state recognizability versus unbounded comparison of counts.
- (A) is Regular: is generated by the regular expression .
- (B) is NOT Regular: Any string in contains zero 's, so intersecting with forces , yielding , which is a non-regular CFL.
- (C) is Regular: Tracking requires states and tracking requires states; their product DFA has states.
- (D) is NOT Regular: Enforcing requires unbounded memory and cannot be done by a finite automaton.
Final answer
Options (A), (C)
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 2 (CS2)
- Question
- 52 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.