902 43500 HOMEWORK 1
due Tuesday, October 13, 2009
All problems are in the book: Lewis and Papadimitriou, Elements of the Theory
of Computation, Prentice Hall, 1981.
Solution by Cheng-Chung Li
Problem 1 Let f : A B . Show that the following relation R is
CSE 322 Spring 2010
Homework Assignment #4
Due Date: Friday, April 30 (at the beginning of class)
1. (30 points) Give regular expressions for the following languages over = cfw_0,1:
a. cfw_w | w has length at least 3 and its third symbol is 0
b. cfw_w | l
CSE 322 Spring 2010
Homework Assignment # 3
Due Date: Friday, April 23 (at the beginning of class)
1. (10 points) Draw the state diagram and write down the formal description (Q, ,
, q0, F) of an NFA recognizing the following language:
L = cfw_w | w cfw_0
CSE 322 Spring 2010
Homework Assignment # 2
Due Date: Friday, April 16 (at the beginning of class)
1. (20 points) Give examples of each of the following if possible. If not possible,
explain why.
a. Two countably infinite sets A and B such that A is a pro
CSE 322 Spring 2010
Homework Assignment # 1
Due Date: Friday, April 9 (at the beginning of class)
Note: N = set of natural numbers = cfw_1, 2, 3, , Z = set of integers = cfw_, -1, 0, 1,
1. (20 points) Write formal descriptions of the following sets:
Exam
CS 341 Homework 8 Finite Automata, Regular Expressions, and Regular Grammars
1. We showed that the set of finite state machines is closed under complement. To do that, we presented a technique for converting a deterministic machine M into a machine M' suc
CS 341 Homework 4 Deterministic Finite Automata 1. If M is a deterministic finite automaton. Under exactly what circumstances is L(M)? 2. Describe informally the languages accepted by each of the following deterministic FSMs:
(from Elements of the Theory
CS 341 Homework 3 Languages and Regular Expressions 1. Describe in English, as briefly as possible, each of the following (in other words, describe the language defined by each regular expression): (a) L( (a*a) b) b ) (b) L( (a*b*)*ab) (a*b*)*ba)(b a)* )
CS 341 Homework 2 Strings and Languages 1. Let = cfw_a, b. Let L1 = cfw_x *: |x| < 4. Let L2 = cfw_aa, aaa, aaaa. List the elements in each of the following languages L: (a) L3 = L1 L2 (b) L4 = L1 L2 (c) L5 = L1 L4 (d) L6 = L1 - L2 2. Consider the languag
Name: _
Student ID: _
CSE 322 Spring 2010: Take-Home Final Exam
SOLUTIONS
Total: 150 points, 8 questions
Due: Before 4:30pm, Monday, June 7, 2010
Where: CSE Front Desk
Instructions:
1. Write your name and student ID on the first sheet and your last name o
Midterm 2
CS 373: Theory of Computation
Date: Thursday, November 4, 2010.
Instructions:
This is a closed book exam. No notes, cheat sheets, textbook, or printed material allowed.
You have 120 minutes to solve this exam.
This exam has 5 problems each wo
CS5371 Theory of Computation
Homework 1
Due: 2:10 pm, October 16, 2007 (before class)
1. (20%) Give state diagrams of DFAs recognizing the following languages. In both parts,
the alphabet is cfw_0, 1.
(a) cfw_w | w does not contain the substring 110
(b) c
CS5371 Theory of Computation
Homework 1 (Suggested Solution)
1. (a) Ans: The state diagram for cfw_w | w does not contain the substring 110 is as follows.
In the diagram, the states A, B , and C keep track of the ending characters of the
current input unt
CS5371 Theory of Computation
Homework 1 (Solution) 1. Assume that the alphabet is cfw_0, 1. Give the state diagram of a DFA that recognizes the language cfw_w | w ends with 00. Answer: The key idea is to design three states q0 , q1 , q2 , where q0 specifi
Formal Languages and Automata Theory
902 43500 Midterm
Tuesday, November 23, 2010
There are 7 problems in this examination sheet.
Problem 1 (10 points)
Find the error in the following proof that all horses are of the same color.
CLAIM: In any set of h hor
Formal Languages and Automata Theory
902 43500 Final Examination
Tuesday, 11 January, 2011
There are 7 problems and each of them is 15 points.
Problem 1
Which of the following problems about Turing Machines are decidable, and
which are undecidable? Explai
Formal Languages and Automata Theory
902 43500 Midterm
Tuesday, 10 November, 2009
Solution by Cheng-Chung Li
Problem 1 (20 points)
What is wrong with the following alleged proofs:
We prove that 2 = 1. Consider the equation a = b. Multiply both sides by
a
Formal Languages and Automata Theory
902 43500 Final Examination
Tuesday, 12 January, 2010
Solution by Cheng-Chung Li
Problem 1
Which of the following problems are decidable, and which are undecidable? Justify your answers.
1. Given a Turing machine M , a
ECS 120: Theory of Computation UC Davis Earl Barr and Phil Rogaway
Handout MT-Soln February 9, 2006
Midterm Solutions
1 Short Answer
(A) Carefully dene what it means if we say: the regular languages are closed under intersection. It means that if L and L
Homework VI
Introduction to Thoery of Computing
Fall 2010
Question 7.21 One can run a NDTM on a given input and count the number of its
accepting branches to determine if DOUBLE-SAT. Therefore, DOUBLE-SAT is in NP.
It remains to nd a reduction from 3SAT t
CPSC 421: Introduction to the Theory of Computation
HW 5 Solutions:
Sipser 2nd Ed. 7.7, 7.12, 7.36, 7.37
7.7) Show that NP is closed under union and concatenation.
a) In order to show that the class NP is closed under Union we need to produce an NP class
Solutions to Homework 4
3.11 Let L be a language recognized by a Turing machine, M . Consdier
a doubly innite tape machine with two more states, cfw_q1 , q0 and one extra
tape symbol, e, that behaves as follows: initially it moves one cell to the left,
e
CPSC421 HW3 Solutions 2011 Term 1
5)
Assuming the following:
1) Any statement that is provable is true
2) No statement can be both True and False
3) The statement This statement that has no proof that is True
October 2011
CPSC 421/501
Name
Page 2 of 6 pages
Marks
[10]
1.
Give an explicit description of a Turing machine that takes as input, x cfw_0, 1 ,
and (1) accepts x if the rst character of x equals the last character, and (2) rejects
x if not. You should e
Sample Midterm Questions for CPSC 421/501
Joel Friedman
October 20, 2011
1. Describe a Turing machine that takes as input, x cfw_a, b , and (1)
accepts x if |x| is even, and (2) rejects x if |x| is odd. You should
explicitly write and explain each of Q, ,
Extra Sample Questions for the CPSC
421/501 Final
Joel Friedman
November 30, 2011
The sample midterm questions and all homework questions are good sample questions for the nal exam. Here are some extra questions, especially
on material since the midterm.
Id: tutsol01.tex,v 1.3 2012/03/08 03:51:33 kaie Exp kaie
Available at the COMP4141 website.
Solution to COMP4141 Tutorial 1
Kai Engelhardt
March 8, 2012
Solution to Exercise 1 (Pattern matching) Let w . We construct a DFA Aw with
precisely |w| + 1 states