retagged by
1,293 views

2 Answers

3 votes
3 votes

One Approach 

1 .If you are in state Qo and a is the input and Zo is on top of the stack then push aa instead of single a

2 .If you are in state Qo and a is the input and a is on top of the stack then push aa instead of single a

3 .If you are in state Qo and b is the input and a is on top  of the stack then get the state Q1 and  pop a 

Pop one a for one b because we have already pushed 2 aa's instead of one a .

As long as you are in state Q2 keep on poping off  a for every b.

Once the string is empty you can accept it

Second Approach

instead of pushing 2 a's push only one a in state Qo and once you see a "b" make a transition in state Q2 and for every one "a" pop off 2 b's.

(for first b don't do anything and in case of second b pop off a) Do it alternatively 

Both approach's  work well....

edited by
0 votes
0 votes

Solution:

Step1:Push 'aa'  instead 'a', whenever 'a' comes on q0(Start) .

Step2: Pop one 'a' whenever 'b' comes and change the state from q0 to q1.

Step3: For all remaining 'b' repeat the same procedure staying on q1.

Step4: When ^ comes and if TOS is Z0, than go to the accept state(End).

Related questions

0 votes
0 votes
1 answer
2
Abhisek Tiwari 4 asked Nov 6, 2018
716 views
Consider Ldf set all languages accepted by DPDA by final state,Lef set of all languages accepted by DPDA by Empty stack ThenA)Ldf proper subset of Lef.B)Ldf = Lef.C)Lef ...
0 votes
0 votes
0 answers
3
Na462 asked Sep 9, 2018
637 views
Consider following PDA WHICH OF FOLLOWING IS TRUE ABOUT LANGUAGE ACCEPTED BY IT ?A. Regular but infiniteB. Regular but finiteC. DCFL but not regularD. CFL but not DCFL
0 votes
0 votes
0 answers
4
Na462 asked Sep 5, 2018
983 views
Consider A given PDA as following Qo is the start state here. What is the language accepted by the given PDA ?1. { ( bn a bn a )m | m,n ≥ 0 }2. { ( bn a bn a )m | m,n ...