GATE Computer ScienceVery hardGATE CSE
A Mealy machine starts in S0. Transitions (state, input → next state / output): (S0,0 → S0/0), (S0,1 → S1/1), (S1,0 → S2/1), (S1,1 → S1/0), (S2,0 → S0/1), (S2,1 → S2/1). For the input 1101011011100110 how many 1s appear in the output string?
- A. 14
- B. 11
- C. 12
- D. 16
Correct answer: C. 12
Tracing the 16 steps gives output 1011110111110101, which contains 12 ones.
More Theory of Computation questions
- How many strings of length at most 5 over {0, 1} (the empty string included) contain the substring 00 and also have an even number of 1s?
- A grammar in Chomsky normal form generates a string of length 17. How many derivation steps (production applications) does any derivation…
- Consider the grammar S → aSb | bSa | SS | ε. How many strings of length exactly 8 does it generate?
- For a Turing machine M given as input, which one of the following problems is decidable?
- Let L be the set of strings over {a, b} whose second symbol from the right is a, and which also satisfy: the last symbol is b, or the…
- 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?