Regular expressions and equality

208 Views Asked by At

Is the equality true or false?

$(r^*s^*)=(r+s)^*$

My Approach:

Assume the alphabet used is {0,1}$^*$

Equality is false:

If r = 0 and s = 1

Then if 0101 $∈$ $(0 + 1)^*$ this is true because $(0 + 1)^*$ contains all strings that contain 0 or 1

But 0101 $∉$ $(0^*1^*)$ because this contains all 0s followed by all 1s so 0101 is not a member of this set by this definition.

Also $(0^*1^*)$ $⊂$ $(0 + 1)^*$ but $(0 + 1)^*$ $⊄$ $(0^*1^*)$