Which one of the following grammars generates the language ?
View worked solution
Answer: D
The given language is . This language can be partitioned into two disjoint cases:
- Case 1 (): More 's than 's. This can be written as where and .
- Case 2 (): More 's than 's. This can be written as where and .
Let us analyze the grammar in Option D:
- generates equal number of 's and 's: .
- generates one or more 's: .
- generates one or more 's: .
Using these, the start symbol generates:
- (where , representing ).
- (where , representing ).
Thus, Option D correctly generates the language .
Why other options are incorrect:
Options A, B, and C can all generate the string (where ), which is not in . For example, in Option C: .
Free practice · Your answers on this page are not saved.
