##### Check for Regular language and Pumping lemma

1. If a language is finite, then it is always regular.

2. If a language is infinite, it may or may not be regular. If an infinite language has to be accepted by Finite Automata, there must be some type of loop.

for Infinite language, we use the **Pumping lemma Test.**

**Pumping lemma Test: **

- It is a
**negative test**. It means if a language is regular, it must satisfy Pumping lemma Test but if a language satisfied pumping lemma test it need not be regular always. - It a language does not satisfy pumping lemma test, it can't be regular.
- Pumping lemma is used to prove some of the languages are not regular.

Theory:-

If A is regular language, then A has a pumping length P such that, any string S

where |S|>= P can be divided into three parts S= XYZ such that following condition satisfied:-

**1.) |XY| <= P**

**2.) XY ^{i}Z ∈ A for every i>=0**

**3.) |Y| > 0**

To prove a language is not regular using Pumping lemma, please follow the following steps:

We use **prove by** **contradiction** method.

--> Assume A is regular.

--> It has to have a pumping length P.

--> All string longer than P can be pumped.

--> Now find a string S in A such that |S| >= P.

--> Then consider all the possible way that S can be divided into X,Y,Z.

--> Show that XY^{i}Z ∉A.

--> Show that none of the three property can't be satisfied by any combination XYZ.

Example:

**1**. **L = a ^{n}^{ }b^{n } / n>1**

Solution:

let us assume L is Regular ,then it has to have a pumping length P. let assume

P =7

S= a^{P}b^{P = } a^{7}b^{7 }= aaaaaaabbbbbbb ∈ L

Divide the string S in three parts

__aa __ **aaaa** __abbbbbbb____ __

X Y Z

and |XY| <= 7

Now, XY^{i}Z let assume i=2

Now if you pump Y , following string will be formed

** aaaaaaaaaaabbbbbbb ∉ L**

But earlier we assumed L as regular, This contradicts our assumption, So L is not Regular.