Skip to content

UGC NET CS 2022Theory of Computation and Compilers › Context Free LanguageVerified

UGC NET CS 2022 PYQ: Consider the following $\text{NPDA}$ $=\left(\left\{q_{0}, q_{1}, q_{f}\right\}\{a, b\},\{1, z\}, \delta,…

Consider the following $\text{NPDA}$ $=\left(\left\{q_{0}, q_{1}, q_{f}\right\}\{a, b\},\{1, z\}, \delta, q_{0}, z,\left\{q_{f}\right\}\right)$
$$\begin{array}{l} \delta\left(q_{0}, \lambda, z\right)=\left\{\left(q_{f}, z\right)\right\} \\ \delta\left(q_{0}, a, z\right)=\left\{\left(q_{1}, 11 z\right)\right\} \\ \delta\left(q_{1}, a, 1\right)=\left\{\left(q_{1}, 111\right)\right\} \\ \delta\left(q_{1}, b, 1\right)=\left\{\left(q_{1}, \lambda\right)\right\} \\ \delta\left(q_{1}, \lambda, z\right)=\left\{\left(q_{f}, z\right)\right\} \end{array}$$
Which of the following Language $L$ is accepted by $\text{NPDA}$?

  1. A
    $L=\left\{a^{2 n} b^{n}: n \geq 0\right\}$
  2. B
    $L=\left\{a^{n} b^{2 n}: n \geq 0\right\}$
    Correct answer
  3. C
    $L=\left\{a^{2 n} b^{n}: n>0\right\}$
  4. D
    $L=\left\{a^{n} b^{2 n}: n>0\right\}$

Answer

(B) $L=\left\{a^{n} b^{2 n}: n \geq 0\right\}$

Approach

Trace the stack behaviour to read off the accepted strings.

Reviewed by UGC IQ Editorial Team.