470 views
2 votes
2 votes

Consider a regular expression over the alphabet set $\{r,s\}$. The following regular expressions are to be considered

  1. $( r^{*}s^{*})^{*}+ (r^{+}s^{+})^{*}$
  2. $(r^{+}s^{+}r^{+} )^{+}+ (\varepsilon + r)^{*}$
  3. $(rs^{*}+sr^{*})^{*}+(\varepsilon +s)$
  4. $( (rs^{*})^{*}r)^{*}+( (sr^{*})^{*}r)^{*}$

Choose the correct answer?

  1. all are equivalent to $(r+s)^{*}$
  2. all are equivalent to $(r+s)^{+}$
  3. all denote an infinite number of strings but not equivalent to $(r+s)^{*}$
  4. all denotes a finite number of strings

1 Answer

0 votes
0 votes
Please correct me if I am wrong.

 

In option (1) $(r^{*}s^{*})^{*} + (r^{+}s^{+})^{*}$ , so we can generate $((r^{*}s^{*})(r^{*}s^{*}).....(r^{*}s^{*}) ) + ((r^{+}s^{+})(r^{+}s^{+})............(r^{+}s^{+}))$.

So , if we put r as null , we would be able to get s , if we put s as null ., we will able to get all r.

Also , we can get any combination of s and r.

Related questions

0 votes
0 votes
2 answers
1
Pratik.patil asked Oct 30, 2023
401 views
Which of the following regular expression represent the set of all the strings not containing $100$ as a substring ?$0^*(1^*0)^*$$0^*1010^*$$0^*1^*01^*$$0^*(10+1)^*$
1 votes
1 votes
2 answers
3