Creating a regex expression for a regular language

38 Views Asked by At

$\{x \in \{0, 1 \} : x = 0^m1^n \hspace{.1cm} \text{for some} \hspace{.1cm} m, n \in N \hspace{.1cm} \text{such that} \hspace{.1cm} m * n \ge 3\}$.

I've been stuck on trying to create a regex for this language for quite a while now. Can anyone help me out here?

1

There are 1 best solutions below

0
On

The key is to decompose the condition $mn \geqslant 3$. It means either ($m = 1$ and $n \geqslant 3$) or ($m = 2$ and $n \geqslant 2$) or ($m \geqslant 3$ and $n \geqslant 1$). Thus your language can be written as $01^31^* \cup 0^21^21^* \cup 0^30^*11^*$.