Can someone show in some simple steps how one goes about creating a regular expression from binary digits that excludes all occurrences of 111? What I am having trouble is how one starts these sorts of problems, and how to validate if the solution is correct. There must be some methodology or strategy to tackle these sorts of problems?
I'm also unsure if a string like "1011" counts as as a "111", or is it only three of the digits 1 repeated next to each other like "111"? I assume it means "111"...
What I came up with is:
0*(10)(ϵ ∪ 1)(10 ∪ 01* ∪ 0*)
but I have no idea if this is right or how I can validate the solution other than plugging random strings into it to test.
The way I understood this expression I wrote is "any combo of zeros or 10s (i.e. 101010), that end in zero, one or epsilon, followed by 10s, 01 digits or strings of zeroes." This was my thought process, but I feel sketchy if there are other strings that might also work or numerical logic I have overlooked.