edited by
1,291 views
2 votes
2 votes

edited by

1 Answer

Best answer
3 votes
3 votes

Every group of three symbols should contain at least one 'a' : Following can be the pattern of regex:

$[Xa]^{*}Y$ or, $[\epsilon ,Xa,XaXa,XaXaXa,XaXa....]Y$

Choosing X = Y = $(\epsilon + b + bb)$ , satisfies our requirement.

Otherway, pattern $[Xa]^{*}$ with X = $(\epsilon + b + bb)$ satisfies the required property but these string are always ending with 'a', so concatenate possible valid ending which is Y = $(\epsilon + b + bb)$

I am assuming all strings of length less than 3 are accepted.

edited by

Related questions

2 votes
2 votes
2 answers
1
charul asked Oct 7, 2017
839 views
find regular expression over {a,b} corresponding to "set of strings containing at most 2a's."a) b*+ b*ab* + b*ab*ab*b) b*(a+ε)b*(a+ε)c) none
2 votes
2 votes
2 answers
2
charul asked Oct 7, 2017
2,079 views
find the length of string of minimum length in {0,1}* not in the language corresponding to the given RE(0*+1*)*a) 0b) 1c) more than 1d) can't be determined