Kleene closure solves any equation

270 Views Asked by At

I need to solve a question but I'm quite sure I don't understand it correctly. Here's the question with its answers:

In each of the following cases, find a regular expression R that satisfies the equation.

(a) $L(R) = L(R^∗ )$

$R = ε$

(b) $L(R) = L(aR ∪ b)$

$R = a^∗ b$

(c) $L(aR) = L(bR)$

$R = ∅$

What I understand:

I need to find a regular expression. If I substitute this expression on both sides of the equation (in the place of $R$), I can generate the same strings on both sides.

My answer: $R = \lbrace a ∪ b\rbrace^*$

(which is just the Kleene closure of the combination)

I think this answer works for the whole question. That's why I'm assuming that I don't understand it correctly.

(a) $\lbrace a ∪ b\rbrace^{**}$ is the same as $\lbrace a ∪ b\rbrace^*$

(b) $a\lbrace a ∪ b\rbrace^* ∪ b$ is the same as $\lbrace a ∪ b\rbrace^*$

(c) $a\lbrace a ∪ b\rbrace^*$ is the same as $b\lbrace a ∪ b\rbrace^*$

What am I overlooking?

1

There are 1 best solutions below

0
On BEST ANSWER

The regular expression $(a\cup b)^*$ is indeed an answer to (a); in fact, if $\rho$ is any regular expression, then $\rho^*$ is an answer to (a). However, $(a\cup b)^*$ is not an answer to (b) or (c):

  • $bb\in L\big((a\cup b)^*\big)\setminus L\big(a(a\cup b)^*\cup b\big)$, since every word in $L\big(a(a\cup b)^*\cup b\big)$ either begins with $a$ or is $b$, and
  • $a\in L\big(a(a\cup b)^*\big)\setminus L\big(b(a\cup b)^*\big)$, since every word in $L\big(b(a\cup b)^*\big)$ begins with $b$.