GATE / CS ARCHIVE

GATE CSE 2020 / QUESTION 51

GATE CSE 2020 Q51

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

GATE 2020, Q51 2 marks · NAT
Report issue

Finite Automata

Question 51, GATE 2020: L consists of strings over {a,b} whose number of a symbols is divisible by 2 but not by 3. Find the minimum states in a DFA for L.
Tap to enlarge
Answer & solution

Official answer: 6

Step through it (2 parts)

Worked explanation

DFA specification: states q0,…,q5; start q0; accepting q2,q4; δ(qr,a)=q((r+1) mod 6); δ(qr,b)=qr. This is a complete transition graph, with an a-cycle of length six and a b-self-loop at each vertex. Counting zero a symbols is divisible by both 2 and 3, so q0 correctly rejects. For minimality, all qr are reached by ar. The accepting suffix exponents modulo 6 for q0…q5 are respectively {2,4},{1,3},{0,2},{1,5},{0,4},{3,5}. These six sets differ pairwise. Choose an exponent in the symmetric difference to distinguish any two states, proving six inequivalent prefixes and the lower bound.

Derivation and answer

Track the number of a symbols modulo 6. On a increment the remainder, on b leave it unchanged, and accept remainders 2 and 4; these are exactly even counts not divisible by 3. All six states are reachable. From remainder r, accepting suffix lengths modulo 6 form {2-r, 4-r}. These six sets are distinct, so any pair of remainders is distinguished by some suffix ak. Myhill-Nerode therefore requires all 6 states, matching the construction.

Original paper, page 15 · Answer key