Back to the 2019 paper

Module 2: Context-free languages and pushdown automata

20192m

Consider the following statements about the context-free grammar:
(1) G={S→SS,S→ab,S→ba,S→ϵ}G = \{S \to SS, S \to ab, S \to ba, S \to \epsilon\}
(2) GG is ambiguous
(3) GG produces all strings with equal number of aa's and bb's

GG can be accepted by a deterministic PDA. Which combination below expresses all the true statements about GG?
(i) 1 only
(ii) 1 and 3
(iii) 2 and 3
(iv) 1, 2 and 3

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.