1 votes 1 votes Give a regular expression for L = {set of all strings in which number of a's are multiples of 3} ∑={a,b,c} Unknown Category theory-of-computation regular-expression + – Desert_Warrior asked Jun 23, 2016 Desert_Warrior 3.1k views answer comment Share Follow See 1 comment See all 1 1 comment reply Bhavani_Adapa commented Feb 8, 2022 reply Follow Share ((b+c)*a(b+c)*a(b+c)*a(b+c)*)* 0 votes 0 votes Please log in or register to add a comment.
Best answer 5 votes 5 votes L={Set of all string in which number of a's are multiple of 3 } and ∑ ={a,b,c} L={∊,b,bb,bbb,c,c,ccc,aaa,baaa,aaab,aaabc,abaca.....} Regular Expression= ( (b+c) + a (b+c)* a (b+c)* a )* LeenSharma answered Jun 23, 2016 • selected Jun 23, 2016 by Desert_Warrior LeenSharma comment Share Follow See all 7 Comments See all 7 7 Comments reply vijaycs commented Jun 23, 2016 reply Follow Share what is difference between no of a should be multiple of 3 and no of a should be divisible by 3 ?? I think ... It should not accept L =( ∊,b,bb,bbb,c,c,ccc ). because here no of a is not multiple of 3. Isn't it ?? 0 votes 0 votes Kapil commented Jun 23, 2016 reply Follow Share How is it going to recognize BBB,CCC It should have atleast 3 A's There is no A here ? 0 votes 0 votes vijaycs commented Jun 23, 2016 reply Follow Share @Kapil ..That is what i was saying ... @Leen sharma ...please clear my doubt .. 1 votes 1 votes Praveen Saini commented Jun 24, 2016 reply Follow Share @kapil @vijay there is no problem, 0 is multiple/divisible of 3 :) afaik 2 votes 2 votes LeenSharma commented Jun 24, 2016 reply Follow Share vijaycs07 multiple of 3 and no of a should be divisible by 3 both are similar kind of problems. and yes they accept L =( ∊,b,bb,bbb,c,c,ccc ) because 0 is multiple/divisible of 3. 0 votes 0 votes vijaycs commented Jun 24, 2016 reply Follow Share Thank you @Praveen Saini sir and @Leen Sharma .... Actually when I saw this http://www.mathwarehouse.com/answered-questions/multiples/what-are-the-multiples-of-3-solved.php then I got confused ... But now it is clear .. because here it is given... http://mathforum.org/library/drmath/view/60913.html 1 votes 1 votes owais2580 commented Oct 9, 2016 i reshown by Praveen Saini Oct 10, 2016 reply Follow Share I think it should be (b+c)* +( a (b+c)* a (b+c)* a )* 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes For this, we will get a DFA something like this We will have 3 states a,b,c From a to b, one a will come From b to c, another a will come And from c to a, we have to come back with a transition a so that number of a gives a mod 3 = 0.Hence , RE = (b* a b* a b* a) * Kapil answered Jun 23, 2016 • edited Jun 23, 2016 by Kapil Kapil comment Share Follow See all 0 reply Please log in or register to add a comment.