Discussion
The equivalent grammar corresponding to the grammar G : S → aA, A → BB, B → aBb | ∈ is
Answer: D
The grammar has B going to aBb or to the empty string, and A going to BB, so B and A can both be empty. To remove the empty productions, add a version of each rule with the nullable variable left out: S goes to aA or to a, A goes to BB or to B, and B goes to aBb or to ab. This gives S to a | aA, A to BB | B, B to aBb | ab, option (D). Option (A) leaves the empty string out without compensating, and options (B) and (C) each miss the rule A to B or the rule B to ab.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development