Regular expression in theory of computation solved examples Part – 2

9014

Last Updated on Sep 30, 2016

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. 

5. Construct a regular expression for the set of all strings ovetr (A, . . . ., Z, a, . . . . , z) that contains 3 X’s.

Solution:

We have the input alphabets ∑ = {A, . . . ., Z, a, . . . . , z}

Here, the resultant regular expression will denote the set of all string over the given ∑ which contains occurrence of x’s three times.

In the first step, let us assume that

            <letter> = {A, . . . , Z, a, . . . . . z}

Thus, the regular expression for the set of all strings over the given ∑ can be written as-

<letter>*

Thus, the required resultant regular expression which denotes the set of all strings that contains 3 x’s over the given ∑ can be written as-

            <letter>* x <letter>* x <letter>* x <letter>*

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.