Question: Write your regular expressions using a pipe (|) for selection, an asterisk (*) for repetiation, an invisible infix for concatenation, and no other operators. Write

Write your regular expressions using a pipe (|) for selection, an asterisk (*) for repetiation, an invisible infix for concatenation, and no other operators. Write e for the empty string. For example, the set of all strings of a's and b's consisting of either one or more a's followed by exactly one b, or at least one b followed by zero or more a's can be written as follows:

aa*b | bb*a*

In problems 1-5, write a regular expression for the set of all strings of a's and b's described in the problem.

strings containing no a's

strings containing exactly three a's

strings containing at most two a's

strings in which no b ever comes after an a.

strings with an even number of b's.

In problems 6-10, draw a finite state machine that accepts only strings of a's and b's described in the problem.

strings containing an even number of a's

strings containing at most two a's

strings ending with a b

strhings where every b is followed by an a

strings with an even number of a's and an odd number of b's

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!