edited by
14,492 views
24 votes
24 votes
Construct a finite state machine with minimum number of states, accepting all strings over $(a,b)$ such that the number of $a$'s is divisible by two and the number of $b$'s is divisible by three.
edited by

1 Answer

Best answer
30 votes
30 votes

A state $q_{xy}$ means  $n_a \mod \ 2 =x$ ,  $n_b \mod \ 3=y$

$q_{00}$ means $n_a \mod \ 2 =0,n_b \mod \ 3=0$   [no of $a\text{’}$s is divisible by $2$ and no of $b\text{’}$s is divisible by $3$]

$q_{00} \times a \rightarrow q_{10}$

$q_{00} \times  b \rightarrow q_{01}$  and so on.

edited by

Related questions

21 votes
21 votes
2 answers
1
go_editor asked Oct 14, 2015
7,810 views
Following is a state table for time finite state machine.$$\begin{array}{|l|ll|}\hline \textbf{Present State} & \textbf{Next State Output} \\ & \textbf{Input- 0} & \t...
41 votes
41 votes
3 answers
3