Pumping Lemma for Regular Languages - Automata

Pumping Lemma for Regular Languages

The language accepted by the finite automata is called Regular Language. If we are given a language L and asked whether it is regular or not? So, to prove a given Language L is not regular we use a method called Pumping Lemma.

The term Pumping Lemma is made up of two words:

  1. Pumping: The word pumping refers to generate many input strings by pushing a symbol in an input string again and again.
  2. Lemma:  The word Lemma refers to intermediate theorem in a proof.

Pumping Lemma is used to prove that given language is not regular. So, first of all we need to know when a language is called regular. A language is called regular if:

  • Language is accepted by finite automata.
  • A regular grammar can be constructed to exactly generate the strings in a language.
  • A regular expression can be constructed to exactly generate the strings in a language.

Principle of Pumping Lemma

The pumping lemma states that all the regular languages have some special properties. If we can prove that the given language does not have those properties, then we can say that it is not a regular language.

Theorem 1: Pumping Lemma for Regular Languages

If L is an infinite regular language then there exists some positive integer n (pumping length) such that any string w ? L has length greater than or equal to n. i.e. |w| >=n, then string can be divided into three parts, w=xyz satisfying the following condition:

  • For each i>=0, xyiz ? L.
  • |y| > 0
  • |xy| <= n

|w| represents the length of string w and yimeans that i copies of y are concatenated together, y0 = ?.

Applying Pumping Lemma

We will use above theorem to prove that given language is not regular. The steps needed to prove that given languages is not regular are given below:

Step1: Assume L is a regular language in order to obtain a contradiction. Let n be the number of states of corresponding finite automata.

Step2: Now chose a string w in L that has length n or greater

i.e.  |w| >= n. use pumping lemma to write

w = xyz with |xy| <= n and |y| = 0.

Step3: Finally demonstrate that we cannot pumped by considering all ways of dividing w into x, y and z, and for each such division find a value of I such that xyiz ? L. This contradicts our assumption; hence L is not regular.

We prove xyiz ? L by considering the length of xyz i.e. |xyiz| or by using the structure of strings in L.

Example

Let L= { anbn | n>=0 }. By using pumping lemma show that L is not regular language.

Solution:

Step1: Assume L is a regular language in order to obtain contradiction. Let n be the number of states in finite automata accepting L.

Step2: Let w = anbn,  then |w| = 2n > n. Using pumping lemma, we can demonstrate w in three parts of xyz such that w = xyz with |xy| <=n and |y| > 0.

Step3: Now we want to find i, xyiz ? L.

There are three possibilities for y, we will consider all cases one by one and show that given language contains some string not for { anbn | n>=0 }.

Case 1: The string y consists of only a’s i.e. y = ak  (k>=1).

Pumping Lemma for Regular Languages

We have w = xyz

                w = anbn

In given language we have equal numbers of a’s and b’s w ? L so it must satisfy this condition. Let us take i=0.

As            xyz = anbn

                xz   = an-kbn

               n-k ? n

So xz ? L. This case is a contradiction.

Case 2: The string y consists of only b’s i.e. y = bm  (m >= 1).

Pumping Lemma for Regular Languages

We have w = xyz

                w = anbn

In given language, we have equal number of a’s and b’s w ? L, so it must satisfy this condition. Let us take i=0.

As            xz = anbn-m

                xz   = an-kbn

Where      n ? m

So xz ? L. This case also gives contradiction.

Case 3: The string y consists of both a’s and b’s i.e. y = akbm  (k,m >= 1).

Pumping Lemma for Regular Languages

We have w = xyz

                w = anbn

                w = an-kakbm bn-m

In given language we have equal number of a’s and b’s w ? L, so it must satisfy this condition. Let us take i=2.

                xy2z = xyyzi

                        = an-kakbmkbm bn-m

In this case, the string xyyz must have equal number of a’s and b’s but they are out of order with some b’s before a’s. Hence it is not a member of L. which contradicts our assumption.

Thus, in all cases we get a contradiction. Therefore, L is not regular.


Related Topics

Ambiguity in Context Free Grammar - Automata

Ambiguity in Context Free Grammar? Context Free Grammar Context Free Grammar has one condition for production rules, which is, on the left-hand side of each rule, there must be only single variable,...

