2. Find the regular expression for the set of all strings over input alphabet ∑ = {a, b} with three consecutive b’s.
Solution:
We have the input alphabets are ∑ = {a, b}
According to the problem given, the resultant regular expression represent all strings which have three consecutive b’s (which means, strings always have a substring of b’s of length 3 i.e bbb) over the given input alphabets ∑ = {a, b}.
For solving this problem, first find out the regular expression for any string at all over the given input alphabets ∑ = {a, b}. It is-
(a + b)*
Thus, to write a regular expression which denote all string with three consecutive b’s we simply put the regular expression for any string at all over the given ∑ on the both side of three consecutive b’s, i.e., bbb. Thus, the resultant regular expression is-
(a + b)* bbb (a +b)*
Also check: Importance of finite automata








