in Theory of Computation
357 views
1 vote
1 vote
$a^{p}b^{p}a^{p} where p>=0$   can i write this lang. as cfl    when a come push in to the stack when b skip all b’s again when a pop all the a from the stack …..
in Theory of Computation
357 views

1 Answer

1 vote
1 vote
Approach :

Push (a) :“P” times

Push (b): “P” times

we now have “2*P” element in stack ,Now Remove 2 element  for one “a” .

Dear @jugnu1337,

In your approach you completely ignore “b” ,which can lead to some problem like this :

string: aabaa  (this string should not be accepted but it will be accepted by  your logic ).

Related questions