Which of the following finite automata recognise the language L = {a, b}*?
A. M = ({q0}, {a, b}, δ, q0, {q0}) with δ(q0, a) = {q0}, δ(q0, b) = {q0}
B. M = ({q0, q1}, {a, b}, δ, q0, {q0, q1}) with δ(q0, a) = δ(q0, b) = {q0, q1}, δ(q1, a) = δ(q1, b) = {q1}
C. M = ({q0, q1}, {a, b}, δ, q0, {q0, q1}) with δ(q0, a) = {q0, q1}, δ(q0, b) = {q0}, δ(q1, a) = –, δ(q1, b) = {q1}
D. M = ({q0, q1, q2}, {a, b}, δ, q0, {q0}) with δ(q0, a) = δ(q0, b) = {q0}, δ(q1, a) = {q2}, δ(q1, b) = –, δ(q2, a) = {q0}, δ(q2, b) = {q2}
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. A, B, C and D
Explanation
In every machine the start state q0 is final and loops on both a and b (or can always stay in a final state), so every string over {a, b} is accepted. In D, the states q1 and q2 are unreachable and don't matter.More Theory of Computation and Compilers questions
- Which of the following statements are correct? A. Syntax-directed translation can be applied in type checking. B. Syntax-directed translati…
- Match List I with List II (stack and input configurations)List I List II A. Initial configuration of stack and input in LL parsing I. $ | w…
- The precedence of regular-expression operators from lowest to highest is:
- Consider the following statements: A. For every regular language, we can design a Turing machine. B. For every context-free language, we ca…
- The transition function δ in a multi-tape Turing machine (k tapes) is defined as:
- In the pumping lemma for regular languages, writing the string as xyz, what is the minimum length of y?