# Regular Expression for All strings which contain no runs of a's of length greater than two.On L={a,b,c} [closed]

My attempt is

We can fairly easily build an expression containing no a, one a, or one aa: (b+c)(€+a+aa)(b+c) but if we want to repeat this, we need to be sure to have at least one non-a between repetitions: (b+c)*(€+a+aa)(b+c)*((b+c)(b+c)*(€+a+aa)(b+c)*)* 

Therefore the final answer is (b+c)*(€+a+aa)(b+c)*((b+c)(b+c)*(€+a+aa)(b+c)*)* 

Is this ok?

• We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. – D.W. Mar 11 '17 at 7:35
• @D.W. Will keep this in mind... – Aditya Mar 11 '17 at 7:50
• @ADITYA Your title's fine, yes. Thanks for that. But your question is still "Here's my answer -- is it correct?" Why do you think it might be wrong? Can't you check for yourself that your regular expression matches exactly the right strings, for example by trying to find strings that it matches but shouldn't, or vice-versa. – David Richerby Mar 11 '17 at 11:40
• @DavidRicherby Got it... – Aditya Mar 11 '17 at 12:23
• This reference question may be helpful. Converting regular expressions to regular grammars or finite automata is a mechanic task, so feel free to attempt the prove with either of the three models. – Raphael Mar 11 '17 at 13:32