TOC Assignment (Module 2)
TOC Assignment (Module 2)
(ASSIGNMENT)
Que-1: Write a regular expression for each of the following sets of binary strings. Use only the
basic operations.
a. all binary strings except empty string
b. begins with 1 and ends with a 1
c. ends with 00
d. contains at least three 1s
Que-2: Write a regular expression to describe inputs over the alphabet {a, b, c}.
a. that are in sorted order
b. containing at least one a and at least one b
Que-3: Write a regular expression for each of the following sets of binary strings. Use only the
basic operations.
a. contains the substring 110
b. doesn't contain the substring 110
c. whose tenth symbol from the right is 1
d. not containing 101 as a substring
Que-4: Write a regular expression for each of the following sets of binary strings. Use only the
basic operations.
a. number of 0s is a multiple of 3
b. has at least 3 characters, and the third character is 0
c. starts and ends with the same character
d. length is at least 1 and at most 3
Que-5: Write a Regular Expression for the following language
a. L = {anbm | n>=4, m<=3}
b. L = {anbm | (n+m) is even}
c. L = {w Є {0,1}* | w has at least one pair of consecutive zeros}
d. L = {w Є {0,1}* | w has no pair of consecutive zeros}
Que-6: What is the language denoted by the following RE
a. R= (a+b)*(a+bb)
b. R= (aa)*(bb)*b