Regular expression in theory of computation solved examples Part 4

9542

2. Find the regular expression for the set of strings of 1’s so that the number of 1’s equals 2 modulus 3, followed by an even number of 0’s, over input alphabet ∑= {0 ,1}.

Solution:

We have the input alphabets ∑ = {0, 1}

Here, the resultant regular expression will denotes the set of strings of 1 in which number of 1’s equals 2 modulo 3 and it is followed by even number of 0’s.

Here, number of 1’s equals 2 modulo 3 means-

                        2          = 2
2 + 3    = 5

                        5 + 3    = 8

                        8 + 3    = 11

                        11 + 3  = 14

                        and soon.

The regular expression which represent the set of strings in which number of 1’s equal 2 modulo 3 can be written as –

                        11 (111)*

Also, the regular expression which represents the even numbers of 0’s can be written as-

                        (00)*

Thus, the resultant regular expression can be written as-

                        11 (111)* (00)*

You can also Read: Ambiguous Grammar definition and solved examples

Previous QuizRegular expression examples in theory of automata Part – 3
Next QuizWhat is VPN : Definition, Uses and Working

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.