595 views
1 votes
1 votes
Given two languages

L1 =$a^{*}(ab+a)$

L2=$a^{+}(ab+a)$

What is L1-L2?

1 Answer

1 votes
1 votes
There is a lot that is common in between $L_1$ and $L_2$. In fact, out of observation it is clear that $L_2 \subset L_1$.

Again from observation, we can exactly identify the strings that are in $L_1$ but not $L_2$. These strings are the one which belongs to the regular expression (r.e)  $\epsilon(ab+a)$

Now, this r.e is obtained (as it might be obvious to you) by generating $\epsilon$ from $a^*$ in $L_1$. This is true because the only string that $a^*$ can generate but not $a^+$ is $\epsilon$ i.e empty string. Thus,

$$L_1 - L_2 = (ab+a)$$

 
HTH

Related questions

1 votes
1 votes
2 answers
1
Sandeep Verma asked Nov 23, 2017
479 views
What is difference between the following languages a*b* and ambn { where m <= n }
0 votes
0 votes
1 answer
2
Ashish Roy 1 asked Jul 15, 2018
1,140 views
Let L(r1)=(b*ab*ab*ab*)* & L(r2)=(b*ab*ab*)*. What is L(r1) Intersection L(r2)?a) (b*ab*ab*ab*)*b) (b*ab*ab*)*c) (b*ab*ab*)^6d) (b*ab*ab*ab*ab*ab*ab*)*Please do explain a...
0 votes
0 votes
0 answers
3
Ashish Roy 1 asked Jul 15, 2018
90 views
Let r1=(b*ab*ab*ab*)* , r2=(b*ab*ab*)*. What is L(r1) intersection L(r2)?a) (b*ab*ab*ab*)*b) (b*ab*ab*)*c) (b*ab*ab*)^6d) (b*ab*ab*ab*ab*ab*ab*)*