6. Pumping Lemma
Jan 25, 2022
Non-regular languages
-
every finite language is regular vacuously: create path for every string in the NFA
-
also automatically regular:
-
non-regular languages are infinite in size and not describable by FA or RE
-
non-regular language example:
- note: this is a subset within regular language
1 2 3 4
╭──────╮ │ -------- a*b* regular │ □ ---------- aⁿbⁿ non-regular ╰──────╯
- note: this is a subset within regular language
-
in general: non-regular languages are a subset of regular language
- the non-regular language is more restricted => more difficult to recognize
-
when
is non-regular then there exists no FA or RE accepts
=> prove using pumping lemma
Pumping Lemma
-
idea: for some long string
, automaton state is repeated in the walk due to pigeonhole principle-
number of transitions:
-
number of states needed to process the string :
-
if
, where is number of states in DFA, some state must be repeated
-
-
We can write
where-
is the substring between the first and second occurrence of -
note: states in are unique since no state is repeated except -
since there is at least 1 transition in the loop -
can be anything and can overlap with paths within -
accepted strings, in general:
,-
string
is accepted => does not loop since -
also:
, etc.
-
-
Definition
Given infinite regular language
Applications
-
Prove by contradiction that infinite language
is not regular-
Assume
is regular, then the pumping lemma should hold for -
Use pumping lemma to obtain a contradiction
- Let
be the critical length for - Choose a string
which satisfies the length condition - write
- show that
for some - this gives a contradiction since by pumping lemma
- Let
-
Therefore
is not regular
-
-
It is sufficient to show only one string
yields a contradiction
Example Proof
Prove that
-
Let
be critical length for , pick a string such that and length
Here we pick -
Identify substring
: we can write with lengths and thus1 2 3 4 5
p p |¯¯¯¯¯¯¯¯¯¯¯¯¯||¯¯¯| a...aa...aa...ab...b <--- aᴾbᴾ |___||___||________| x y z
-
for regular language, repeating of removing
still gives something that is in the language => from the pumping lemma, thus where1 2 3 4 5
p+k p |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯||¯¯¯| a...aa...aa...aa...ab...b <--- aᴾ⁺ᴷbᴾ |___||___||___||________| x y y z
-
But
therefore => contradiction -
Conclusion:
is not a regular language