L = (aa)*(bb)* checking if a string belongs to L* but not to L
the string is: aabbaa
I can't grasp the concept of putting a * (kleene star) on L, which already has a kleene star in it's definition.
What's the difference between L and L* microwise? if L = (aa)*(bb)* then L* = ((aa)*(bb)*)* ?? how does that make aabbaa belong to L*?
Thanks
I’m going to assume that $L$ is the language generated by $(aa)^*(bb)^*$, as in the title, and not by $(aa)(bb)$, as in the body of the question. The expression $(aa)^*$ generates all words of the form $(aa)^n$ for $n\ge 0$, which is simply $\{a^{2n}:n\ge 0\}$, the set of all strings consisting of an even number of $a$’s (possibly none). Similarly, $(bb)^*$ generates $\{b^{2n}:n\ge 0\}$. The regular expression $(aa)^*(bb)^*$ therefore generates precisely the strings of the form $a^{2m}b^{2n}$ consisting of an even number of $a$’s followed by an even number of $b$’s; in both cases the even number may be zero, and the number of $a$’s need not be the same as the number of $b$’s. In other words, $$L=\{a^{2m}b^{2n}:m,n\ge 0\}\;.$$
If $A$ is any set, $A^*$ is the set of strings that can be obtained by concatenating finitely many members of $A$. In particular, here $L^*$ is the set of all strings that can be obtained by concatenating finitely many members of $L$. Clearly $aabb\in L$: it’s $a^{2\cdot 1}b^{2\cdot1}$, and $1$ is a non-negative integer. Similarly, $aa\in L$: it’s $a^{2\cdot1}b^{2\cdot0}$, and $1$ and $0$ are both non-negative integers. Thus, $aabbaa$ is the concatenation of two members of $L$: it’s the concatenation of $aabb$ with $aa$.
In general what strings belong to $L^*$ but not to $L$? Every string in $L^*$ is the concatenation of finitely many strings in $L$, so every string in $L^*$ has the form
$$a^{2m_1}b^{2n_1}a^{2m_2}b^{2n_2}\ldots a^{2m_k}b^{2n_k}\;,$$
where $k$ is the number of words of $L$ being concatenated. (If $k=0$, the word is of course $\lambda$, the empty word.) Note that if some $n_i=0$, we can combine the neighboring blocks of $a$’s into a single block: $a^{2m_i}b^{2n_i}a^{2m_{i+1}}=a^{2(m_i+m_{i+1})}$. Similarly, if some $m_i=0$ we can combine the two neighboring blocks of $b$’s into a single block. Thus, we may write any word of $L^*$ in the form
$$a^{2m_1}b^{2n_1}a^{2m_2}b^{2n_2}\ldots a^{2m_k}b^{2n_k}\tag{1}$$
with the addition condition that $m_i>0$ for $i=2,\ldots,k$ and $n_i>0$ for $i=1,\ldots,k-1$. (It is possible to have $m_1=0$, since a word of $L^*$ can begin with $bb$, and it is possible to have $n_k=0$, since a word of $L^*$ can and with $aa$.) With this extra condition a word of the form $(1)$ is in $L$ if and only if $k=1$. This amounts to saying that a word of form $(1)$ is in $L$ if and only if it does not contain the string $ba$ anywhere. Thus, the words that are in $L^*\setminus L$ are precisely the words of $L$ that do contain the string $ba$.