Using pumping lemma show that the language L, consisting of all string of 1’s whose length is a prime is not a regular language.


If we show that the language Lpr consisting of all strings of 1’s whose length is a prime is not a regular language. Then there would be a constant n satisfying the condition of the pumping lemma.
Consider some prime p ≥ n + 2, there must be such a p, since there are an infinity of primes,
Let, w = 1p
By the pumping lemma, we can break w = xyz such that y ≠ ϵ and | xy | ≤ n
Let, | y | = m, then | xz | = p – m
Now consider the string xy(p-m) z, which must be in L_pr by the pumping lemma, if L_pr really is regular. However,
| xy(p-m) z | = | xz | + (p - m) | y | = p – m + (p – m)m = (m + 1) (p – m)
It looks like | xy(p-m) z | is not a prime, since it has two factors m + 1 and p – m. However, we must check that neither of these factors are 1, since then (m + 1) (P – m) might be a prime after all. But m + 1 > 1, since y ≠ ϵ tells us m ≥ 1. Also, p – m >1, since p ≥ n + 2 was chosen and m ≤ 1. Also, p – m > 1, since p ≥ n + 2 was chosen and m ≤ n since.
m = | y | ≤ | xy | ≤ n
Thus, p – m ≥ 2.
Again, we have started by assuming the language in question was regular or and we derived a contradiction by showing that some string not in the language was required by the pumping lemma to be in the language. Thus, we conclude that Lpr is not a regular language.

No comments

Dear Members, Thanks for Your Comments. We must be reply your comment answer as soon as possible. Please Stay with us.....

Theme images by ideabug. Powered by Blogger.