GATE | GATE-CS-2001 | Question 50

Consider a DFA over ∑ = {a, b} accepting all strings which have number of a’s divisible by 6 and number of b’s divisible by 8. What is the minimum number of states that the DFA will have?
(A) 8
(B) 14
(C) 15
(D) 48


Answer: (D)

Explanation:
We construct a DFA for strings divisible by 6.
It requires minimum 6 states as length of string mod 6 = 0, 1, 2, 3, 4, 5

We construct a DFA for strings divisible by 8.
It requires minimum 8 states as length of string mod 8 = 0, 1, 2, 3, 4, 5, 6, 7

If first DFA is minimum and second DFA is also minimum then after merging both DFAs resultant DFA will also be minimum. Such DFA is called as compound automata.

So, minimum states in the resultant DFA = 6 * 8 = 48

 
Thus, option (D) is the answer.

 
Please comment below if you find anything wrong in the above post.


Quiz of this Question



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.