GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 2.5

DFA tracking two independent modular counts

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

GATE 2001, Q2.5 2 marks · MCQ
Report issue

Finite Automata

Question 2.5, GATE 2001: Find the minimum DFA size over {a,b} accepting exactly strings whose a-count is divisible by 6 and b-count by 8. Options: 8,14,15,48.
Question 2.5, GATE 2001: Find the minimum DFA size over {a,b} accepting exactly strings whose a-count is divisible by 6 and b-count by 8. Options: 8,14,15,48.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step 1: Store a pair(i,j), where i is the number of a symbols modulo 6 and j the number of b symbols modulo 8. Reading a increments only i; reading b increments only j. Accept(0,0). This constructs 6·8=48 states.

Step 2: Every pair is reached by ai bj. For two distinct pairs, append a number of a and b symbols that brings the first pair to(0,0). The second pair retains a nonzero difference in at least one residue and rejects. Thus all pairs are distinguishable.

The construction is minimal, giving 48, D, not the sum 6+8.

Original paper, page 4