# CSCI (Math) 361 Theory of Computation

## Homework Assignments Fall 2004

Homework is generally assigned two class periods before it is due. Please note that homework is due at the beginning of class and no late homework will be accepted. The homeworks to be dropped are to cover situations like illness or other circumstances that prevent you from attending class or doing homework.

Due Date To Turn In: To Do On Own: Solutions:
9/15 Write a program that has the following behavior: Given a string of a's and/or b's, output "accept" if the string ends with the sequence "a, 1 or more b's, aaa or aba, 0 or more b's"; output "reject" otherwise.

You must process the string in the forward direction. You may not use any of the pattern matching capabilities of any language.

none Explanation, Program.
9/17 1.2.3, 1.3.4, 1.3.5, 1.3.9 1.3.1 (for the composition of R and R), 1.3.2a for S only, 1.3.7 Solutions
9/20 1.4.2 a and b, 1.5.1, 1.5.6, Prove that the set of all real numbers is uncountable. 1.4.1, 1.5.3, 1.5.7, 1.5.8 Solutions
9/22 1.6.2, 1.7.2 c, 1.7.3 1.6.1 c, d, e, 1.6.5 Solutions
9/24 1.7.4 b, 1.7.6, 1.8.2 a-d, 1.8.3 a, b 1.7.4 a, 1.7.5 b, c, 1.8.5 Solutions
9/27 2.1.2 d (give reg expr), 2.1.3 c, 2.1.4 a(i), 2.1.4 b(i,ii,iii,v) 2.1.1, 2.1.2 a-c, 2.1.3 b and d, 2.1.4 a(ii) Solutions
9/29 2.2.2, 2.2.3 c and d, Given M, an NFA, prove that (q,xy)|-*(p,y) iff (q,x)|-*(p,e). [Follow proof done in class.] 2.2.1, 2.2.3 a and b Solutions
10/4 2.2.6, 2.2.10 2.2.7, 2.2.9. Also give an NFA that accepts the language (a | b)* a b+ a (a | b) a b*, and find an equivalent DFA. [Note that this was the language for which you implemented an acceptor in HW1.] Solutions
10/6 2.3.3 [Give the construction and the proof of correctness.] 2.3.1, 2.3.2, 2.3.5, 2.3.6 a and f, 2.3.10 Solutions
10/8 none 2.3.4, 2.3.7 b [from left to right, label states 2, 1, 3] Solutions
10/13 2.4.3 a, c, f, 2.4.5 a, 2.4.8 a, b, c 2.4.2, 2.4.3 d, e, 2.4.4, 2.4.7, 2.4.8 d-g Solutions
10/20 minimize the DFA given in class   Solutions
10/22 3.1.4, 3.1.7 [Make a claim about what L(G) is and then prove it; then show that L(G) is regular.], 3.1.9 a and d 3.1.2, 3.1.3, 3.1.5 Solutions
10/25 3.1.10 c, d [give constructions and sketch pf of correctness] 3.1.10 a Solutions
10/27 none 3.2.2, 3.2.3, 3.2.4b Solutions
10/29 3.3.2 b, 3.3.3 (see class notes for explanation) 3.3.1 (see class notes for typo in text), 3.3.2 a, c, d Solutions
11/1 Handout 3.4.1 Solutions
11/3 3.5.1 a and b, 3.5.3 a 3.5.1 c, d, e Solutions
11/5-8 3.5.2 c, 3.5.8, 3.5.14 b 3.5.2 d, 3.5.7, 3.5.14 a, c Solutions
11/10 none 3.7.5 a
11/15 4.1.4, 4.1.7 4.1.1, 4.1.2, 4.1.3, 4.1.5 Solutions
11/17 none 4.1.8, 4.1.9, 4.1.10 Solutions
11/19 4.2.1, 4.2.2, 4.2.3 none Solutions
11/22 4.3.1 a, Let M be a Turing Machine with 2-way infinite tape. Define the relation |- formally, as was done for standard Turing Machines. 4.3.3 Solutions
11/29 4.5.1 a, 4.5.3 4.5.1 b, 4.5.2 Solutions
12/6 5.3.3 (don't do Kleene *; give deterministic constructions) 5.3.2
12/8 5.4.1 b, 5.4.2 a and d rest of 5.4.1 and 5.4.2 Solutions