Open In App

# GATE | GATE-CS-2007 | Question 29

A minimum state deterministic finite automaton accepting the language L={w | w ε {0,1} *, number of 0s and 1s in w are divisible by 3 and 5, respectively} has
(A) 15 states
(B) 11 states
(C) 10 states
(D) 9 states

Explanation:

Here a string w of 0’s and 1’s should have the property that, the no of 0’s in the string w should be divisible by 3 ( N(0) % 3 =0 ), and the number of 1’s the string w should be divisible by 5 (N(1) % 5 =0).

Having said that, the Language will contain the strings such as : { ε , 000, 11111, 00011111, 00111101 , 11111000, 10101011 , 00000011111,….and so on }

So, strings accepted by the automaton have to be of length 0, 3, 5, 8, 11, 13, 14, 16….and so on, i.e. equation for length will be 3x + 5y (where x,y>=0 )

Modulo 3 gives remainder as ( 0, 1, 2 ) , and Modulo 5 gives remainder as ( 0, 1, 2, 3, 4 ).  Hence 3 * 5 sates, i.e. there will be 15 states in the automaton to represent this.

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

Quiz of this Question