Computer Science EngineeringVery hard
The language {a^n b^n c^n | n >= 1} belongs to which smallest class?
- A. Context-sensitive but not context-free
- B. Regular
- C. Context-free
- D. Not recursive
Correct answer: A. Context-sensitive but not context-free
The pumping lemma for CFLs excludes it, but a linear bounded automaton can match three equal counts.
Practise more Theory of Computation, Compilers & Digital Logic (ISRO CS) questionsTheory of Computation, Compilers & Digital Logic (ISRO CS): notes and key points
More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions
- How many strings of length 3 over {a, b} contain 'ab' as a substring?
- Which regular expression over {a, b} is equivalent to (a+b)?
- The minimal complete DFA over {a, b} for strings with no two consecutive a's has how many states (including the dead state)?
- Which property immediately makes a grammar unsuitable for LL(1) parsing?
- For the grammar S -> aSb | ab, how many derivation steps produce the string aaabbb?
- For the grammar E -> E + E | id, how many reduce actions does a shift-reduce parser perform while parsing id + id?