GATE Computer ScienceHardGATE CS
Let r = (aab + ab + b)*(ba + a)*. The number of strings of length 7 over {a, b} that are NOT in L(r) is
- A. 27
- B. 32
- C. 24
- D. 21
Correct answer: C. 24
Filtering all 128 strings of length 7 by the expression (or complementing its DFA and counting) leaves 24 non-members. The shortest non-member is aaab, and the counts of non-members for lengths 4 to 7 are 1, 3, 9, 24.
More Theory of Computation questions
- Consider the languages: I. HALT = { ⟨M, w⟩ : M halts on w }; II. EQTM = { ⟨M₁, M₂⟩ : L(M₁) = L(M₂) }; III. TOTAL = { ⟨M⟩ : M halts on…
- Which of the following languages can be accepted by a deterministic pushdown automaton by EMPTY STACK (the stack is empty at the end of…
- How many strings of length 12 of the form aⁱbʲcᵏ (i, j, k ≥ 0, i + j + k = 12) satisfy i ≠ j and j ≠ k?
- Let L be the set of binary strings that, read as unsigned numbers MSB first (ε counts as 0 and is accepted), are divisible by 56. How many…
- Let L = { w ∈ {a, b} : |w| ≡ 0 (mod 3) and w contains ab as a substring }. How many states does the minimal complete DFA for L have?
- Over {a, b}, let L = { w : the number of a's in w is ≡ 1 (mod 3) and w ends with b }. How many states does the minimal complete DFA for L…