I'm trying to find regular expression of $L = \{w \in \{0, 1\}^* \mid w \text{ does not contain $111$}\}$. I think there are many information about regular expression that does not contain the substring $110$. but I think $111$ is more difficult to find. can anybody help?
Asked
Active
Viewed 4,912 times
1
2 Answers
1
Everywhere you see a $1$ in this string, it is either
At the end,
followed by a $0$, or
followed by $10$.
Therefore, strings in this language are built out of copies of $0$, $10$, and $110$, possibly with an extra $1$ at the end. Can you use this to build an RE?
Mike Earnest
- 84,902
-
-
Almost. With what you have now, there is no way to get strings containing more than one instance of 110. – Mike Earnest Apr 13 '19 at 04:19
-
-
You want to allow arbitrarily many instances of $110$, so you should put $110$ within the $(\quad )^*$.@Junghoon – Mike Earnest Apr 13 '19 at 19:30
-
-
Aaaaaaalmost! The only problem is the 1? at the beginning, as this can combine with 110 to make 1110. Get rid of that and you’re golden – Mike Earnest Apr 14 '19 at 15:10
0
Use the Arden's theorem.
Answer: (0+10+110)*(€+1+11) This is probably the minimal regexp. Or maybe it can get minimised.
Details.
DFA Delta moves. Or transitions.
Qo = {A} initial state. N = {A, B, C, D(dead state) } All states
d(A, 0) = A d(A, 1) = B
d(B, 0) = A d(B, 1) = C
d(C, 0) = A d(C, 1) = D
A=A0+B0+C0 B=A1 C=B1 D=C1
Solve for A then B then C.
Note if R = RP + Q Then, R = QP* Arden's theorem.
-
As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Mar 29 '22 at 07:29
110, which attempts have you made to adapt their methods to111? – hmakholm left over Monica Apr 12 '19 at 17:54