Regular expression in theory of computation solved examples Part – 2

8719

This is 2nd Part of Regular expression in theory of computation solved examples. You can also read Regular expression in theory of computation solved examples Part – 1. 

2. Construct a regular expression for all strings which contains no runs of a’s of length greater than two, over input alphabet {a, b, c}.

Solution:

We have the input alphabets ∑ = {a, b, c}.

Here, the resultant regular expression will denote the set of all strings in which no runs of a’s of length greater than two.

Here, a regular expression that contain no ‘a’, one ‘a’, or one ‘aa’ can be written as-

            (b + c)* (λ + a + aa) (b + c)*

Now, as per the problem demand, we have to repeat it. For this, we need to be sure to have atleast one non-a between repetitions.

Thus, the regular expression which fulfill the requirement of the given problem can be written as-

            (b + c)* (λ + a + aa) (b + c)* ((b + c)* (λ + a + aa) (b + c)*)

Previous articleRegular expression in theory of computation solved examples
Next articleRegular expression examples in theory of automata Part – 3
Er Parag Verma
Hello I am Er Parag Verma. I am tech blogger, Professor and Entrepreneur. I am on the mission to change the pattern of learning to make it easy, valuable and advance.

1 COMMENT

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.