1 1 vote 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 4.7k views answer comment Share Follow Print See 1 comment 1 1 comment reply Bhavani_Adapa commented Feb 8, 2022 reply Follow flag ((b+c)*a(b+c)*a(b+c)*a(b+c)*)* 0 0 replyShare Please log in or register to add a comment.
Best answer 5 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 7 7 Comments reply Show 4 previous comments LeenSharma commented Jun 24, 2016 reply Follow flag 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 0 replyShare vijaycs commented Jun 24, 2016 reply Follow flag 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 1 replyShare owais2580 commented Oct 9, 2016 i reshown by Praveen Saini Oct 10, 2016 reply Follow flag I think it should be (b+c)* +( a (b+c)* a (b+c)* a )* 0 0 replyShare Please log in or register to add a comment.
0 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 0 reply Please log in or register to add a comment.