1,289 views
2 2 votes
Is the language L = {$a^nb^m : n = 2^m$} context-free?

2 Answers

0 0 votes

By using PDA-stack we can pop logn-a’s on reading each m b’s, right?

So it means this is CFL..?

Considering m=2 gives n=4;

a
a
a
a
Z

On completion of input string reading, we’re only left with Z(top of stack)….so this is CFL 

 

 

Correct me if Im wrng ;) 

0 0 votes

The language L = {a^nb^m : n =2^m} can be shown to not be context-free by using the pumping lemma for context-free languages.

The pumping lemma states that if a language L is context-free, then there exists a number p (the pumping length) such that any string s in L of length greater than or equal to p can be divided into three substrings x, y, and z such that:

  1. |xy| <= p
  2. |y| > 0
  3. for all i >= 0, xy^i z is in L

Let's take the string "a^4b^2" which is in the language L.

We can divide the string into x = "a^2", y = "a^2", z = "b^2"

Now we can pump y any number of times to get "a^4b^2, a^6b^2, a^8b^2,..."

All of these new strings generated by pumping y are not in the language L because n is not equal to 2^m, which breaks the rule of the language L.

Therefore, we can conclude that the language L = {a^nb^m : n =2^m } is not context-free.

Position:
Show:

Related questions

1 1 vote
0 0 answers
1.2k
1.2k views
Naveen Kumar 3 asked Jun 25, 2019
1,156 views
Determine whether or not the following languages are context-free.(a) $L=$ {$a^nww^Ra^n : n ≥ 0, w ∈$ {$a,b$}*}(b) $L=$ {$a^nb^ja^nb^j : n ≥ 0, j ≥ 0$}.(C) $L=$ {$a^nb^ja...
1 1 vote
2 2 answers
914
914 views
Naveen Kumar 3 asked Jun 25, 2019
914 views
Show that the language $L=${$a^nb^nc^m,n\neq m$} is not context-free.
0 0 votes
0 0 answers
529
529 views
Rishi yadav asked Apr 15, 2019
529 views
Show that the following languages on $\Sigma = \{a,b,c\}$ are not context-free $L = \{a^nb^m: \text{n is prime and m is not ...
0 0 votes
1 1 answer
540
540 views
Rishi yadav asked Apr 15, 2019
540 views
Show that the following languages on $\Sigma = \{a,b,c\}$ are not context-free $L = \{a^nb^m:\text{n is prime or m is prim...