GATE / CS ARCHIVE

GATE CSE 2017 SET 1 / QUESTION 22

GATE CSE 2017 Set 1 Q22

Theory of Computation · Finite Automata · Full GATE CSE 2017 Set 1 paper

GATE 2017 Set 1, Q22 1 mark · NAT
Report issue

Finite Automata

Question 22, GATE 2017: For L described by (a+b)*b(a+b) over {a,b}, find the smallest number of states in a deterministic finite automaton accepting L.
Tap to enlarge
Answer & solution

Official answer: 4.0

Our answer: 4

Step through it (2 parts)

1. The expression allows any prefix, then b, then exactly one final symbol. Thus acceptance depends on whether the second-last symbol is b, and words shorter than two are rejected.

2. Use states aa,ab,ba,bb representing the last two symbols, padding the initial short prefix on the left with a. Start at aa; on input z shift xy to yz. Accept ba and bb. All four states are reachable.

3. Two states with different first symbols have different acceptance immediately. If their first symbols agree but second symbols differ, append a; their new first symbols then differ. Every pair is distinguishable, proving the four-state construction minimal.

Original paper, page 11 · Answer key