Language accepted by regular expression $(a + b)^*$ in set notation

453 Views Asked by At

The textbook I am reading says, "The first part, (a + b)*, stands for any string of a’s and b’s." What exactly is any string of a's and b's? Based on my understanding, $L(a + b)^* = (L(a) \cup L(b))^*$ which is {a, aa, aaa, aaaa, b, bb, bbb, bbbb, ...} But I think I am wrong.

1

There are 1 best solutions below

1
On BEST ANSWER

Based on what your textbook states, I believe that $L(a+b)=\{a,b\}$, the language with just the strings $a$ and $b$.

Then $L((a+b)^*)$ is the Kleene star operated on the above language, thus:

$$\{s_1s_2\cdots s_n\mid n\text{ is a natural number (possibly 0) and }s_i\in L(a+b)\text{ for all }1\leq i\leq n\}.$$

Hence this is the language $\{\epsilon,a,b,aa,ab,ba,bb,aaa,aab,\dots\}$, where $\epsilon$ denotes the empty string.


Note that the Kleene star operator does not distribute with the union operator, so $L((a+b)^*)\neq L(a^*)\cup L(b^*)$.