L {w| w contains any number of substrings 00 and 11 with one 1 occurring anywhere in w}
My guess is that because 1 can be anywhere so Σ*001Σ*1Σ*11Σ* should be the regular expression. Any thoughts or corrections?
L {w| w contains any number of substrings 00 and 11 with one 1 occurring anywhere in w}
My guess is that because 1 can be anywhere so Σ*001Σ*1Σ*11Σ* should be the regular expression. Any thoughts or corrections?
Break the language definition down into parts:
L := { w |
w contains any number of substrings 00 and 11
w contains one "1"
}
The first part doesn't actually mean anything. "Any number of substrings 00 and 11" can include no substrings. It's not saying that the string must contain at least one of them. This is equivalent to Σ*
.
The second part says the string must contain 1
somewhere in it: Σ*1Σ*