How does the push-down automaton have to look like?

54 Views Asked by At

Could you give me a hint how to find a push-down automaton for the language:

$$L=\{ a^n b^{2n} | n \in \mathbb{N}\}$$

How does the push-down automaton have to look like?

1

There are 1 best solutions below

0
On

I'm reposting mjqxxxx's comment because it hits the nail on the round flat part.

Start in state $A$ with an empty stack. For each a you read in state $A$, push two tokens on the stack. When you encounter your first b, move to state $B$ and pop a token from the stack. For each additional b you read in state $B$, pop a token from the stack. REJECT if you try to pop from an empty stack, if you encounter an a while you're in state $B$, or if the stack isn't empty when you're done reading the string; otherwise ACCEPT.