GATE / CS ARCHIVE

GATE CSE 2000 / QUESTION 7(a)

Minimal automaton for alternating bits

Theory of Computation · Finite Automata · Full GATE CSE 2000 paper

GATE 2000, Q7(a) Descriptive
Report issue

Finite Automata

Question 7(a), GATE 2000: Alphabet {0,1}; accept exactly the strings containing neither 00 nor 11 as a substring.

Task: Construct a minimal finite-state machine.
Question 7(a), GATE 2000: Alphabet {0,1}; accept exactly the strings containing neither 00 nor 11 as a substring.

Task: Construct a minimal finite-state machine.
Tap to enlarge
Shared context

Alphabet {0,1}; accept exactly the strings containing neither 00 nor 11 as a substring.

Answer & solution

Answer: Complete minimal DFA has four states: start, last-0, last-1, dead. (no official key was published)

1. Use states s (no symbol yet), z (valid prefix ending 0), o (valid prefix ending 1), and d (a forbidden equal adjacent pair has occurred). Start at s; accepting states are s,z,o, so ε is accepted.

2. Complete transition table, entries in input order 0,1: s→(z,o); z→(d,o); o→(z,d); d→(d,d). This is also a complete text specification of the requested machine.

3. Induction on the processed prefix proves the state invariant. Alternating bits move between z and o; a repeated bit enters d permanently. Thus precisely the required language is recognized.

4. All four states are reachable using ε,0,1,00. Dead d is distinguished from every accepting state by suffix ε. States s and z are distinguished by suffix 0, s and o by suffix 1, and z and o by suffix 0. Therefore no pair can merge and four states are minimal for a complete DFA. A partial drawing may omit the explicit dead state, but that is not a three-state complete DFA.

Original paper, page 7