Professional Documents
Culture Documents
What are the languages for which we *cannot* design a DFA or an NFA?
If L is a regular language, then there exists a positive integer constant n such that
for every string w in L with length at least n, we can break w into 3 strings, i.e.,
w = x ◦ y ◦ z (or w = xyz), such that:
We will do a proof later if time permits. First, let us try to understand this, and
verify that this holds for regular languages:
Another interesting example: The language {0} (with a single string ‘0’ in
it) is regular. How does pumping lemma work on this language?
(Hint: Take n to be 2 in this case, then the Lemma holds true!)
To show that L0n1n is not regular, it is enough to prove the below claim.
Claim: No matter what is the value you fix for n, all strings w in this
language of length at least n cannot be written as w = x ◦ y ◦ z such that
the pumping lemma properties hold true (we need not check it for all
values of k. It is enough to check for k = 0 and k = 2 in most cases.
i.e., (i) y is not empty string, (ii) length of x ◦ y is at most n, and (iii) x ◦ z
and x ◦ y ◦ y ◦ z are also in L.
Proof: No matter what is the value of n, let us take w as the string with n
zeroes followed by n 1’s. It is easy to see |w| ≥ n, (as |w| = 2n) and that
w is in L. Now, let us try to write w = x ◦ y ◦ z, with y as a non-empty string.
Case 1: If y contains only 0s, then for k = 0, the string x ◦ z (that we get on
removing ‘y’ part from w) cannot be in L.
Case 2: If y contains some 1’s: say y = ‘01’ or ‘0011’, then we have that
|x ◦ y| > n, as y goes to the second half of the string w. So we can rule this
out. (because the first 2 parts itself is longer than n)
Here also, if we have to write w = x ◦ y ◦ z such that y is not empty string and
also|x ◦ y| ≤ n, then the only possible case is that y contains only 0s. Obviously,
this means x ◦ z and x ◦ y ◦ y ◦ z are not in L.
Exercise: Try proving that Lpalindrome is not regular.
Proof idea: It is enough to show that if you have a DFA (or NFA) A for a language
LA and another DFA (or NFA) B for language LB, then we can design an NFA C that
recognizes LA U LB.
[Proof Details: We already did this earlier, while showing that we can build an
NFA that recognizes the language of A + B from NFA for A and NFA for B].
[Proof: This is also done when we showed that we can build an NFA for A ◦ B if
we have NFAs for expressions A and B].
Theorem: Regular languages are closed under Kleene Closure (star operation).
[Proof: This is also done already -- we showed that we can build an NFA for A*
if we have an NFA for expression A].
Proof Idea: This is also simple, it is enough to show that one can build a DFA for
the language A ∩ B if we have DFAs for A and for B separately.
Proof details:
Let DA (QA, Ʃ, 𝛿A, q0A, FA) be the DFA for A and DB (QB, Ʃ, 𝛿B, q0A, FA) be the DFA
for B. Note that the input alphabet is same for both of them.
(Proof idea: This we have seen already. We only have to interchange the accept
states and non-accept states in the DFA of A to get a DFA for Ᾱ ).
We can add more such theorems, but they would follow from the closure
properties we have given here. (For example, regular languages are closed under
set difference. i.e., A \ B is regular if A and B are regular. Note that A \ B is same
as A ∩ ).