I am doing homework in Formal Languages. I urgently need a language which can be recognised by 2 PDA's but not with 1 PDA. Thanks!
2026-04-01 11:34:40.1775043280
Push Down Automata which has 2 stacks
2.5k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
The standard example is to build a recognizer for the language $$ L=\{0^n1^n2^n\ |\ n > 0\} $$ You probably already know that this is not a context-free language, so cannot be recognized by a one-stack PDA (if you don't know this fact, it's easy to come up with a pumping lemma proof that it isn't a CFL).
However, it's easy to build a two-stack recognizer for this. Informally we do this:
Of course, there are some things you'll have to add to this program, like how to recognize that you've read the right number of 1s and 2s and what to do if the input isn't of the form you need. It should be easy enough for you to fill in the details.