in Theory of Computation recategorized by
1,018 views
4 votes
4 votes

Which of the words below matches the regular expression $a(a+b)^{\ast}b+b(a+b)^{\ast}a$?

  1. $aba$
  2. $bab$
  3. $abba$
  4. $aabb$
in Theory of Computation recategorized by
by
1.0k views

2 Comments

L ={ (words starting with $a$ and ending with $b$) OR (words starting with $b$ and ending with $a$) }
2
2
option D..
0
0

4 Answers

6 votes
6 votes

Answer: $\mathbf{(D)}$

As the above Regular expression is the $\mathbf{UNION}$ Of two Regular Expressions in which the first one starts with a and ends with b followed by any number of a and b in between.

In the second part, it must start with b and ends with a, followed by any number of a and b in between.

On checking the options we can easily eliminate a, b and c as they both start and end with the same symbol.

$\therefore$ The answer is $\mathbf D$

edited by
by

2 Comments

It's really the sensible explanation.👍
1
1
Thanks.
1
1
2 votes
2 votes

Only Option D) can be generated

Given $r= a(a+b)^{*}b + b(a+b)^{*}a$

$a(a+b)(a+b)b = aabb $

0 votes
0 votes
optino D is the correct.This R.E. represent the string which start a or end with B and vice-versa
0 votes
0 votes

Answer: 

Answer:

Related questions