edited by
7,501 views
12 votes
12 votes

Consider the pushdown automaton $\text{(PDA)}\;P$ below, which runs on the input alphabet $\{a, b\}$, has stack alphabet $\{\perp, A\}$, and has three states $\{s, p, q\}$, with $s$ being the start state. A transition from state $u$ to state $v$, labelled $c / X / \gamma$, where $c$ is an input symbol or $\epsilon, X$ is a stack symbol, and $\gamma$ is a string of stack symbols, represents the fact that in state $u$, the $\text{(PDA)}$ can read $c$ from the input, with $X$ on the top of its stack, pop $X$ from the stack, push in the string $\gamma$ on the stack, and go to state $v$. In the initial configuration, the stack has only the symbol $\perp$ in it. The $\text{(PDA)}$ accepts by empty stack.

Which one of the following options correctly describes the language accepted by $P ?$

  1. $\left\{a^{m} b^{n} \mid 1 \leq m\right.$ and $\left.n \lt m\right\}$
  2. $\left\{a^{m} b^{n} \mid 0 \leq n \leq m\right\}$
  3. $\left\{a^{m} b^{n} \mid 0 \leq m\right.$ and $\left.0 \leq n\right\}$
  4. $\left\{a^{m} \mid 0 \leq m\right\} \cup\left\{b^{n} \mid 0 \leq n\right\}$
edited by

5 Answers

2 votes
2 votes
in this pda emtpy string wont be accepted considering empty stack acceptance. Only in option A empty string isn’t part of the language.
1 votes
1 votes
1 votes
1 votes
Only state q empties all the symbols from the stack, so the string must reach to state q in order to get accepted.

Several ways to get into state q are – {$a^{m} | m>1$}  U  {$a^{m}b^{n} | n<m$}  

combining them we will get,

$L(P) = $ {$a^{m}b^{n} | 1\leq m\ and\ n<m$}, so option (A) is the answer.
Answer:

Related questions

9.6k
views
5 answers
14 votes
admin asked Feb 15, 2023
9,649 views
Consider the context-free grammar $G$ below\[\begin{array}{l}S \rightarrow a S b \mid X \\X \rightarrow a X \mid X b \mid a \mid b,\end{array}\]where $S$ and $X$ are non-...
9.8k
views
4 answers
9 votes
admin asked Feb 15, 2023
9,838 views
Consider the language $L$ over the alphabet $\{0,1\}$, given below:\[L=\left\{w \in\{0,1\}^{*} \mid w \text { does not contain three or more consecutive } 1 \text { 's }\...
8.3k
views
1 answers
8 votes
admin asked Feb 15, 2023
8,278 views
Consider the following program:int main() { f1 (); f2(2); f3(); return (0); } int f1 () { return(1); } int f2 (int X) { f3(); if (X==1); return f1 (); else return (X * f2...
12.7k
views
4 answers
12 votes
admin asked Feb 15, 2023
12,730 views
Consider the control flow graph shown.Which one of the following choices correctly lists the set of live variables at the exit point of each basic block?$\text{B1: { }, B...