GATE Computer ScienceHardGATE CSE
Over {a, b, c}, let L = {aⁱbʲcᵏ : i = j} ∪ {aⁱbʲcᵏ : j = k} (i, j, k ≥ 0). How many strings of length at most 12 belong to L?
- A. 98
- B. 88
- C. 105
- D. 93
Correct answer: D. 93
Each part has 49 strings of length ≤ 12; the overlap is {aⁿbⁿcⁿ} with n = 0..4, i.e. 5 strings; by inclusion–exclusion 49 + 49 − 5 = 93.
More Theory of Computation questions
- Let A ≤ₘ B denote a many-one (mapping) reduction from A to B. How many of the following hold for all A, B? (i) B decidable ⇒ A decidable…
- Consider the grammar S → aSa | bSb | a | b | ε. How many strings of length exactly 7 does it generate?
- Let L = { w ∈ {a, b} : the number of a's is divisible by 4 and w contains bb as a substring }. How many states does the minimal complete…
- A DFA reads 12-bit strings (MSB first) and accepts exactly those whose binary value is divisible by 7 (the all-zeros string included). How…
- Which one of the following languages over {0, 1} is regular?
- Let L = { w ∈ {a, b} : (na(w) − 2·nb(w)) mod 6 ∈ {0, 3} }, where na and nb count the a's and b's. How many states does the minimal…