• edited by
1,549 views
7 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)^*$

3 Answers

Best answer
11 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 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:
Position:
Show:

Related questions

0 0 votes
1 1 answer
750
750 views
Tesla! asked Feb 5, 2018
750 views
Let $Σ = \{a, b\}$. Given words $u, v \in Σ*$ , we say that $v$ extends $u$ if $v$ is of the form $xuy$ for some $x, y ∈ Σ^*$ . Given a fixed word $u$, we are interested...
0 0 votes
2 2 answers
836
836 views
Tesla! asked Feb 5, 2018
836 views
Let $Σ = \{a, b, c\}$. Let Leven be the set of all even length strings in $Σ^*$$(a)$ Construct a deterministic finite state automaton for $L_{even}$.$(b$) We consider an ...
3 3 votes
2 2 answers
3.3k
3.3k views
Tesla! asked Feb 4, 2018
3,338 views
We have constructed a polynomial time reduction from problem $A$ to problem $B$. Which of the following is a valid inference?If the best algorithm for $B$ takes exponenti...
1 1 vote
2 2 answers
1.2k
1.2k views
Tesla! asked Feb 4, 2018
1,234 views
Suppose we constructed the binary search tree shown below by starting with an empty tree and inserting one element at a time from an input sequence, without any rotations...