Question

In: Computer Science

Using the pumping lemma, prove that the language {1^n | n is a prime number} is...

Using the pumping lemma, prove that the language {1^n | n is a prime number} is not regular.

Solutions

Expert Solution

Pumping lemma for regular language states that,

For any regular language L, there exists an integer n, such that for all x ∈ L with |x| ≥ n, there exists u, v, w ∈ Σ∗, such that x = uvw, and
(1) |uv| ≤ n
(2) |v| ≥ 1
(3) for all i ≥ 0: uviw ∈ L

Given language L is { 1^n | n is prime}. Let us take the strings of length >= k. So, let X be string of length k.

X = uvw = 1k . Let u = 1k-2, v = 1, w = 1.

This split of x, y, z satisfies first two conditions of lemma,

|uv| = k - 1 which is <= k

|w| = 1 which is >= 1. So if, all the strings satisfies the condition-3 also, then the language becomes regular. Let's check it too,

Let us assume, 1^k is a string in language, which means k is prime.

Let i = 2, in condition-3. So uviw should belong to L if L is regular.

uviw = 1k-2.12.1 = 1k+1

If 1k belongs to L, 1k+1 should not be belonging to L. As k is prime, it will be of odd length. So k+1 will be of even length which can't be prime, and doesn't belong to language.

According to pumping lemma both the strings should be in the language for language to be regular. As only one of 1k and 1k+1 belongs to language, this language cannot be Regular according to pumping lemma.


Related Solutions

1. Pumping Lemma: a. Is the following language a regular language? (Use pumping lemma in proof.)...
1. Pumping Lemma: a. Is the following language a regular language? (Use pumping lemma in proof.) L = {0n 1n 2n | n ≥ 0} b. What is (i.e., define) the CFL pumping lemma?
Prove that {anbamba2m+n:n,m≥1} is not regular using pumping lemma
Prove that {anbamba2m+n:n,m≥1} is not regular using pumping lemma
Show that L2 = {anb2nan : n ≥ 0} is not context-free using the pumping lemma.
Show that L2 = {anb2nan : n ≥ 0} is not context-free using the pumping lemma.
Is the following language a regular language? ( Prove with pumping Lenma ) L = {...
Is the following language a regular language? ( Prove with pumping Lenma ) L = { o^n 1^n 2^n | n => 0} Define CFL pumping lemma
Do not use Pumping Lemma for Regular Expression to prove the following. You may think of...
Do not use Pumping Lemma for Regular Expression to prove the following. You may think of Closure Properties of Regular Languages 1. Fix an alphabet. For any string w with |w| ≥ 2, let middle(w) be the string obtained by removing the first and last symbols of w. That is, Given L, a regular language on Σ, prove that f1(L) is regular, where f1(L) = {w : middle(w) ∈ L}
If n>=2, prove the number of prime factors of n is less than 2ln n.
If n>=2, prove the number of prime factors of n is less than 2ln n.
Use the pumping lemma to show that the following languages are not regular. A a. A1={0^n...
Use the pumping lemma to show that the following languages are not regular. A a. A1={0^n 1^n 2^n | n≥0} b. A2 = {www | w ∈ {a,b}∗} A c. A3 ={a^2^n | n≥0} (Here, a^2^n means a string of 2^n a’s.) A ={a3n |n > 0 }
let sigma = {a,b,c}. Use the Pumping Lemma to show that the language L defined below...
let sigma = {a,b,c}. Use the Pumping Lemma to show that the language L defined below is not regular. L={ a^p c(bb)^q : q > p >1}
prove using limit lemma that n^2 > nlogn given some epsilon > 0
prove using limit lemma that n^2 > nlogn given some epsilon > 0
Prove that {0n1n2n:n≥1} is not a regular language. The decimal notation for a number is the...
Prove that {0n1n2n:n≥1} is not a regular language. The decimal notation for a number is the number written in the usual way, as a string over the alphabet {0,1,⋯9}. For example, the decimal notation for 13 is a string of length 2. In unary notation, only the symbol “I” is used; thus 5 would be represented as IIIII in unary notation. Show that each of the following is or is not a regular language. (For regular languages, write down its...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT