GateAI
Regular and Context-Free Languages

GATE CSE 2019 · Q15

MCQ1 markMedium

Time

For Σ={a,b}\Sigma = \{a, b\}, let us consider the regular language L={x∣x=a2+3k or x=b10+12k,k≥0}L = \{x \mid x = a^{2+3k} \text{ or } x = b^{10+12k}, k \ge 0\}. Which one of the following can be a pumping length (the constant guaranteed by the pumping lemma) for LL?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: D) 24

Regular and Context-Free Languages

According to the Pumping Lemma for regular languages, there exists a pumping length pp such that every string w∈Lw \in L with ∣w∣≥p|w| \ge p can be written as w=xyzw = xyz satisfying:

  1. ∣y∣≥1|y| \ge 1

  2. ∣xy∣≤p|xy| \le p

  3. For all i≥0i \ge 0, xyiz∈Lxy^i z \in L.

Consider the component L2={b10+12k∣k≥0}L_2 = \{b^{10+12k} \mid k \ge 0\}:

  • The shortest string in L2L_2 is w=b10w = b^{10} with ∣w∣=10|w| = 10.

  • If p≤10p \le 10 (such as p=3,5,9p = 3, 5, 9): Since ∣w∣=10≥p|w| = 10 \ge p, w=b10w = b^{10} must be pumpable. The condition ∣xy∣≤p|xy| \le p implies 1≤∣y∣≤p<101 \le |y| \le p < 10. When ww is pumped to xy2zxy^2 z, its new length is 10+∣y∣10 + |y|. For this string to be in L2L_2, the length must be of the form 10+12k′10 + 12k^{\prime}, requiring ∣y∣|y| to be a positive multiple of 1212. But ∣y∣≤p<10|y| \le p < 10, so no such yy exists. Thus, pp cannot be 3,5,3, 5, or 99.

  • If p=24p = 24: The string b10b^{10} has length 10<2410 < 24, so the pumping lemma condition does not apply to it. For any string in L2L_2 with length ≥24\ge 24 (e.g., b34b^{34}), we can choose ∣y∣=12|y| = 12 within the prefix of length ≤24\le 24 (since 12≤2412 \le 24), ensuring that pumping yy produces lengths of the form 10+12k10 + 12k, which belong to LL. Similarly, for strings in L1={a2+3k}L_1 = \{a^{2+3k}\}, any string of length ≥24\ge 24 can be pumped by choosing ∣y∣=3|y| = 3 or 1212.

Therefore, 24 is a valid pumping length.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

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

Where do you stand for GATE?

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.

One GATE CSE PYQ every morning

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 in GATE CSE

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 Languages

More from GATE CSE 2019

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2019 · Q15 · MCQ

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

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.