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









sir plz snd me regular expression examples and exercies