Context Free Languages questions

Q39

GATE CS 2023 CSContext Free LanguagesMCQ2 marks−2/3 if wrong
Consider the context-free grammar GG below
<br>S→aSb∣X<br>X→aX∣Xb∣a∣b<br>\begin{align*}<br>S & \to aSb \mid X \\<br>X & \to aX \mid Xb \mid a \mid b<br>\end{align*}
where SS and XX are non-terminals, and aa and bb are terminal symbols. The starting non-terminal is SS.

Which one of the following statements is CORRECT?
Show answer without attempting

Answer: B

Q40

GATE CS 2023 CSContext Free LanguagesMCQ2 marks−2/3 if wrong
Consider the pushdown automaton (PDA) PP below, which runs on the input alphabet {a,b}\{a, b\}, has stack alphabet {⊥,A}\{\bot, A\}, and has three states {s,p,q}\{s, p, q\}, with ss being the start state. A transition from state uu to state vv, labelled c/X/γc/X/\gamma, where cc is an input symbol or ϵ\epsilon, XX is a stack symbol, and γ\gamma is a string of stack symbols, represents the fact that in state uu, the PDA can read cc from the input, with XX on the top of its stack, pop XX from the stack, push in the string γ\gamma on the stack, and go to state vv. In the initial configuration, the stack has only the symbol ⊥\bot in it. The PDA accepts by empty stack.

Which one of the following options correctly describes the language accepted by PP?
Question figure
Show answer without attempting

Answer: A

0/20 correct0 marks

Related topics in Theory of Computation