Consider a context-free grammar with the following rules.
Let . Let denote the number of times occur in , respectively. Which of the following statements is/are TRUE?
View worked solution
Answer: B;C
We can analyze the relationship between the counts of symbols by observing how the variables and terminals are generated in the grammar :
- Relation between and (Option C):
- We start with a single start symbol .
- The rule maintains the number of variables.
- The rule increases the number of variables by and introduces exactly one .
- The rule replaces each with exactly one .
- Relation between and (Option B):
- Every is introduced only via the rule , which also introduces an .
- The rule introduces an without introducing any .
Counterexample for Option A: For the string , we have and . The inequality is false, so Option A is incorrect.
Free practice · Your answers on this page are not saved.
