🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: TOC Basics: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. How many strings of length at most 3 are there over Σ = {0, 1} (including ε)?
  2. Q2. What is the difference between ε and ∅?
  3. Q3. Which machine recognises context-free languages?
  4. Q4. If L = {ab}, which string is in L?
  5. Q5. Why can't a regular expression match arbitrarily deeply nested brackets?
  6. Q6. What is the reverse of the string abb?
  7. Q7. Which statement about Σ and Σ⁺ is correct?
  8. Q8. If L₁ = {a, b} and L₂ = {c, d}, how many strings are in the concatenation L₁L₂?
  9. Q9. What does this print? (code)
  10. Q10. In the Chomsky hierarchy, which language is context-sensitive but not context-free?