Regular expression in theory of computation solved examples Part – 2

8904

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. 

Back

1. Construct the regular expression for all strings in which all runs of a’s has lengths that are multiple of three, over input alphabets ∑ = {a, b, c}.

Solution:

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

Here, the resultant regular expression will denote the set of all string in which all runs of a’s has length that are multiple of three, i.e., the length of a’s in the string varies as 3 × 0 = 0, 3 × 1 = 3, 3 × 2 = 6, 3 × 3 = 9, 3 × 4 = 12,…. and soon.

To fix this problem, we first write the regular expression which represents the set of all strings over the given ∑. It is-

            (a + b + c)*

But, the given problem requires the length of ‘a’ which is multiple of three.

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

            (aaa, + b + c)*

Back
Previous QuizRegular expression in theory of computation solved examples
Next QuizRegular expression examples in theory of automata Part – 3

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.