edited by
696 views
1 votes
1 votes

Why option B is wrong

edited by

2 Answers

Best answer
1 votes
1 votes

Now Consider from you point that option B is correct .

Then the word “abab” belongs to your language where w = ab 

These are the steps that you have preformed on this word

  1. on seeing “a” you push it into the stack
  2. on seeing “b” you push it into the stack 
  3. now after seeing “a” you want to pop from the stack but the “a” that you have pushed in step 1 is at the bottom of the stack there is no way  you can reach the bottom of the stack without removing the top elements of the stack

so ww is not accepted by the automata 

selected by
2 votes
2 votes

You can try to put w = epsilon, but that only covers one string and leaves many other strings present in language. 

Consider w = ab, then ww = (ab)(ab), so you need to compare first a of first string with first a of second string and so on. To do this, you need to store the first w, we can do this with stack of PDA but there is a problem that stack only accepts LIFO operation, but the a that you want to compare with is present at the bottom of the stack which is not directly accessible. You can’t also throw away the “b” at the top as you need it for further comparison. 

After seeing first w, you need to compare like:

stack:            top       bottom

                       b        a      

           with → a        b

And also this CSL, so PDA won’t be able to accept it for this very reason.