Show a counter-example to disprove the following statement:
If $R1$ and $R2$ are two regular expressions, then $L((R1 \cup R2)^*) = L(R1^* \cup R2^*)$.
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.
Sign up to join this communityShow a counter-example to disprove the following statement:
If $R1$ and $R2$ are two regular expressions, then $L((R1 \cup R2)^*) = L(R1^* \cup R2^*)$.
Let $\{a\} = R1$ and $\{b\} = R2$. $'aba'$ belongs to $L((R1 \cup R2)^*)$ but not to $L(R1^* \cup R2^*)$.
explentation:
$'aba'$ belongs to $L((R1 \cup R2)^*)$ since $a$ belongs to $R1$ than with using the $*$ itiration we take $b$ from $R2$ than again we take $a$ from $R1$ by using $*$
$'aba'$ does not belong to $L(R1^* \cup R2^*)$ excepts only $a^n$ or $b^m$.
this answer is based on @Yuval Filmus