Pumping Lemma More Examples
Example
Regular —
Let be the pumping length (a DFA for has 2 states, so
Pick . Choose the decomposition-
.
Check: .
Pump: for .
(So the decomposition exists and pumping keeps the string in .)
Example
Regular —
Proof.
-
Choose . (Any fixed positive integer works; choosing 1 makes the argument simplest.)
-
Let with . Then is of the form for some
-
Decompose as
Then and
-
For any ,
Thus every pumped string remains in .
-
If (i.e.
), the lemma’s requirement is vacuous because it only asserts something for strings of length.
Hence a∗ satisfies the pumping-lemma conditions with pumping length p=1.
Example
Non-regular — Palindromes over
Let be pumping length. Choose
a palindrome. Decompose
which has fewer
Example
L={a^nb^n∣n≥0}
Answer: Not regular.
Proof :
Assume
Example
Answer: Not regular.
Proof:
Assume regular and let
Example
L
= { w ∈ { 0 , 1 } ∗ ∣ # 0 ( w ) = # 1 ( w ) }
Answer: Not regular.
Proof :
Assume regular; let
Example
Answer: Not regular.
Proof :
Assume regular; let
is not regular. (I write
Example
L={a^nb^m∣n is a multiple of m, m≥1}
Proof (by Pumping Lemma)
Assume
Choose the string
since
By the pumping lemma write
-
∣ y ∣ ≥ 1, -
,∣ x y ∣ ≤ p |xy|\le p -
for allx y i z ∈ L .i ≥ 0 i\ge0
From
Now pump with
To belong to
This contradicts condition (3) of the pumping lemma. Therefore our assumption that
Example
Language.
Claim.
Proof (by pumping lemma).
-
Assume, for contradiction, that
is regular. Then the pumping lemma gives a pumping lengthL L .p ≥ 1 p\ge1 -
Choose the particular string
s = a p 2 ∈ L , s = a^{p^{2}}\in L, since
is a perfect square andp 2 p^{2} .∣ s ∣ = p 2 ≥ p |s|=p^{2}\ge p -
By the pumping lemma we can write
withs = x y z s=xyz -
,∣ y ∣ ≥ 1 |y|\ge1 -
,∣ x y ∣ ≤ p |xy|\le p -
and
for every integerx y i z ∈ L xy^{i}z\in L i ≥ 0.
-
-
From
we know∣ x y ∣ ≤ p |xy|\le p lies entirely in the firstx y xy symbols ofp p . Thuss s consists only ofy y ’s, soa a y = a k for some k with 1 ≤ k ≤ p . y = a^{k}\quad\text{for some }k\text{ with }1\le k\le p. Pump with
. The pumped string has lengthi = 2 i=2 ∣ x y 2 z ∣ = p 2 + k . |xy^{2}z| = p^{2} + k. We will show
is not a perfect square, sop 2 + k p^{2}+k , contradicting the pumping lemma.x y 2 z ∉ L xy^{2}z\notin L -
Note that
p 2 < p 2 + k ≤ p 2 + p < p 2 + 2 p + 1 = ( p + 1 ) 2 . Thus
lies strictly between consecutive perfect squaresp 2 + k p^{2}+k andp 2 p^{2} , so it cannot itself be a perfect square.( p + 1 ) 2 (p+1)^{2} -
Therefore
, contradicting the pumping lemma requirement thatx y 2 z ∉ L xy^{2}z\notin L for allx y i z ∈ L xy^{i}z\in L .i ≥ 0 i\ge0
Hence our assumption was false and
Example
is not regular.
Proof :Assume, for contradiction, that
Choose the string
since
By the pumping lemma we can write
-
∣ y ∣ ≥ 1, -
,∣ x y ∣ ≤ p |xy|\le p -
x y i z ∈ L for every integer i ≥ 0.
Because
Now pump with
We show
because
Hence our assumption that
Comments
Post a Comment