Question: 2) Write regular expressions over the vocabulary { 0, 1 } for each of the following: a) All strings which, when interpreted as binary numbers,

2) Write regular expressions over the vocabulary { 0, 1 } for each of the following:

a) All strings which, when interpreted as binary numbers, represent all non-negative numbers divisible by 4.

b) All strings consisting of two-or-more 1's followed by a non-empty sequence of 0's.

c) All strings containing the substring 101, and ending in a 1.

d) All strings consisting of n 0's, followed by 2n 1's (where n is an arbitrary non-negative integer.)

Your answers should be written using the regex syntax presented in class.

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!