Quiz 4
0, 1
q0
0, 1
1
q1
0
q2
0
q3
Figure 1: NFA N for problem 1
1. Consider the NFA N shown in Figure ?. Which of the following strings is not accepted by N ?
(A) 001
(B) 001100
(C) 10011001
(D) 1001
The correct answer is (A). Observe that any string acc
Midterm 1
CS 373: Theory of Computation
Date: Thursday, October 3, 2013.
Instructions:
This is a closed book exam. No notes, cheat sheets, textbook, or printed material allowed.
You have 90 minutes to solve this exam.
This exam has 4 problems. Problems
Quiz 1
1. Let A = cfw_1, 2, 3 and B = cfw_, cfw_1, cfw_2, cfw_3, cfw_1, 2, 3. Which of the following statements is true?
(A) A B
(B) A B
(C) A B =
(D) A B = B
Correct answer is (B).
(A): A B since 1 B.
(B): Obvious.
(C): Their intersection is empty since
CS 373 Fall 2010
Quiz 6 Solutions
Lecture 1 Mahesh
1. C. For a grammar in Chomsky Normal Form, the number of steps in any derivation of a string w is
2|w| 1 (see problem 2.26 assigned as practice problem).
2. A. When proving that a language does not satis
Problem Set 1
CS373 - Spring 2011
Due: Thursday Feb 10 at 2:00 PM in class (151 Everitt Lab)
Please follow the homework format guidelines posted on the class web page:
http:/www.cs.uiuc.edu/class/sp11/cs373/
1. Encoding input and building a DFA
[Category:
Quiz 4
1. Which of the following statements is true?
(A) There are languages that can be recognized by an NFA which cannot be recognized by a DFA.
(B) Languages recognized by NFAs cannot be recognized by DFAs because they can have innitely
many active thr
Solutions for Problem Set 6
CS 373: Theory of Computation
Assigned: October 18, 2012
Due on: October 25, 2012
Problem 1. [Category: Comprehension] Consider the PDA P over the input alphabet cfw_0, 1, # shown in
the gure below; a, in the transitions below,
Quiz 5
1. Which of the following statements is true?
(A) There are languages that can be recognized by an NFA which cannot be recognized by a DFA.
(B) Languages recognized by NFAs cannot be recognized by DFAs because they can have innitely
many active thr
Quiz 19
1. Suppose a (single tape) Turing machine M on input w of length n, takes k steps and halts. Recall that
a conguration of M is a string that describes the contents of tape cells until the rightmost non-blank
cell, position of the head and the cont
Problem Set 1
CS 373: Theory of Computation
Assigned: August 30, 2012
Due on: September 6, 2012
Instructions: This homework has 3 problems that can be solved in groups of size at most 3. Please follow
the homework guidelines given on the class website; su
Solutions for Problem Set 1
CS 373: Theory of Computation
Assigned: August 30, 2012
Due on: September 6, 2012
Problem 1. [Category: Comprehension+Proof]
1. Let A = cfw_1, 2, 3, B = cfw_, cfw_1, cfw_2, and C = cfw_1, 2, cfw_1, 2. Compute A B , A B , B C ,
Quiz 2
1. Let L = cfw_010, 101, 001, 011, and K = cfw_w | 0w L. Which of the following strings is a member of K?
(A) 0101
(B) 01
(C) 011
(D) 0110
The correct answer is (B). K is the set of strings formed by removing the leading 0 from a string in L.
Thus,
1
Equivalence of Finite Automata and Regular Expressions
Finite Automata Recognize Regular Languages
Theorem 1. L is a regular language i there is a regular expression R such that L(R) = L i
there is a DFA M such that L(M ) = L i there is a NFA N such tha
Quiz 25
1. For languages A and B , recall that A \ B = cfw_w A | w B . If A and B are decidable, which of the
following are necessarily true?
(A) A \ B is context-free
(B) A \ B is decidable but may not be context-free.
(C) A \ B is recursively enumerable
Solutions to Problem Set 4
CS 373: Theory of Computation
Problem 1. [Category: Comprehension+Design] Consider the language L = L(abb ) ).
1. Construct a DFA recognizing L. You need not prove that your construction is correct. If you construct
it using the
Solutions for Problem Set 2
CS 373: Theory of Computation
Assigned: January 24, 2013
Due on: January 31, 2013
Problem 1. [Category: Design+Proof] Let Ak cfw_a, b be the collection of strings w where there is a
position i in w such that the symbol at posit
Problem Set 4
CS 373: Theory of Computation
Assigned: September 19, 2013
Due on: September 26, 2013
Instructions: This homework has 3 problems that can be solved in groups of size at most 3. Please follow
the homework guidelines given on the class website
Solutions to Problem Set 3
CS 373: Theory of Computation
Problem 1. [Category: Design+Proof] For a string w , let wR denote the reverse of w, i.e., if
w = w1 w2 wn , where wi then wR = wn wn1 w1 . For a language L, let LR = cfw_wR | w L. Let
M = (Q, , , q
Solutions for Problem Set 2
CS 373: Theory of Computation
Assigned: September 7, 2010 Homework Problems Problem 1. [Category: Design] Design an NFA for the language D given in Problem 1.48. You need not formally prove the correctness of your construction,
Problem Set 2
CS 373: Theory of Computation
Problem 1. [Category: Design+Proof] Let Ak cfw_a, b be the collection of strings w where there is a
position i in w such that the symbol at position i (in w) is a, and the symbol at position i + k is b. For
exam
Problem Set 4 Solutions
CS373 - Spring 2011 Due: Thursday April 7 at 2:00 PM in class (151 Everitt Lab)
Please follow the homework format guidelines posted on the class web page:
http:/www.cs.uiuc.edu/class/sp11/cs373/
1. Pumping Lemma / Ogden's Lemma [Ca
Solutions for Problem Set 1
CS 373: Theory of Computation
Assigned: January 17, 2013
Due on: January 24, 2013
Problem 1. [Category: Comprehension+Proof]
1. Let A = cfw_1, 2, 3, B = cfw_, cfw_1, cfw_2, and C = cfw_1, 2, cfw_1, 2. Compute A B , A B , B C ,
Quiz 3
0, 1
q0
0, 1
1
q1
0
q2
0
q3
Figure 1: NFA N for problems 1 and 2
1. Consider the NFA N shown in Figure ?. Which of the following strings is not accepted by N ?
(A) 001
(B) 001100
(C) 10011001
(D) 1001
Correct answer is (A)
2. The language recognize
Solutions for Problem Set 5
CS 373: Theory of Computation
Assigned: February 21, 2013
Due on: February 28, 2013
Problem 1. [Category: Proof] Let C = cfw_1k x | x cfw_0, 1 , k 1, and x contains at most k 1s. Using the
pumping lemma, prove that C is not reg
Quiz 20
1. Suppose M1 and M2 are two Turing machines such that L(M1 ) = L(M2 ). Which of the following is
necessarily true?
(A) M1 and M2 halt on exactly the same inputs.
(B) For any input x, if M1 halts on x then M2 halts on x.
(C) For any input x, if M1
Solutions for Problem Set 2
CS 373: Theory of Computation
Assigned: September 6, 2012
Due on: September 13, 2012
Problem 1. [Category: Design+Proof] Let
2 =
0
0
,
0
1
,
1
0
,
1
1
2 contains all size 2 columns of 0s and 1s. A string of symbols in 2 gives 2
Solutions to Problem Set 3
CS 373: Theory of Computation
Problem 1. [Category: Design+Proof] For a string w , let wR denote the reverse of w, i.e., if
w = w1 w2 wn , where wi then wR = wn wn1 w1 . For a language L, let LR = cfw_wR | w L. Let
M = (Q, , , q
Quiz 5
1. Which of the following statements is true?
(A) There are languages that can be recognized by an NFA which cannot be recognized by a DFA.
(B) Languages recognized by NFAs cannot be recognized by DFAs because they can have innitely
many active thr
Solutions for Problem Set 1
CS 373: Theory of Computation
Problem 1. [Category: Design] Design a DFA for the language LA1 = cfw_w cfw_a, b | number of as in w is not
divisible by 3.
Solution: The DFA recognizing LA1 will remember how many as modulo 3 it h