Hw03 Reglang Solution
Hw03 Reglang Solution
Hw03 Reglang Solution
Homework 03 Solution
1. Indicate the correspondence between the regular expressions to the left and the
language properties to the right (the correspondence may be many-to-many, i.e. a
language generated by a given regular expression may have several of the properties
listed on the right side, as well as two or more expressions may generate languages
having common properties).
2. True or False?
3. In each case, find a string of minimum length in {0, 1}* not in the language
corresponding to the given regular expression
a. 1*(01)*1* 0
b. (0* U 1*)(0* U 1*)0 e
c. 0*(101*)*0* 1
d. 1*(0 U 01)*1* 0110
1
Note: Below, for each language only one regular expression is given. However there
may be other regular expressions that generate the same language.
Example 1: The regular expression for the language that contains at least two
occurrences of the substring 11 will be (0 U 1)*11(0 U 1)* 11(0 U 1)*
First write what is required and then surround and insert in between all possible
strings
Example 2: The regular expression for the language that contains two types of strings:
starting with one or more 1s and ending with zero or more 0s, and starting with one or
more 0s and ending with zero or more 1s is
11*0* U 00*1*
d. The language of all strings that begin with 11 and/or end with 00
e1) (1 U 01)*
e2) 1*(011*)*
e3) 1*(011*)*1*
In e3) the last 1* is not necessary because the 1s at the end of a string can be
generated by 1* in (011*)
2
f. The language of all strings containing 1111 as a substring
(0 U 1)* 1111 (0 U 1)*
5. Given and alphabet , the set of all possible strings over including the empty string
is denoted by *.
Let L = {a,b}* . The regular expression that describes all strings in L is (a U b)*
a. The languages below are described as sets. Write the corresponding regular
expressions for each of them
b. For each regular expression below, give the set description of the
corresponding language
a. Let L1= {hope, thought}, L2 = {less, ful}. Write down the elements of L1 L2.
L1 L2 (a* U b*)ab
L1 L2 a* U b* U ab
L1 L2