378 views
0 votes
0 votes
L1 = {a^nb^n, n>=0}

L2 = {a^nb^m , n not equal to m)

So how L1 U L2 is regular?

 

I know, L1 U L2 will have RegEx a*b* which is regular but how this RegEx comes can someone please take strings generated by L1 and L2 and then UNION them, I need to know how to UNION them strings. Thanks

1 Answer

Best answer
3 votes
3 votes

A language is a set.

So, $L_{1} = \{a^{n}b^{n} : n \geq 0\}$

Which can be written like this: $\{\epsilon , ab, aabb, aaabbb, aaaabbbb, ... \}$.

And $L_{2} = \{a^{n}b^{m} : n \neq m\}$ 

Which is: $\{aab, abb, aaab, aaabb, abbb, aabbb, ... \}$.

When you union these two languages (or, sets), you get another set, which contains elements (or strings), which is in at least one of the two sets.

From this you can see, the union of these two languages will give:

$\{\epsilon , ab, aabb, aaabbb, aaaabbbb, ... , aab, abb, aaab, aaabb, abbb, aabbb, ... \}$

Which is nothing but the set of strings of the type $a^{*}b^{*}$.

Which is a regular language.

Hope it helps :)

selected by

Related questions

0 votes
0 votes
2 answers
2
iarnav asked Dec 22, 2018
624 views
WXW^R where W,X belongs to (0,1)*W^R is reverse of a string!
12 votes
12 votes
1 answer
3
Utk asked Dec 30, 2015
2,202 views
Consider following languages :L1 = { wxwy | x,w,y $\in$(a + b)+ } ,L2 = { xwyw | x,w,y $\in$(a + b)+ } ,L3 = { wxyw | x, y, w $\in$(a+b)+ } How can we say that L1 , L2 ar...