Consider the language L = {a^(nk) | k > 0}, where n is a fixed non-negative integer. The minimum number of states of a finite automaton accepting L is
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. n + 1
Explanation
L has strings of length n, 2n, 3n, …, excluding ε. A cycle of n states counts length mod n, plus a separate start state so that ε is rejected: n + 1 states.
More Theory of Computation and Compilers questions
- The number of substrings that can be formed from a string given by a d e f b g h n m p is
- Consider the languages L₁ = {x | for some y with |y| = 2|x|, xy ∈ L} and L₂ = {x | for some y with |x| = |y|, xy ∈ L}, where L is a regular…
- Consider L₁ = {a^(n+m) bⁿ aᵐ | n, m ≥ 0} and L₂ = {a^(n+m) b^(n+m) a^(n+m) | n, m ≥ 0}. Which one is correct?
- Consider to be any regular language and L , L 1 2 be any two context-free languages. Which one of the following is correct?
- Consider the following problems : (i) Whether a finite state automaton halts on all inputs ? (ii) Whether a given context free language is…
- Which of the following problems is decidable for recursive languages L?