The Gateway to Computer Science Excellence
+1 vote
872 views
regular expression for " set of all strings over {a,b} in which there are at least two occurrences of b between any two occurrences of a ".
by Junior (867 points) | 872 views

1 Answer

+3 votes
Here is my try:

$b^{*} + b^{*}(abb^{+})^{*}ab^{*}$
by Active (1.8k points)
0
this is correct..
0

b* + b* (a(bb)+)* ab*

0

the restriction is only on a means if there are 2 a's side by side then there should be 2 b's b/w them rt ?

but if there is no a in the language then there is no restriction on b. So question is how can we generate only b , bb ,bbb...... out of this regular expression ?

from the given RE which is b*+b*(abb+)*ab* how can we get rid-off  this a 

b*+b*(abb+)*ab*

Please tell me is this argument is right or wrong ...I'm so confused with RE 

0
please resolve my comment...
+1

yes...b,bb,bb....can be generated...clear ur doubt

assume R.E ====>   A+B  means we can either take A or B at a time but not both...for generating any string..

and     A*  +  B*/////means  we can either take A any no.of time  or B any no.of time but not both...for generating any string..

and   ( A  +  B)*///brackets are important..means  we can either take A any no.of time  or B any no.of time or BOTH...for generating any string..

0

if we write (a,b)^+ or (aUb)^+ or (a+b)^+ does they all mean same ?

0
yes..
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,321 answers
198,387 comments
105,140 users