Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

GATE | GATE-CS-2001 | Question 50

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads