The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+12 votes
344 views
Give a deterministic PDA for the language $L=\{a^ncb^{2n} \mid n \geq 1\}$ over the alphabet $\Sigma = \{a,b,c\}$. Specify the acceptance state.
asked in Theory of Computation by Veteran (68.9k points)
retagged by | 344 views

1 Answer

+13 votes
Best answer

L={a^n c b^2n}

   ={acbb,aacbbbb,aaacbbbbbb,.......}

Here 'c' act as center. Push 2 a's for 1 'a'  and when you see 'c' pop the b's

 

answered by (453 points)
selected by
you can't set q1 as an accepting state because if suppose string is aacb then it will be accepted. So, you have to make one more state from q1 to  q2( i.e final state) for the (e, Zo / Zo).


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

32,693 questions
39,293 answers
110,109 comments
36,701 users