Concatenation of regular languages.

1k Views Asked by At

The concatenation of $L_1$ and $L_2$ denoted by $L_1.L_2$ = $\{uv|u\in L_1\,and\,v\in L_2\}$.

If,
$$L_1=\{a^n|n\geq0\}\,and\,L_2=\{b^n|n\geq0\}$$ Then why is $$L_1.L_2\neq \{a^nb^n|n\geq0\}$$ I am aware that regular languages are closed under concatenation and $a^nb^n$ is not regular. But why can't we represent $L_1.L_2$ as done above?

1

There are 1 best solutions below

2
On BEST ANSWER

Observe that the $n$'s in the definition of $L_1$ and $L_2$ are different $n$'s. In other words

$$L_1 = \{\mathtt{a}^{n_1} \mid {n_1} \geq 0\}\quad \text{ and }\quad L_2 = \{\mathtt{b}^{n_2} \mid {n_2} \geq 0\}.$$ or using $x$ and $y$ $$L_1 = \{\mathtt{a}^x \mid x \geq 0\}\quad \text{ and }\quad L_2 = \{\mathtt{b}^y \mid y \geq 0\}.$$

The concatentation is then $$L_1\cdot L_2 = \{\mathtt{a}^{n_1}\mathtt{b}^{n_2} \mid n_1,n_2 \geq 0\} = \{\mathtt{a}^{x}\mathtt{b}^{y} \mid x,y \geq 0\}.$$

I hope this helps $\ddot\smile$