Question

In: Computer Science

Are the following languages over {a, b} regular? If they are then prove it. If they...

Are the following languages over {a, b} regular? If they are then prove it. If they are not prove it with the Pumping Lemma

a) {ap | p is a prime number}

b) {xax | x Î{a,b}*} (start by listing some strings in, not in, the language

Solutions

Expert Solution

Solution ::

Given language L is regular if we can draw a finite automata or give a regular expression or a regular grammar to L.

a- is the regular expression for given language.Hence regular

d- is the regular expression for given language.Hence regular

j-is the regular expression for given language.Hence regular

pumping lemma:

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

if a language doesnot satisfy pumping lemma properties, then it is not a regular language.

b--let the language is regular, then there is a constant k>0 and let where x=uvw.

As ,it means that for some .and

Now if we pump v, then (i.e,uvvw),then which doesn't belong to language since .

Hence this is violating the 3rd condition of pumping lemma.Hence not regular.

one can also prove that this is not regular in other way.

first we have to count number of a's and make sure that,number of b's is double the number of a's.

Hence we need stack to do that.in stack,for every a in input,we push 2a's and for every b in input ,we pop one 'a ' from top of stack.if the stack is empty by the end of input, we can say that word belongs to language.

Here no stack is available in Finite automata,we need push down automata for that.Hence this is not a regular.(This is a non formal approach).

e-let the language is regular, then there is a constant k.let where p is a prime number>k.

We don't know the decomposition of x into uvw, but since |uv| k, it follows that |w| > 1. As usual, |v| > 0.

let i = |uw|. Then |uviw|= |uw| + |v||uw| = (1 + |v|)|uw|. Since (1 + |v|) and |uw| are each greater than 1, the product must be a composite number. Thus |xyiz| is a composite number.

There fore it is not a prime and hence,it doesn't belong to language.

Therefore third condition of pumping lemma is violated.

Hence not a regular language.

Thank you::::


Related Solutions

Use the pumping lemma to prove that the following languages are not regular. (a)L2 = {y...
Use the pumping lemma to prove that the following languages are not regular. (a)L2 = {y = 10 × x | x and y are binary integers with no leading 0s, and y is two times x}. (The alphabet for this languages is {0, 1, ×, =}.) For example, 1010 = 10 × 101 is in L2, but 1010 = 10 × 1 is not. (b)Let Σ2 = {[ 0 0 ] , [ 0 1 ] , [ 1...
(35 pt.) Prove that the following languages are not regular using the pumping lemma. (15pt.)?={?????? |?,?≥?}...
(35 pt.) Prove that the following languages are not regular using the pumping lemma. (15pt.)?={?????? |?,?≥?} (20 pt.) ? = {? ∈ {?, #}∗ | ? = ??#??# ... #?? ??? ? ≥ ?, ?? ∈ ?∗ ??? ????? ?, ??? ?? ≠?? ???????? ?≠?} Hint: choose a string ? ∈ ? that contains ? #’s.
Use Myhill-Nerode Theorem to prove the following languages are not regular A1 = {0n1n2n| n >=...
Use Myhill-Nerode Theorem to prove the following languages are not regular A1 = {0n1n2n| n >= 0} A2 = {www| w E {a, b}*}
Are the following languages regular languages or not ? Justify your answer with a proof. ?...
Are the following languages regular languages or not ? Justify your answer with a proof. ? = {? | ? represents an integer strictly greater than 2020}, on alphabet Σ = {0,…,9}. ? = {? | |?|a > |?|b} on alphabet Σ = {a,b} ? = {? | ? is the code of a LOOP program syntactically correct } ? = {02?| ? ∈ ℕ} sur alphabet Σ = {0}.
3. Are the following languages A and B over the alphabet Σ = {a, b, c,...
3. Are the following languages A and B over the alphabet Σ = {a, b, c, d} regular or nonregular? • For a language that is regular, give a regular expression that defines it. • For a nonregular language, using the pumping lemma prove that it is not regular. (a) A = {d 2j+1c k+1 | j ≥ k ≥ 0} · {c r+2b 2s+3 | r ≥ 0 and s ≥ 0} (b) B = {a 2j+2b k+3c j+1...
1. Prove the language L is not regular, over the alphabet Σ = {a, b}. L...
1. Prove the language L is not regular, over the alphabet Σ = {a, b}. L = { aib2i : i > 0} 2) Prove the language M is not regular, over the alphabet Σ = {a, b}. M = { wwR : w is an element of Σ* i.e. w is any string, and wR means the string w written in reverse}. In other words, language M is even-length palindromes.
Determine whether or not the following languages are regular. If the language is regular then give...
Determine whether or not the following languages are regular. If the language is regular then give an NFA or regular expression for the language. Otherwise, use the pumping lemma for regular languages or closure properties to prove the language is not regular. 1) L = { 0 n1 k : k ≤ n ≤ 2k} 2) L = { 0 n1 k : n > 0, k > 0 } È { 1 k0 n : k > 0, n...
Suppose A and B are regular language. Prove that AB is regular
Suppose A and B are regular language. Prove that AB is regular
(a) How Context Free languages are different from Regular languages. (b) What are the automata accepting...
(a) How Context Free languages are different from Regular languages. (b) What are the automata accepting those languages and how they are different from DFA and NFA. (c) How the grammar of Context Free Languages looks different from those in Regular languages.
Using the pumping lemma for regular languages, show that language is not regular. b) L3= {0n...
Using the pumping lemma for regular languages, show that language is not regular. b) L3= {0n 1m, m = n+2 } Language= {0,1}
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT