COMP 335: Theoretical Computer Science Winter 2006 Assignment 1
COMP 335: Theoretical Computer Science Winter 2006 Assignment 1
Winter 2006
Assignment 1
Due date: January 30, 2006.
1. Let = {a, b}. For each of the following languages below,
(i) state whether is in the language,
(ii) give an example of a string different from which is in the language, if such a string exists,
(iii) give an example of a string different from which is not in the language, if such a string
exists.
(a) {w | w = uuR v for some strings u, v }.
(b) {w | w = uuR v for some strings u and v 3 }.
(c) {w | ww = uuu for some string u .
2. Let L = {ab, bb, aba}. Which of the following strings is in L ? Justify your answer.
, abababa, abbbbbabaabb, abaabbbababbaba
3. Find a DFA that accepts the following language on = {0, 1}.
(a) {w : w does not contain substring 0000 or 1111}
(b) {w : w contains exactly three 0s and it ends with 011}
(c) {w : the number of 0 in w is equal to 0 mod 5 and w begins with 01.
4. Find an NFA that accepts the following language:
(a) {w : w contains 1111 or 00000 or 11100111 as a substring}
(b) {w {0, 1, . . . , 9} such that the final digit in w is different from all other symbols in w }
5. For each of the two NFA below, use the subset construction to construct an equivalent DFA.
(The initial state is marked with > and any final state is underlined)
A1
>0
1
2
3
A2
a
{0}
{2,3}
{3}
{1}
b
{1}
{2}
{0}
{2}
>0
1
2
3
4
5
a
{1,2}
{0}
{3}
{1}
{3}
b
{1,3}
{2}
{0}
{0}
{3}
{5}
{5}