CS381 Homework Assignment Number 8, due Friday Oct. 21, 2005 Please write your name and net id on the upper right corner of each page.
1. Write a cfg for ( 0 + 1) - 1010010001L10n1| n 1 .
*
{
}
2. Let L = a nb n c n d n | n 1 . Show that L can

Intro to Theory of Computing CS381 Fall 2005
381 Homework 9 October 28
Please write your name and net-id on the upper right corner of every page. 1. 6.3.2. 2. 6.3.3. 3. 7.2.1 parts b, d, e. 4. 7.4.3. 5. 7.4.5.
1

CS381 Homework Assignment Number 10, due Friday, Nov 4, 2005 Please write your name and net id on the upper right corner of each page.
1.
7.3.1 c (cycle)
2. 7.3.3c (half) 3. 7.3.4 d and e 4. Construct a single tape Turing machine that performs mul

CS381 Homework Assignment number 6 Due Friday, Oct. 7, 2005 Please write your name and net id on the upper right corner of each page.
1. Let L0 = w # w0 # w ( 0 + 1) , L1 = w # w1# w ( 0 + 1) , and L = L0 U L1 . Describe
* *
{
}
{
}
the set L

CS381 Homework Assignment Number 11 due Friday, Nov. 11, 2005 Please write your name and net id on the upper right corner of each page.
1. Prove that the halting problem for Turing machine is undecidable. 2. State Rice's theorem and write out a clea

CS381 Homework Assignment Number 12 due Friday, Nov. 18, 2005 Please write your name and net id on the upper right corner of each page.
1. Write out a clear proof that emptiness of intersection for cfl's is undecidable. 2. 9.3.4 3. 9.3.5 4. 9.3.6 a

CS381 Homework Assignment Number 13 due Friday, Dec. 2, 2005 Please write your name and net id on the upper right corner of each page.
1. 9.3.7 2. For the classes of recursive sets and for the class of r. e. sets and for each of the operations union

CS381, Homework #3 Solutions
Questions 1&2
Give a regular expression for strings with an even number of zeros. There are quite a number of correct answers. The smallest one that I saw was: (01 0 + 1) Any correct solution was accepted. Other popular

CS381
Homework 3: Questions 5 and 6
5. Write a regular expression for all strings of 0s and 1s in which at least one copy of the substring 01 occurs before any copy of the substring 10 occurs in the string. If there is no occurrence of the substrin

CS 381 Homework #3 Question 7
Allows for string to end with a difference between #1's - #0's of 0, 1 or 2
+ 1(01 + 10)*(1 + 0 + )
All strings of non-zero length must begin with a 1
Question 8 START 0 0 1 1 0 3 0
All possible ways to start at state

CS381 Fall 2003
First Mid Term Solution
Friday Oct 10, 2003 Olin 255 9:05-9:55
This is a 50-minute in class closed book exam. All questions are straightforward and you should have no trouble doing them. Please show all work and write legibly. Than

CS381 Fall 2003
Final Exam
Friday, Dec. 12, 2003 Phillips 101 9:00-11:30 am
This is a 2 1 hour in class closed book exam. All questions are straightforward and you 2 should have no trouble doing them. Please show all work and write legibly. Thank

CS381 Fall 2003
Final Exam
Friday, Dec. 12, 2003 Phillips 101 9:00-11:30 am
This is a 2 1 hour in class closed book exam. All questions are straightforward and you 2 should have no trouble doing them. Please show all work and write legibly. Thank

CS381 Fall 2002
First Mid Term
Monday Oct 7, 2002 Olin 155 9:05-9;55
This is a 50 minute in class closed book exam. All questions are straight forward and you should have no trouble doing them. Please show all work and write legibly. Thank you. 1.

CS381 Fall 2002
Final Exam
Thursday Dec 19, 2002 Location Olin 155 12:00-2:30pm
This is a 2 and hour in class closed book exam. All questions are straightforward and you should have no trouble doing them. Please show all work and write legibly. T

CS381 Fall 2002
Second Mid Term
Friday Nov 8, 2002 Olin 155 9:05-9:55
This is a 50-minute in class closed book exam. All questions are straightforward and you should have no trouble doing them. Please show all work and write legibly. Thank you. 1.

CS381 Fall 2002
Second Mid Term
Friday Nov 8, 2002 Olin 155 9:05-9:55
This is a 50-minute in class closed book exam. All questions are straightforward and you should have no trouble doing them. Please show all work and write legibly. Thank you. 1.

CS381 Homework Assignment Number 7, due Friday, Oct. 14, 2005 Please write your name and net id on the upper right corner of each page.
1. Write a context-free grammar for the language
{a b c
i
*
j k
| either i = j or i = k .
}
2. Write a cfg f

CS381 Homework Assignment number 5, due Friday, September 30 Please write your name and net id on the upper right corner of each page.
4.2.6 using homomorphisms, inverse homomorphisms and I R . This is the problem you did by machine construction las

Exercise 4.2.6
Show that the regular languages are closed under the operations below. For each, we'll start with L and apply operations under which regular languages are closed (homomorphisms, intersection, set difference) to get the desired language

CS 381 Homework #7 Problem 1 S S1 | S2 S1 AC A aAb A C cC C S2 aS2c S2 B B bB B case where i = j
case where i = k
381 Course Homework 7 2 Problem Write a cfg for the complement of {wwR | w (a + b)*}
S E aSa|bSb|aEb|bEa|a|b aE|bE|
CS 381 H

CS381, Homework #8 Solutions
Question 1
Write a CFG for (0 + 1) -{101001000.10n 1|n 1} First note that there are two main reasons that a string might not be in the language, L = {101001000.10n 1|n 1}. 1. It is not of the form 1(0 1) , or does no

CS381, Homework #9 Solutions
Question 1 (6.3.2)
Convert the following CFG to a PDA S aAA A aS|bS|a The PDA P = (Q, , , , q0 , Z0 , F ) is defined as Q = {q} = {a, b} = {a, b, S, A} q0 = q Z0 = S F = {} And the transition function is defined as:

Exercise 7.3.1
Show that the operation cycle preserves context-free languages, where cycle is defined by: cycle(L) = {xy | yx L} Informally, cycle(L) allows all strings constructed as follows: take a string w from L, and choose an arbitrary position

CS381
Prove that the halting problem for Turing machine is undecidable.
Homework 11: Problem 1
We can think of the Turing machine for the following pseudocode. The function halt takes two parameters as input. The first parameter is a program and th

CS381, Homework #12 Solutions
Question 1
Prove that the intersection of two CFGs is undecidable. We shall prove this fact with a reduction from the halting problem to the intersection of two CFGs. Recall from class, that for some Turing Machine M ,

CS 381 Homework #13 Problem 1 Question 9.3.7 Since we are trying to prove the following to be non-RE, we reduce a known problem which is nonRE to the given problems. a) http:/www-db.stanford.edu/~ullman/ialcsols/sol9.html#sol93 We reduce the compleme

CS381 Fall 2005
First Mid Term
Friday Sept 23, 2005 Olin 155 9:05-9:55
This is a 50-minute in class closed book exam. All questions are straightforward and you should have no trouble doing them. Please show all work and write legibly. Thank you. 1