GATE Computer ScienceHardGATE CS
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?
- A. 76
- B. 78
- C. 84
- D. 80
Correct answer: B. 78
All 91 strings of that form; remove the 7 with i = j and the 7 with j = k, and add back the 1 with i = j = k = 4 that was subtracted twice: 91 − 7 − 7 + 1 = 78.
More Theory of Computation questions
- 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…
- How many strings of length 7 over {a, b} do not contain aa as a substring?
- Binary numerals are read most significant bit first (leading zeros allowed, the empty string counts as 0). What is the number of states in…
- An NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting state 3. Transitions: δ(0,a) = {0,1}, δ(0,b) = {0}, δ(1,a) = δ(1,b)…