# GATE | GATE 2017 MOCK II | Question 39

Consider a DFA accepting all strings over {a, b} where the number of a’s mod 3 = 2 and number of b’s are odd.
What is the minimum number of states of such DFA ?
(A) 4
(B) 2
(C) 6
(D) 8

Explanation:
The above question is an example of product automata. If we have two cases for which we can have separate DFA’s we can merge the two by product automata. The resulting DFA has number of states equal to the product of the states of the separate DFA’s.
Here DFA for accepting all strings over {a, b} where the number of a’s mod 3 = 2 would have 3 states. ( number of a’s mod 3 would give remainder either 0, 1, 2 so 3 states to depict each).

Similarly DFA accepting all strings over {a, b} where the number of b’s are odd ( number of b’s mod 2 = 0) would have 2 states.
Hence resulting DFA for both the conditions would have 2*3 = 6 states.

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.