Symbol raised to the power of asterix raise to the power of asterix in regex

33 Views Asked by At

To describe the regex (a*+b+a)* in plain English you would simplify it to (a*)* + (b)* + (a)* . How would you describe (a*)* in English as the rest is just any number of bs or any number of as?

1

There are 1 best solutions below

0
On BEST ANSWER

In your first step you distributed the Kleene star over $+$, but note that that does not hold in general. The string $aaaba$ is a member of the first language but not the second.

What you are allowed to do is observe that having the $a^*$ inside the brackets is redundant, since we can already take an arbitrary number of powers of $a$ using the outside Kleene star. So this language is the same as $(a+b)^*$. The second language is equivalent to $a^*+b^*$, which as I noted before is not equal to $(a+b)^*$.

To answer your second question, $(a^*)^*$ is simply the same as $a^*$; both include any number of $a$s.