0% found this document useful (0 votes)
25 views21 pages

22-Pumping Lemma For Regular Languages-22-02-2024

Pumping lemma for regular languages

Uploaded by

jesujoelv8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views21 pages

22-Pumping Lemma For Regular Languages-22-02-2024

Pumping lemma for regular languages

Uploaded by

jesujoelv8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

BCSE304L

Theory of Computation
Lecture 16
Dr. Saritha Murali
(SCOPE, VIT Vellore)
22-02-2024
Are all languages Regular?
Techniques for showing that a language L is regular

1.Show that L has a finite number of elements.


2.Exhibit a regular expression for L.
3.Exhibit a FSA for L.
4.Exhibit a regular grammar for L.
5.Describe L as a function of one or more other regular languages and the
operators under which RLs are closed
Finite languages
What about infinite Languages?
Example of an infinite Non-regular language
1. Every finite set represents a regular language.
Example– All strings of length = 2 over {a, b}*
i.e. L = {aa, ab, ba, bb} is regular.

2. If there is no pattern to generate all the strings in language, then it is not regular. Finding
prime itself is not possible with FA.
Example 5 – L = { ap | p is prime } is not regular.
3. The pattern of strings form an A.P.(Arithmetic Progression) is regular.
But the pattern with G.P.(Geometric Progression) is not regular.

Example– L = { an | n>=2 } forms an A.P. Hence, regular. So we can draw a finite automaton with 3
states.
4. Whenever unbounded storage is required for storing the count and then comparison with
other unbounded counts, then the language is not regular.

Example – L = {anbn | n>=1 } is not regular, because we need to first store the count of a and
then compare it against count of b, but finite automaton has a limited storage, but in L, there can
be infinite number of a’s coming in, which can’t be stored.

L = { a20b20} is a ______ language.

Example– L = { w | na(w) = nb(w) } is not regular.

Example– L = { w | na(w)%3 > nb(w)%3 } is regular, because modulus operation requires bounded
storage i.e. modulus can be only 0, 1 or 2 for %3 operation and then similarly for b, it would be 0, 1
and 2. So, the states represented in DFA would be the combinations of the remainders of a and b.
How can we prove that a language L is not regular?
Prove that there is no DFA that accepts L ??

Problem: this is not easy to prove


Solution: the Pumping Lemma !!!
Pumping Lemma for Regular
languages
xyyz is accepted
xyyyz is accepted
xy*z is accepted
Pumping Lemma for Regular languages
Pumping lemma is a negativity test
• i.e., if a language doesn’t satisfy pumping lemma, then we can
definitely say that it is not regular
• but if it satisfies, then the language may or may not be regular.
Pumping Lemma (For Regular Languages)
Pumping Lemma is used to prove that a Language is NOT REGULAR
It cannot be used to prove that a Language is Regular

If L is a Regular Language, then L has a Pumping Length ‘n' such that


any string 'S' where |S| ≥ n may be divided into 3 parts
S = x y z such that the following conditions must be true:

(1) xyiz ∈ L for every i≥0


(2) |y|>=1
(3) |xy|≤ n
Steps to prove that a language is not Regular using PUMPING
LEMMA

using Contradiction
• Assume that L is Regular
• It should have a Pumping Length (n)
• All strings longer than P can be pumped |S| ≥ n
• Now find a string 'S' in L such that |S| ≥ n
• Divide S into x y z
• Show that x yi z ∉ L for some i
• Then consider all the ways that S can be divided into x y z
• Show that none of these can satisfy all the 3 pumping conditions at the
same time
• S cannot be Pumped == CONTRADICTION
Prove that L={anbn|n>=1} is not regular

Assume that L is regular, and n is the pumping length.


Prove that L = {ww R : w Î S*} S = {a, b} is not regular
Assume for contradiction that L is a regular language.
Let m be the Pumping length. Pick a string w such that w Î L
length | w | ³ m
m m m m
Let w = a b b a
a mb mb m a m = x y z | x y | £ m, | y |³ 1
m m m m

a mbmbma m = a...aa...a...ab...bb...ba...a
x y z
y = ak , k ³ 1
We have: x y z = a mb mb m a m y = ak , k ³ 1
From the Pumping Lemma:
i
xy z Î L i = 0, 1, 2, ...
2
Thus: x y z Î L

x y2 z = x y y z = a m + k b mb m a m Ï L
CONTRADICTION. Hence L is not regular.
Prove that L = { ap | p is prime } is not regular

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy