Regular expression in theory of computation solved examples

15378

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

Previous QuizWhat is SEO-Definition with List of all major search engine
Next QuizRegular expression in theory of computation solved examples Part – 2

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.