logo

UTK Notes


3.19.2024

Question 1: Consider the PDA below that recognizes strings generated by the CFG G with rules $S \rightarrow bAa$; $A \rightarrow Aa \vert \epsilon$.

PDA.jpg

Which of the following is the correct list of stack elements (leftmost is top) when the b is matched from the input baa.

(3 points)

A. b A a \$
B. \$ a b A
C. A a b \$
D. b a A \$

Answer A. bAa\$

Question 2: Consider the PDA below that recognizes strings generated by the CFG G with rules $S \rightarrow bAa$; $A \rightarrow Aa \vert \epsilon$.

PDA.jpg

Which of the following is the correct list of stack elements (leftmost is top) when the first a is matched from the input baa.

(3 points)

A. b A a \$
B. a a A \$
C. a A A \$
D. a a \$

Answer D. a a \$

Question 3: Consider the PDA below that recognizes strings generated by the CFG G with rules $S \rightarrow bAa$; $A \rightarrow Aa \vert \epsilon$.

PDA.jpg

Which of the following is the correct list of stack elements (leftmost is top) when the second a is matched from the input baa.

(3 points)

A. b a a \$
B. a \$
C. A a \$
D. a A \$

Answer B. a \$

PDF Download