Question Id : 17407 |
Context : UGC NET Computer Science June 2024 (Paper II)
The language of the following PDA would be:
$\delta(q_0,a,z_0)=(q_0,aaaz_0)$
$\delta(q_0,a,a)=(q_0,aaa)$
$\delta(q_0,b,a)=(q_1,\lambda)$
$\delta(q_1,b,a)=(q_1,\lambda)$
$\delta(q_1,\epsilon,z_0)=(q_f,z_0)$ where $q_f$ is a final state.
🎥 Video solution / Text Solution of this question is given below:
Each time an a is read:
$a \rightarrow$ push 3 a's onto the stack.
Each b pops one a from the stack.
Thus:
1 input a produces 3 stack symbols, so we need 3 b's to remove them.