1,429 views
1 votes
1 votes
Why no of states in a dfa(language having binary strings whose integer equivalent is divisible by n) where n = 8,12.., are different form a standard dfa where we say that no of states will be n-1(for n =2,3,5)?

1 Answer

4 votes
4 votes
Remember this trick : while solving binary strings divisibility problem when interpreted as decimal number.

Divisor is d

 

If d is odd then d states are needed. i.e divisible by 3,5,7 will have 3,5,7 states

If  di even then divide it by two till you get a odd number(say x). So No. of states = x + number_of_times_divided_by_2

Eg:

12 --> (12/2),(6/2),3 (stop odd number has come) = 3+1+1 =5 sates

18 -->(18/2),9  = 9+1 = 10 states

Related questions

0 votes
0 votes
1 answer
1
vaishali jhalani asked Nov 19, 2016
485 views
No of the states in the DFA accepts all the binary strings where no of 0's are divisible by 8 or 4..What should be the answer..3 or 4?
0 votes
0 votes
0 answers
2
0 votes
0 votes
0 answers
4
ankit-saha asked Mar 24, 2022
351 views
What will be the minimal DFA for $\left \{a^{n} :n mod 3 =0 \right \}\cup \left \{a^{n} :n mod 5 =1 \right \}$