Regular expression examples in theory of automata Part – 3

7745

2. Construct a regular expressing for all the strings in {0, 1}* with next-to-last symbol 0.

Solution:

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

∴∑ = {0, 1}

Here, the resultant regular expression will denotes all the strings over the given ∑ can be any of the following form-

00, 01, 10, and 11

The requirement of the question is that the next-to-last symbol must be 0, thus, only the following last two symbols can be used for construction of resultant regular expression-

00 and 01

Also, the regular expression for any string at all over the given ∑ can be written as-

(0 + 1)*

Thus, the resultant regular expression can be written as-

(0 + 1)*(00 + 01)

 

Previous QuizRegular expression in theory of computation solved examples Part – 2
Next QuizRegular expression in theory of computation solved examples Part 4

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.