Você está na página 1de 2

CMP3004 Formal Languages and Automata Theory

Problem Set I

Do not return the solutions, they will be posted on the web site. Try to solve each problem by
yourself before looking at the solutions. All numbered exercises are from course textbook.

1.

2. Give the formal description of the machines M1 and M2 pictured in Exercise 1.

3. Give state diagrams of DFAs for the following languages. In each part = {a, b}.

a) {w | w has exactly two as}


b) {w | w has at least two bs}
c) {w | w has exactly two a's and at least two b's}

4. Each of the following languages is the complement of a simpler language. In each


part, construct a DFA for the simpler language, then use it to give the state diagram
of a DFA for the language given. In all parts, = {a, b}.
a. {w | w does not contain the substring ab}
b. {w | w does not contain the substring baba}
5. Give the 5-tuple definition of a DFA which recognizes the set of strings that, when interpreted as an
integer, is divisible by five. Note that the most significant digit is the first to be read. Hint: Think of
each state as representing a particular remainder when the number seen so far is divided by five. To
simplify, you may make the reasonable assumption that the empty string represents integer 0, and thus
is one of the accepted strings. Assume that = {1, 0}

6. Give state transition diagrams of NFAs with the specified number of states recognizing each of the
following languages. In each part = {0, 1}.

a) Strings that end with 00 (with three states).


b) Strings defined by the regular expression 0*1*0*0 (with three states).
c) Strings that contain an even number of 0s, or exactly two 1s (with six states).

Você também pode gostar