Tag Archives: Pumping Lemma

Pumping Lemma

Way way off the beaten path here, but this is the best example of usage of the pumping lemma I've seen. Just need somewhere to put it... The below is taken from here. Theorem: Let L be a regular language, and w be a string. Then there exists a constant c s.t. \forall w \in L, |w| \geq c. We can break w into three strings, w=xyz, s.t.:
  • |y| > 0
  • |xy| \leq c
  • \forall k \geq 0, xy^{k}z \in L
Method to prove that a language L is not regular:
  • At first, we have to assume that L is regular.
  • So, the pumping lemma should hold for L.
  • Use the pumping lemma to obtain a contradiction:
  • Select w s.t. |w| \geq c.
  • Select y s.t. |y| \geq 1.
  • Select x s.t. |xy| \leq c
  • Assign the remaining string to z.
  • Select k s.t. the resulting string is not in L.
  Problem: Prove that L=\{a^{i}b^{i} | i \geq 0\} is not regular. Solution:
  • At first, we assume that L is regular and n is the number of states.
  • Let w=a^{n}b^{n}. Thus |w|=2n\geq n.
  • By the pumping lemma, let w=xyz, where |xy| \leq n.
  • Let x=a^{p}y=a^{q}, and z=a^{r}b^{n}, where p+q+r=n, p \neq 0q \neq 0r \neq 0. Thusly |y| \neq 0.
  • Let k=2. Then xy^{2}z=a^{p}a^{2q}a^{r}b^{n}.
  • Number of a\text{'s}=(p+2q+r) = (p+q+r)+q=n+q.
  • Hence, xy^{2}z=a^{n+q}b^{n}. Since q\neq 0, xy^{2}z is not of the form a^{n}b^{n}!!!!!!!!!!!!!!!
  • Thus, xy^{2}z \notin L. Hence L is not regular.