2 votes 2 votes input {a,b} Write R.E where every b is followed by at least 2 K a's? (K is +ve integer) Theory of Computation regular-expression + – iarnav asked Aug 29, 2017 iarnav 974 views answer comment Share Follow See all 9 Comments See all 9 9 Comments reply Show 6 previous comments iarnav commented Aug 30, 2017 reply Follow Share @LeenSharma - Thanks you're awesome! Jus' a little doubt, from your updated RegEx can we make generate any no of a's like aaaaa (5a's) 0 votes 0 votes LeenSharma commented Aug 30, 2017 reply Follow Share yes we can. 0 votes 0 votes Harsh Choudhary commented Nov 12, 2017 reply Follow Share (a*b(aa)+ + a)* for (a0b(aa)1 + a)1 one of the string will be baaa .i.e not multiple of 2 0 votes 0 votes Please log in or register to add a comment.
Best answer 1 votes 1 votes The regular expression will be (a+b((aa) k)+) * Rishabh Agrawal answered Aug 29, 2017 • selected Jan 14, 2018 by iarnav Rishabh Agrawal comment Share Follow See all 9 Comments See all 9 9 Comments reply Show 6 previous comments LeenSharma commented Aug 30, 2017 reply Follow Share From this R.E. $(a^{*}b(aa)^{+}+a)^{*}$ you can generate string baaa. 0 votes 0 votes iarnav commented Aug 30, 2017 reply Follow Share @LeenSharma Yes, you're right. I figured it out y putting whole *=2 P.S - is there a way to solve these questions? Can you share some tips, please? 0 votes 0 votes LeenSharma commented Aug 30, 2017 reply Follow Share $(a^{*}b(aa)^{+}+a^{*})^{*}$ and $(b(aa)^{+}+a)^{*}$ is also correct. 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes i got a* (bb*a) (bb*a)* a (b (bb*a) + a)* this is my ans suryaprakash answered Jan 14, 2018 suryaprakash comment Share Follow See 1 comment See all 1 1 comment reply suryaprakash commented Jan 14, 2018 reply Follow Share sry i did see 2k a's, but for 2 a's my answer would be correct 0 votes 0 votes Please log in or register to add a comment.