$\{w \in \{ 0,1 \}^{*}: w \text{ contains both 101 and 010 as substrings} \}$

2.3k Views Asked by At

The questions is to build a transition diagram for nondeterministic finite automata that accepts the language of all strings that contain both 101 and 010 as substrings. This is what I came up with but I am not sure if it is right:

enter image description here

Secondly, what is the point of the epsilons. Why not replacing them with the symbol (0 or 1). I hope it is clear what I mean.