How can I write the following regular expression into set theory? 0*1(0+10*1)*
Is any of the following correct?
- $$ \{0*1(0+10*1)*\}$$
- $$ \{0^n 1 (0 + 1 0^m 1)^p, n>=0, m>=0, p>=0\}$$
- $$ \{w 1 v, w ∈ \{0\}*, v ∈ \{x,z\}*, x=\{0\}*, z=\{10*1\}\}$$
The problem is with the '+' operator, which I don't know if it is possible to have in set theory notation.
+
operator is just syntactic sugar for one or more. Sox+
is equivalent toxx*
$\endgroup$grep
plus Aho's "extended" syntax) but perhaps you should clarify with whoever gave you the assignment if you are unsure. $\endgroup$