Discussion
For which context free languages below, we can construct an equivalent PDA with one (1) stack :
(i) \(L = \{a^{n}b^{n}c^{n} / n \ge 1\}\)
(ii) \(L = \{a^{n}b^{n} / n \ge 1\}\)
(iii) \(L = \{a^{n}b^{2n} / n \ge 1\}\)
Answer: B
A single-stack PDA exists for (ii) and (iii) only.
For \(a^{n}b^{n}\), the PDA pushes a symbol for each a and pops one for each b, accepting when the stack empties as the input ends. For \(a^{n}b^{2n}\), it pushes two symbols for each a (or pops one for every two bs) in the same way. Both are context-free.
\(a^{n}b^{n}c^{n}\) is the standard example of a language that is not context-free: after the stack has been used to match the as against the bs, nothing remains to check the cs. The pumping lemma for context-free languages proves this, so no PDA with one stack accepts it, and options including (i) are wrong.
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