2

Let $ A = \{a,b\}$ be an alphabet. Please hint me with show, that this regexes are equivalent. That means, we should show that: $L(e_1 )= L(e_2)$

1) $(a^*b)^*a^* = (a+b^*)^*$

2) $(a+b^*)^* = (a^*b^*)^*$

$+$ means or.

user180834
  • 1,453
  • I don't think the regexes in (1) are equivalent: $(ab)$ matches a lone $b$ while the $(a+b)$ does not (I understand the $+$ as in egrep, that is, $a+$ is the same as $aa*$; if it means something different for you, please specify). The same is true for the second pair, where the right hand side matches a lone $b$ while the left hand side doesn't. – celtschk Apr 12 '15 at 09:15
  • No, + means or. – user180834 Apr 12 '15 at 09:21
  • Ah, OK, probably you should specify that in your question; I'm sure I'm not the only one who misunderstands it. – celtschk Apr 12 '15 at 09:31
  • What is $e_1$ and $e_2$? – mrp Apr 12 '15 at 09:42
  • @mrp: Any two regular expressions whose equivalence is to be proved. – Brian M. Scott Apr 12 '15 at 14:45

1 Answers1

1

In this case I think that the simplest approach is probably to show that

$$L\big((a^*b)^*a^*\big)=L\big((a+b^*)^*\big)=L\big((a^*b^*)^*\big)=\{a,b\}^*\;,$$

i.e., that each of the three regular expressions is equivalent to $(a+b)^*$. This is especially easy with $(a+b^*)^*$. Clearly $L(a+b)\subseteq L(a+b^*)$, so $L\big((a+b)^*\big)\subseteq L\big((a+b^*)^*\big)$. On the other hand, $L\big(e)\subseteq L\big(a+b)^*\big)=\{a,b\}^*$ for every regular expression $e$ over the alphabet $\{a,b\}$, so $L\big(a+b^*)^*\big)=L\big((a+b)^*\big)$.

Similarly, $L(a+b)=L(a)\cup L(b)\subseteq L(a^*b^*)$, so ... ?

I’ll leave $(a^*b)^*a^*$ for you for now, but feel free to leave a question if you get stuck.

Brian M. Scott
  • 616,228
  • Thanks But I didn't deal with second. I suppose that I should show: $(a^b^)^* \subset (a^b)^a^* $. Don't give me a solution. Give me a hint. :( – user180834 Apr 13 '15 at 17:24
  • 1
    @user180834: That would be one way to do it, yes. I think, though, that I’d notice that $L(a+b)=L(a)\cup L(b)\subseteq L(a^b)$, so $L\big((a+b)^\big)\subseteq L\big((a^b)^\big)$ and then show that this is contained in ... ? – Brian M. Scott Apr 13 '15 at 18:09
  • I am not sure, if it is true: $L(a+b)=L(a)\cup L(b)\subseteq L(a^b)$ Why? $L(a) = {a}$ $L(b) = {b}$ and it's not true, that ${ a } \subset L(a^b)$ – user180834 Apr 13 '15 at 19:13
  • 1
    @user180834: Oops. You’re right; I have no idea what I was thinking when I wrote that. Your suggested approach probably is as easy as any. A genuine alternative is to start by showing that $L\big((a^b)^\big)=L\big((a+b)^*b\big)$. – Brian M. Scott Apr 14 '15 at 15:14
  • yes. So $L\big((a^b)^\big)=L\big((a+b)^b\big)$ and it's not true, that $L(a^b)^* ) =L(a+b)^*$? – user180834 Apr 14 '15 at 18:53
  • 1
    @user180834: Almost: I forgot about the empty word, so I should have written that $L\big((a^b)^\big)={\lambda}\cup L\big((a+b)^b\big)$: the non-empty members of $L\big((a^b)^\big)$ are the words that end with $b$. And that’s why $L\big((a^b)^\big)\ne L\big((a+b)^\big)$. – Brian M. Scott Apr 14 '15 at 19:00
  • 1
    @user180834: You’re welcome. I’m sorry about all of the mistakes; I seem to be having a bad day! – Brian M. Scott Apr 14 '15 at 19:04