For = {a, b}, let us consider the regular language L = {x x = a2+3k or x = b10+12k, k ≥ 0}. Which one of the following can be a pumping length (the constant guaranteed by the pumping lemma) for L?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2019 · Q15
Time
Select one answerSingle correct
Solution
Official answer: D) 24
Regular and Context-Free LanguagesAccording to the Pumping Lemma for regular languages, there exists a pumping length such that every string with can be written as satisfying:
For all , .
Consider the component :
The shortest string in is with .
If (such as ): Since , must be pumpable. The condition implies . When is pumped to , its new length is . For this string to be in , the length must be of the form , requiring to be a positive multiple of . But , so no such exists. Thus, cannot be or .
If : The string has length , so the pumping lemma condition does not apply to it. For any string in with length (e.g., ), we can choose within the prefix of length (since ), ensuring that pumping produces lengths of the form , which belong to . Similarly, for strings in , any string of length can be pumped by choosing or .
Therefore, 24 is a valid pumping length.
Try the question first, then check your work.
Examiner trap
Check the condition for the shortest string . If , then , but must be a multiple of 12.
This Regular and Context-Free Languages previous year question is Q15 of the GATE CSE 2019 paper. Find more GATE CSE PYQs on Regular and Context-Free Languages in Theory of Computation, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Regular and Context-Free Languages PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Regular and Context-Free Languages has 21 GATE CSE PYQs across 13 papers from 2011 to 2026. 5 of them are 1-mark MCQs like this one, and GATE CSE 2019 has 3.
How GATE tests Regular and Context-Free LanguagesIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.