GATE Computer ScienceModerateGATE CS (PYQ pattern)
For the regular language L(r) with r = (ab + ba)*, the pumping lemma asks for a length p such that every w ∈ L with |w| ≥ p can be split w = xyz with |xy| ≤ p, |y| ≥ 1 and xyⁱz ∈ L for all i ≥ 0. What is the smallest such p?
- A. 2
- B. 4
- C. 5
- D. 3
Correct answer: A. 2
The minimal complete DFA has 4 states, so p = 4 always works, but the smallest valid p can be smaller: here a brute-force check over all strings gives 2. (A p is valid iff every sufficiently long member has a pumpable loop in its first p symbols.)
More Theory of Computation questions
- For the regular language L(r) with r = aaa + bbbb (that is, a's of length ≥ 2 or b's of length ≥ 3), the pumping lemma asks for a length p…
- Consider these claims about regular expressions over {a, b} (each equation compares the two languages): I. (a + b) = (ab) II. (ab)a =…
- Consider these claims about regular expressions over {a, b} (each equation compares the two languages): I. (ab) = ε + (a + b)b II. (aa +…
- Consider these claims about regular expressions over {a, b} (each equation compares the two languages): I. (a + b) = (a + b) II. (a +…
- Consider these claims about regular expressions over {a, b} (each equation compares the two languages): I. (ba)b = b(ab) II. (a + b)ab =…
- Consider these claims about regular expressions over {a, b} (each equation compares the two languages): I. (a + b)b = (ab)⁺ II. (ab)(a +…