language kleene star union not equal to union of language kleene star

2.4k Views Asked by At

Find languages A and B such that $A^* \cup B^* \neq (A \cup B)^*$.

Is this even possible?

I tried:

$A:\{$ $\epsilon $ $\}$ and B:$\{$ $1$ $\}$

$A^*= \{\epsilon \}$ and $B^*=\{\epsilon,1,11,111,....\}$

$A \cup B = \{ \epsilon , 1\}$

$A^* \cup B^*= \{\epsilon, 1, 11, 11,111,.....\}$

$(A \cup B)^*=\{\epsilon, 1, 11, 11,111,.....\}$

because lets say $C=(A \cup B)$ and $C=\{ \epsilon,1 \}$, so $C^*=\{\epsilon, 1, 11, 11,111,.....\} $ which is exactly not what I want.

Problem I have is whatever $A \cup B$ outputs, they will get the kleene star outside of the parenthesis which will basically make it the same as the union of kleene stars. Also kleene star will add $\epsilon$ to the resulting languages so I can't trick it by using that. Is my logic flawed?

1

There are 1 best solutions below

2
On BEST ANSWER

If $A=\{a\}, B=\{b\}$ then $ab \in (A \cup B)^\ast$ but $ab \notin A^\ast \cup B^\ast$.