GATE Computer ScienceVery hardGATE CS (PYQ pattern)
L = { w ∈ {a, b}* : |w| ≥ 2 and the first symbol differs from the last symbol }. How many states does the minimal complete DFA for L have?
- A. 4
- B. 6
- C. 5
- D. 7
Correct answer: C. 5
States: ε; then (first = a, last = a), (first = a, last = b), (first = b, last = b), (first = b, last = a). Single-symbol strings merge with the equal-ends states, so there are 5 in total.
More Theory of Computation questions
- L = { w ∈ {a, b} : w[i] = w[i+3] for every valid index i } (w is periodic with period 3). How many states does the minimal complete DFA…
- L = { w ∈ {a, b} : any two a's in w are separated by at least two b's }. How many states does the minimal complete DFA for L have?
- L = { w ∈ {a, b} : any two a's in w are separated by at least two b's, and w ends with b }. How many states does the minimal complete DFA…
- L = { w ∈ {a, b} : |w| is even and the last two symbols of w differ }. How many states does the minimal complete DFA for L have?
- L = { w ∈ {a, b} : w contains aab as a substring, or w ends with ba }. How many states does the minimal complete DFA have?
- A DFA over {a, b} has states 0 to 5, transitions 0: a→5, b→5; 1: a→5, b→3; 2: a→1, b→4; 3: a→0, b→1; 4: a→1, b→1; 5: a→5, b→4. Start 0…