What is the regular expression for the set of binary strings with the property that
- every $0$ is followed by exactly $m$ times $1$ and
- every $0$ is preceded by at least $n$ times $1$?
$m$ and $n$ are integers.
What is the regular expression for the set of binary strings with the property that
$m$ and $n$ are integers.
@SamM's answer isn't completely right. Yes, it is $(01^m)^*$ for "each zero is followed by exactly $m$ ones", but this can't just be combined with "at least $n$ ones before". And a string of only ones complies always. So consider the ones between two zeroes:
Vonbrand already provided an answer for the case where the strings are defined over $\{0,1\}$. I'm considering the larger alphabet $\{0,1,2\}$ (this can easily be extended to any other alphabet, $2$ basically stands for anything but a $0$ or a $1$).
The answer still depends on $n$ and $m$