CS 373, Spring 2009. Solutions to Mock midterm 1 (Based on rst midterm in CS 273, Fall 2008.)
Problem 1: Short Answer (8 points)
The answers to these problems should be short and not complicated. (a) If an NFA M accepts the empty string (i.e., ), does M s
Name: _ Student ID: _ CSE 322 Autumn 2001: Midterm Exam (closed book, closed notes except for 1-page summary) Total: 100 points, 5 questions, 20 points each. Time: 50 minutes Instructions: 1. Write your name and student ID on each sheet. Write or mark you
CS 341: Foundations of Computer Science II
Prof. Marvin Nakayama
Homework 3 Solutions
1. Give NFAs with the specied number of states recognizing each of the following languages. In all cases, the alphabet is = cfw_0, 1.
(a) The language cfw_ w | w ends wi
CS 341: Foundations of Computer Science II
Prof. Marvin Nakayama
Homework 2 Solutions
1. DFA M = (Q, , , q1 , F ), where
Q = cfw_q1 , q2 , q3
= cfw_a, b
transition function is given by
q1
q2
q3
ab
q1 q2
q1 q3
q1 q3
q1 is the start state
F = cfw_q1 , q3
CS 341: Foundations of Computer Science II Prof. Marvin Nakayama
Homework 1 Solutions
1. We are given the sets C D E F (a) D C = cfw_, bb, aab, baa (b) C F = cfw_, aab, baa = C (c) C D = cfw_ (, bb), (, aab), (aab, bb), (aab, aab), (baa, bb), (baa, aab)
CSC236H: Introduction to the Theory of Computation
Bonus Homework
Due on Tuesday April 6, 2010 (in review session, see announcements)
Note that this assignment is for extra credit. If you do not want the extra credit, you do not have to hand in this assig
902 43500 HOMEWORK 2
due Tuesday, October 27, 2009
All problems are in the book: Michael Sipser, Introduction to the Theory of
Computation, 2nd Edition, PAWS Publishing Company, 2005.
Solution by Cheng-Chung Li
Problem 1 Give state diagrams of DFAs recogn
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