You are on page 1of 1

Theory of Computations (CMPS 346)

Tutorial #3

1. Each of the following languages is the intersection of two simpler


languages. In each part, construct DFAs for the simpler languages, and
then combine them using the construction discussed in the lecture to give
the state diagram of a DFA for the language given.
a. L1={ w | w  {a, b}*, w has at least three a’s or at least two b’s}
b. L2={ w | w  {0, 1}*, w ends with 01 or has even number of 1’s}

2. Give state diagrams of NFAs recognizing each of the following languages.

a. L1= {w| w ends with one of 0110, 010, and 00 } with five states Σ
={0,1}
b. L2={w| w contains the substring ababb (i.e., w = xababby for some
x and y)} Σ ={a,b}
c. L3= {w| w contains odd number of 0’s or the number of 1’s is not
multiple of 3} Σ ={0,1}
d. L4= {bna | n≥1} Σ ={a, b}
e. L5= {w| in w the third symbol from the right end is '0' } Σ ={0,1}
f. L6= {w| w contains an even number of 0s, or contains exactly two
1s} Σ ={0,1}
g. L7= {w| the first and last characters in w are the same} Σ ={0,1}
h. L8= {w| w end in 010 and have 011 somewhere preceding, or end in
101 and have 100 somewhere preceding}

3. Let

Σ=¿ ¿
Consider each row to be a binary number and let
L= {w  * | the top row is a larger binary number than the bottom row}
[0¿]¿¿¿ [0¿]¿¿¿
E.g., ¿ , but ¿ . Show that L is regular.

You might also like