0% found this document useful (0 votes)
165 views5 pages

Pigeon Hole

The document discusses the Pigeonhole Principle and how it can be used to show that certain languages are non-regular. It explains that by the Pigeonhole Principle, a finite state automaton must eventually return to the same state when reading input sequences. This means that for any regular language, the Pumping Lemma can be applied to show that a string can be decomposed into three parts where pumping the middle part still yields a string in the language. The document provides an example of using the Pigeonhole Principle and Pumping Lemma to prove the language of a^n b^n is non-regular.

Uploaded by

Saw Earic
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)
165 views5 pages

Pigeon Hole

The document discusses the Pigeonhole Principle and how it can be used to show that certain languages are non-regular. It explains that by the Pigeonhole Principle, a finite state automaton must eventually return to the same state when reading input sequences. This means that for any regular language, the Pumping Lemma can be applied to show that a string can be decomposed into three parts where pumping the middle part still yields a string in the language. The document provides an example of using the Pigeonhole Principle and Pumping Lemma to prove the language of a^n b^n is non-regular.

Uploaded by

Saw Earic
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/ 5

Non Regular Languages

Pigeonhole Principle:

The Pigeonhole Principle states that if n pigeons fly into


m pigeonholes and n > m then at least one hole must
contain two or more pigeons.

Pigeonhole Principle:
A function from a finite set to a smaller set cannot be one-
to-one. There must be at least two elements in the domain
that have the same image.
Because a finite state automaton can assume only a finite
number of states and because there are infinitely many
input sequences, by the pigeonhole principle, there must
be at least one state to which the automaton returns over
and over again. This is an essential feature of the
automaton.
Consider a language that consists of 1 followed by an
arbitrary number of 0 and then a 1. Example of inputs
strings are 11,101,1001.
Now there are infinitely many such strings and only
finitely many states.
Thus, by the pigeonhole principle, there must be a state sm
and two input strings ap and aq with p≠q such that when
either ap or aq are input to A, A goes to state sm. (the
pigeons are the strings of a’s, the pigeonholes are the
states and the correspondences associate each string with
the state to which A goes when the string is input).

Showing that a language is not regular using the


pigeonhole principle:

Example:
L= {s ∑* | s= anbn | n≥ 0}
If we attempt to find a DFA that recognizes B, we
discover that the machine needs to remember how many
a’s have been seen so far as it reads the input. So the
machine has to keep track of unlimited number of
possibilities, this cannot be done with a finite number of
states. In this case, we say that the language B is
nonregular.
We use the pigeonhole principle to show that B is not
regular. We use a proof by contradiction.
Suppose L is regular.
Then some DFA M= (Q, {a,b}, δ, q0, F) exists for it.
Now look at δ*(q0, ai) for i= 1, 2, .. Since there are an
unlimited number of i’s, but only a finite number of states
in M, the pigeonhole principle tells us that there must be
some state, q, such that:
δ*(q0, an)= q and δ*(q0, am)= q with m≠n.
But since M accepts anbn, we must have δ*(q, bn)=qf ∈F.

From this we can conclude that


δ*(q0,ambn) = δ*(δ*(q0,am), bn)
=δ*(q, bn)
=qf
This contradicts the original assumption that M accepts
ambn only if m= n and leads us to conclude that L cannot
be regular.

In order to use this type of arguments in a variety of


situations, we usually codify it as a general theorem,
known as the pumping lemma.

The Pumping Lemma for regular languages:

Let L be an infinite regular language, then there some


positive integer m, such that any w ∈L with |w| ≥ m can
be decomposed as:
1. w= xyz
2. |y| > 0
3. wi= xyiz ∈L for all i=0, 1, 2,…
To paraphrase this, every sufficiently long string in L can
be broken into three parts in such a way that an arbitrary
number of repetitions of the middle part yields another
string in L. We say that the middle string is pumped,
hence the term “pumping” lemma.

Proof:
If L is regular, there exists a dfa that recognizes it. Let
such a dfa have the states labeled q0, q1, …qn. Now take a
string w in L such that |w|≥ m= n+1.
Consider the set of states the automaton goes through as it
processes w, say q0, qi, qj,…qf
Since this sequence is exactly |w| +1 entries, at least one
state must be repeated and such a repetition must start
before the nth move. Thus the sequence must look like:
q0, qi, qj,…,qr,…qr,…qf
indicating there must be substrings x, y, z of w such that
δ*(q0,x) = qr
δ*( qr, y)= qr
δ*(qr,z)= qf
with |xy| ≤ n+1=m and |y| ≥ 1.
From this, it follows that:
δ*(q0,xz) = qf
δ*( q0, xy2z)= qf
δ*(q0,xy3z)= qf

The pumping lemma is used to show that certain


languages are not regular. The demonstration is always by
contradiction.

Using the pumping lemma, we show that L = {anbn : n≥0}


is not regular
Assume that L is regular, so that the pumping lemma must
hold. We do not know the value of m, but whatever it is,
we can always choose n=m.
Therefore, the substring y must consists entirely of a’s.
Suppose |y|= k. Then the string obtained using i=0 is
w0= am-kbm and is clearly not in L. This contradicts the
pumping lemma and thereby indicates that the assumption
that L is regular must be false.

This means that after p a’s have been input, at which point
A is in state sm, inputting q additional b’s sends A into an
accept state, sq.

In applying the pumping lemma, we must keep in mind


what the theorem says. We are guaranteed the existance of
an m as well as the decomposition xyz, but we do not
know what they are.

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