Sid M. answered 04/28/20
Tutor
5.0
(657)
Studied Computer Science and Engineering at University of Washington
I think this will do it.
Lbad ⇐ 0 0? ( 1 Lbad )? | 1 1? ( 0 Lbad )? | ε
or with less symbolism:
L_bad ⇐ 0
⇐ 0 0
⇐ 0 0 1 L_bad
⇐ 1
⇐ 1 1
⇐ 1 1 0 L_bad
⇐ ε
For a non-symbolic description:
An Lbad is either:
- One or two 0's, optionally followed by a 1 and an Lbad, or
- One or two 1's, optionally followed by a 0 and an Lbad, or
- the empty string.
-+- Sid