4 minutes read.

Conversion from Mealy Machine to Moore Machine

Conversion from Mealy Machine to Moore Machine In this topic, we will see different ways that are used for the conversion of Mealy Machine to Moore Machine. Moore Machine The output of Moore...

4 minutes read.

Minimization of Finite Automata

Minimization of Finite Automata The term minimization refers to the construction of finite automata with a minimum number of states, which is equivalent to the given finite automata. The number of...

4 minutes read.

Automata Greibach Normal Form

Greibach Normal Form In Greibach Normal Form, there is restriction on the position, in which, terminals and variables can appear on right-hand side of production rules. In Greibach Normal Form, every...

4 minutes read.

Closure Properties of Regular Languages -Automata

Closure Properties of Regular Languages We use the term “Closure” when we talk about sets of things. If we have two regular languages L1 and L2, and L is obtained by...

3 minutes read.

Automata Chomsky Hierarchy

Chomsky Hierarchy Formal languages: A language with precise syntax and semantics are called formal languages. Noam Chomsky has defined the Chomsky hierarchy in 1956. He is an American scientist and philosopher, and...

3 minutes read.

Finite Automata

Finite Automata Finite state Automata or Finite State Machine is the simplest model used in Automata. Finite state automata accepts regular language. In this, the term finite means it has a...

4 minutes read.

Simplification of Context Free Grammar - Automata

Simplification of Context Free Grammar Context Free Grammar has recursive structure. The languages that are accepted with Context Free Grammar are called Context Free Languages. Context Free Grammar has one condition...

3 minutes read.

Finite Automata with Output

Finite Automata with Output The Finite State machine is similar to Finite Automata, except that it has the additional capacity of producing output. Finite State machine = Finite Automata + Output Capabilities Types...

3 minutes read.

Context Free Grammar - Automata

Context Free Grammar Grammar defines a set of rules, and with the help of these rules valid sentences in a language are constructed. A grammar consists of collection of substitution rules,...

3 minutes read.

Recursive Language and Recursive Enumerable Language

Recursive Language and Recursive Enumerable Language Before discussing Recursive language and Recursive Enumerable language, let us see what Turing machine responds for some input string. If we have the Turing machine T...

4 minutes read.

Conversion of DFA to Regular expression

Conversion of DFA to Regular expression To convert the DFA to Regular Expression (RE), we are going to use a method called converting DFA to regular expression by eliminating states. This...

3 minutes read.

Conversion from Moore Machine to Mealy Machine

Conversion from Moore Machine to Mealy Machine Moore Machine The output of Moore machine depends only on the present state. In this, if machine has N number of states, then it will...

6 minutes read.

Derivation Tree of Context Free Grammar - Automata

Derivation Tree of Context Free Grammar Derivation tree gives a way to show how a string can be derived from context free grammar. It is also called as parse tree, production...

3 minutes read.

Converting Finite Automata to Regular Expression using Arden’s Theorem

Converting Finite Automata to Regular Expression using Arden’s Theorem The Arden’s Theorem can be applied to find the regular expression recognized by the given transition diagram. This theorem can be applied...

4 minutes read.

Push down Automata Acceptance

Acceptance of Language by Push down Automata Push down Automata accepts the language, which is called context free language. Push down Automata = Finite Automata + Auxiliary Memory (Stack) Auxiliary Memory helps Push...

3 minutes read.

Pumping Lemma for Context Free Languages

Pumping Lemma for Context Free Languages The Pumping Lemma is made up of two words, in which, the word pumping is used to generate many input strings by pushing the symbol...

3 minutes read.

Automata Regular Expressions

Regular Expressions Regular expressions are also referred as rational expressions, which are used to describe the algebraic description of regular languages. It is generally a sequence of characters that is used...

3 minutes read.

Chomsky's Normal Form - Automata

Chomsky's Normal Form (CNF) In context free grammar, the left-hand side of production rules contains only one variable, and right side may contain any number of variables or terminals in production...

4 minutes read.

Non-deterministic Turing Machine - Automata

A non-deterministic Turing machine (NTM) is a theoretical machine used in computability theory to study the extent to which a machine can "guess" at a solution and yet still be...

4 minutes read.