What is the regex of the following FSA?

782 Views Asked by At

enter image description here

This is the set of all strings that are accepted which are not 00 or 11.

I really don't see a way to have an equation for this.

The first regex part is $(0+1)$, but what then?

Also, the $\phi$ is just a dead state.

2

There are 2 best solutions below

0
On BEST ANSWER

Strings ending at $q_1$: $1(01)^*+(01)^*=(1+\lambda)(01)^*$

Strings ending at $q_3$: $0(10)^*+(10)^*=(0+\lambda)(10)^*$

So one regex is $$(\lambda+1)(01)^*+(\lambda+0)(10)^*$$

0
On

I hope it can help you

$L=\{ w \in \{0,1\}^* | w $ does not contain neither of the substrings $11$ and $00$. }

a regular expression for L is: $\epsilon + 0(10)^*(1+\epsilon)+1(01)^*(0+\epsilon)$

  1. $\epsilon \qquad\qquad\qquad:\text{empty string}$
  2. $ 0(10)^*(1+\epsilon)\quad\,\,\,: \text{string starts with 0}$
  3. $1(01)^*(0+\epsilon)\quad\,\,\,:\text{string starts with 1}$

another regular expression is: $(0+\epsilon)(10)^*(1+\epsilon)$