All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · June 2024 Re-Exam

Which of the following languages can be recognized by a Non-Deterministic Finite Automaton (NFA) but cannot be recognized by a Deterministic Finite Automaton (DFA)?
(A) L₁ = {w ∈ {0,1}* | the length of w is even}
(B) L₂ = {w ∈ {0,1}* | the length of w is odd}
(C) L₃ = {w ∈ {0,1}* | all 0's come before all 1's in w}
(D) L₄ = {w ∈ {0,1}* | w contains an equal number of 0's and 1's}
(E) L₅ = {w ∈ {0,1}* | all 1's come before all 0's in w}

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. None of the above

Explanation

NFAs and DFAs recognise exactly the same class (regular languages). No language is accepted by an NFA but not by any DFA. (L₄ is not regular, so neither can accept it.)

More Theory of Computation and Compilers questions