- Automata Theory Tutorial
- Automata Theory - Home
- Automata Theory Introduction
- Deterministic Finite Automaton
- Non-deterministic Finite Automaton
- NDFA to DFA Conversion
- DFA Minimization
- Moore & Mealy Machines

- Classification of Grammars
- Introduction to Grammars
- Language Generated by Grammars
- Chomsky Grammar Classification

- Regular Grammar
- Regular Expressions
- Regular Sets
- Arden's Theorem
- Constructing FA from RE
- Pumping Lemma for Regular Grammar
- DFA Complement

- Context-Free Grammars
- Context-Free Grammar Introduction
- Ambiguity in Grammar
- CFL Closure Properties
- CFG Simplification
- Chomsky Normal Form
- Greibach Normal Form
- Pumping Lemma for CFG

- Pushdown Automata
- Pushdown Automata Introduction
- Pushdown Automata Acceptance
- PDA & Context Free Grammar
- PDA & Parsing

- Turing Machine
- Turing Machine Introduction
- Accepted & Decided Language
- Multi-tape Turing Machine
- Multi-Track Turing Machine
- Non-Deterministic Turing Machine
- Semi-Infinite Tape Turing Machine
- Linear Bounded Automata

- Decidability
- Language Decidability
- Undecidable Language
- Turing Machine Halting Problem
- Rice Theorem
- Post Correspondence Problem

- Automata Theory Useful Resources
- Automata Theory - Quick Guide
- Automata Theory - Useful Resources
- Automata Theory - Discussion

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Pumping Lemma For Regular Grammars

### Theorem

Let L be a regular language. Then there exists a constant **‘c’** such that for every string **w** in **L** −

**|w| ≥ c**

We can break **w** into three strings, **w = xyz**, such that −

- |y| > 0
- |xy| ≤ c
- For all k ≥ 0, the string xy
^{k}z is also in L.

## Applications of Pumping Lemma

Pumping Lemma is to be applied to show that certain languages are not regular. It should never be used to show a language is regular.

If

**L**is regular, it satisfies Pumping Lemma.If

**L**does not satisfy Pumping Lemma, it is non-regular.

## 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**such that**|w| ≥ c**Select

**y**such that**|y| ≥ 1**Select

**x**such that**|xy| ≤ c**Assign the remaining string to

**z.**Select

**k**such that the resulting string is not in**L.**

**Hence L is not regular.**

**Problem**

Prove that **L = {a ^{i}b^{i} | i ≥ 0}** is not regular.

** Solution** −

At first, we assume that

**L**is regular and n is the number of states.Let w =

*a*. Thus |w| = 2n ≥ n.^{n}b^{n}By pumping lemma, let w = xyz, where |xy| ≤ n.

Let x = a

^{p}, y = a^{q}, and z = a^{r}b^{n}, where p + q + r = n, p ≠ 0, q ≠ 0, r ≠ 0. Thus |y| ≠ 0.Let k = 2. Then xy

^{2}z = a^{p}a^{2q}a^{r}b^{n}.Number of as = (p + 2q + r) = (p + q + r) + q = n + q

Hence, xy

^{2}z = a^{n+q}b^{n}. Since q ≠ 0, xy^{2}z is not of the form a^{n}b^{n}.Thus, xy

^{2}z is not in L. Hence L is not regular.