The Gateway to Computer Science Excellence

0 votes

The pushdown automata $M=\left \{ \left ( q_{0},q_{1},q_{2} \right ),\left ( a,b \right ) ,\left ( 0,1 \right ),\partial ,q_{0},0,\left \{ q_{0} \right \}\right \}$

$\partial \left ( q_{0},a,0 \right )=\left ( q_{1},10 \right )$

$\partial \left ( q_{1},a,1 \right )=\left ( q_{1},11 \right )$

$\partial \left ( q_{1},b,1 \right )=\left ( q_{2},\lambda \right )$

$\partial \left ( q_{2},b,1 \right )=\left ( q_{2},\lambda \right )$

$\partial \left ( q_{2},\lambda ,0 \right )=\left ( q_{0},\lambda \right )$

Accepts language

$l=\left \{ a^{n}b^{n}\mid n\geq 0\right \}$

$l=\left \{ a^{n}b^{n}\mid n> 0\right \}$

Please tell me with these two options which one is correct? I think here $q_{2}$ is accepting state , not $q_{0}$

As last transition going from $q_{2}$ to $q_{0}$ and not $q_{0}$ to $q_{2}$

Am I right?

0

This is PDA right, and "Set of Final states" has q0 which is also initial state here, so if only these two options are there we don't need to even check anything as it will accept empty string i.e, a^0b^0. So the answer would definitely be the first one

52,215 questions

59,981 answers

201,180 comments

94,637 users