PUMPING LEMMA:-
In the theory of formal languages, the pumping lemma may refer to:
->Pumping lemma for regular languages, the fact that all sufficiently long strings in such a language have a substring that can be repeated arbitrarily many times, usually used to prove that certain languages are not regular.
->Pumping lemma for context-free languages, the fact that all sufficiently long strings in such a language have a pair of substrings that can be repeated arbitrarily many times, usually used to prove that certain languages are not context-free. ->Pumping Lemma is used as a proof for irregularity of a language. Thus, if a language is regular, it always satisfies pumping lemma. If there exists at least one string made from pumping which is not in L, then L is surely not regular.
The opposite of this may not always be true. That is, if Pumping Lemma holds, it does not mean that the language is regular.->It states that if 'L' is an infinite language then there exists some positive integer 'n' (pumping length) such that any string say W ∈ L has greater than or equal to 'n' is |W|>=n, then W can be divided into three parts let say 'xyz' satisfy following condition:-
i) for each 'i>0', ((xy)^i)(z) ∈ L
ii) |y|>0
iii) |xy|<=n
Example:-
Prove that L = {aibi | i ≥ 0} is not regular.
Solution −
- At first, we assume that L is regular and n is the number of states.
- Let w = anbn. Thus |w| = 2n ≥ n.
- By pumping lemma, let w = xyz, where |xy| ≤ n.
- Let x = ap, y = aq, and z = arbn, where p + q + r = n, p ≠ 0, q ≠ 0, r ≠ 0. Thus |y| ≠ 0.
- Let k = 2. Then xy2z = apa2qarbn.
- Number of as = (p + 2q + r) = (p + q + r) + q = n + q
- Hence, xy2z = an+q bn. Since q ≠ 0, xy2z is not of the form anbn.
- Thus, xy2z is not in L. Hence L is not regular.
CLOSURE PROPERTIES :-
- Kleen Closure:
RS is a regular expression whose language is L, M. R* is a regular expression whose language is L*. - Positive closure:
RS is a regular expression whose language is L, M.
is a regular expression whose language is
. - Complement:
The complement of a language L (with respect to an alphabet
such that
contains L) is
–L. Since
is surely regular, the complement of a regular language is always regular. - Reverse Operator:
Given language L,
is the set of strings whose reversal is in L.
Example: L = {0, 01, 100};
={0, 10, 001}.
Proof: Let E be a regular expression for L. We show how to reverse E, to provide a regular expression
for
. - Complement:
The complement of a language L (with respect to an alphabet
such that
contains L) is
–L. Since
is surely regular, the complement of a regular language is always regular. - Union:
Let L and M be the languages of regular expressions R and S, respectively.Then R+S is a regular expression whose language is(L U M). - Intersection:
Let L and M be the languages of regular expressions R and S, respectively then it a regular expression whose language is L intersection M.
proof: Let A and B be DFA’s whose languages are L and M, respectively. Construct C, the product automaton of A and B make the final states of C be the pairs consisting of final states of both A and B. - Set Difference operator:
If L and M are regular languages, then so is L – M = strings in L but not M.Proof: Let A and B be DFA’s whose languages are L and M, respectively. Construct C, the product automaton of A and B make the final states of C be the pairs, where A-state is final but B-state is not.
- Homomorphism:
A homomorphism on an alphabet is a function that gives a string for each symbol in that alphabet. Example: h(0) = ab; h(1) =
. Extend to strings by h(a1…an) =h(a1)…h(an). Example: h(01010) = ababab.If L is a regular language, and h is a homomorphism on its alphabet, then h(L)= {h(w) | w is in L} is also a regular language.
Proof: Let E be a regular expression for L. Apply h to each symbol in E. Language of resulting R, E is h(L).
- Inverse Homomorphism : Let h be a homomorphism and L a language whose alphabet is the output language of h.
(L) = {w | h(w) is in L}.
Comments
Post a Comment