[Math] How to draw DPDA for language $L = \{a^ncb^{2n} | n \geq1\}$over the alphabet $\Sigma =\{a,b,c\} ?$

context-free-grammarformal-grammarformal-languages

An exercise problem $:$

Give a deterministic PDA for the language $L = \{a^ncb^{2n} | n \geq1\}$over the alphabet $\Sigma =\{a,b,c\}$.Specify the acceptance state.


My attempt $:$

Grammar of given language is :

G: S → aSbb | c

We can recognize string of $L$ :

  1. Push all a's in the stack ,
  2. Excape 'c',
  3. Pop single a's from stack for every two b's of string,
  4. If the final stack is empty/final state then string in the given language else not .

Since , we are recognizing string of the language ,so $L$ is DCFL.

I find the PDA(see-page-no.-26) for the $L = \{a^nb^{2n} | n \geq1\}$over the alphabet $\Sigma =\{a,b\}$.


Can you please give explanation to draw DPDA for language $L =
\{a^ncb^{2n} | n \geq1\}$over the alphabet $\Sigma =\{a,b,c\}$.

Best Answer

Try this one: $$\quad\quad\quad\quad\quad\quad$$

enter image description here

Related Question