retagged by
327 views

1 Answer

1 votes
1 votes

It's Simple,

$ L = \{ w | n_a (w) = n_b (w) \} $

Its pushing $0$ for each $a$, and $1$ for each $b$. If its getting $b$ and at the top of stack we have $0$ then its performing pop operation. Similarly, If its getting $a$ and at the top of stack we have $1$ then its performing pop operation.

And Yes, If we make both the states final state then language will be $ {(a + b)}^* $.

edited by

Related questions

0 votes
0 votes
0 answers
1
baofbuiafbi asked Nov 14, 2023
151 views
Prove the language L={(G,H)|G is a CFG, H is a DFA, and L(G)∩L(H)=∅} is undecidable.