Pumping lemma for regular language is generally used for proving :
2017
Pumping lemma for regular language is generally used for proving :
- A.
whether two given regular expressions are equivalent
- B.
a given grammar is ambiguous
- C.
a given grammar is regular
- D.
a given grammar is not regular
Attempted by 112 students.
Show answer & explanation
Correct answer: D
Conclusion: The pumping lemma for regular languages is used to prove that a language (and thus a grammar generating that language) is not regular.
Pumping lemma (informal statement): If a language L is regular, then there exists a pumping length p such that every string s in L with length at least p can be written as s = x y z with |xy| ≤ p and |y| ≥ 1, and for all integers i ≥ 0 the string x y^i z is also in L.
How to use the pumping lemma to prove a language is not regular:
Assume for contradiction that the language L is regular. Let p be the pumping length given by the lemma.
Choose a specific string s in L with |s| ≥ p (choose s strategically so that any allowed decomposition forces a useful structure).
Consider all possible decompositions s = x y z satisfying |xy| ≤ p and |y| ≥ 1, and show that there exists some i (often 0 or 2) for which x y^i z is not in L.
This contradicts the pumping lemma's requirement that all pumped strings remain in L, so L cannot be regular.
Example (classic): Let L = { a^n b^n : n ≥ 0 }. Assume L is regular and let p be the pumping length. Choose s = a^p b^p. Any decomposition s = x y z with |xy| ≤ p must have y consisting only of a's and |y| ≥ 1. Pumping down with i = 0 removes at least one a, producing a string with fewer a's than b's, which is not in L. This contradiction shows L is not regular.
Important note: Failing to apply the pumping lemma successfully does not prove regularity. To prove a language is regular you must construct a finite automaton, a regular expression, or otherwise show it meets the definition of regular languages.
Why the other answer choices are incorrect:
Checking whether two regular expressions are equivalent is done by converting to automata and comparing their languages, not by the pumping lemma.
Proving a grammar is ambiguous involves demonstrating multiple distinct parse trees for the same string; ambiguity is a context-free grammar property and is not addressed by the pumping lemma for regular languages.
Proving a grammar (or its language) is regular requires constructing a right/left-linear grammar, a finite automaton, or a regular expression; the pumping lemma cannot be used to establish regularity.