edited by
919 views
7 votes
7 votes

The regular expression $(a^*+b)^*$ is equivalent to which of the following regular expressions:

 

  1. $a^*b^*$
  2. $(a^*b+b)^*$ 
  3. $(a+b^*)^*$
  4. $(a^*b)^*$
edited by

3 Answers

Best answer
11 votes
11 votes

(a* + b)* is equivalent to:

- $\text{(a + b)*}$

- $\text{(a + b*)*}$

- $\text{(a*b*)*}$

- basically any regular expression which can generate all strings in $\Sigma^*$.

Now looking at the options:

(a) $\text{a*b*}$ - This can't generate abab

(b) $\text{(a*b+b)*}$ - This can't generate aaa (at least one b needs to be there in any non-empty string)

(c) $\text{(a+b*)*}$ - This one can generate all strings, i.e it is equivalent to (a+b)*

(d) $\text{(a*b)*}$ - This can't generate aaa (at least one b needs to be there in any non-empty string)

So, correct option should be (C) (a+b*)*.

selected by
0 votes
0 votes

A, No a can be there once we have b. ba not accepted.

B. Every a must be followed by b. a not accepted.

D. Every a must be followed by b. a not accepted.

C is correct.

(a* + b)* is equivalent to:

- (a + b)*

- (a + b*)*

- (a*b*)*

- (b*a*)*

- (a* + b*)*

- a*(ba*)*

- b*(ab*)*

edited by
Answer:

Related questions

0 votes
0 votes
1 answer
1