The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+12 votes
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}


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
36,701 users