Discussion
State whether the following is true or false.
The set of strings consisting of n opening brackets followed by n closing brackets is a regular language.
Answer: C
Correct answer: False
This is the standard non-regular language. A finite automaton would have to remember how many opening brackets it had seen in order to require the same number of closing ones, and with finitely many states it cannot count without bound. The pumping lemma makes the argument precise, and the same reasoning is why nested comments defeat a pure scanner.
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