What this automaton about

47 Views Asked by At

Given is a (finite state) automaton $M=(\{0,1,2,3\},\{0,1\},d,0,\{2\})$

where $$d(0,0)=0, d(1,0)=1,d(2,0)=2,d(3,0)=3,d(0,1)=1,\\ d(1,1)=2,d(2,1)=3,d(3,1)=0$$

I need to find what language this automaton accepts.

after I draw I got 0*10*1(10*10*10*1+0)* using Thompson construction is this automata, will accept all strings, that have 2 "1" in it and 4 "1" in it?

since node 2 will accept the language after 2 "1" appear,  i was confuse what happen after there is 111111 or 1111 after pass node 2.

1

There are 1 best solutions below

6
On BEST ANSWER

It's clear that $0$'s have no effect on the state, as $d(i,0)=i$ for all $i$.

So to reach an end state we need to see 2 $1$'s: to get to state 1 and then to state 2. If we see one more we move to 3 and stay there, only to restart at 0 when we see another 1. We've then seen 4 1's and are back at the start. So we reach 2 precisely when we have 2, 6, 10 or in general $4n+2$ for $n \in \Bbb N$ $1$'s in the string.

In regular expression terms a possible solution could be $0^\ast10^\ast10^\ast(10^\ast10^\ast10^\ast10^\ast)^\ast$: precisely 1 group with $2$ 1's followed by 0 or more groups with exactly $4$ 1's.