Name
Student ID
MCS4653, Theory of Computation
Homework Assignment 4, Due 10/6/03
1. (Sudkamp 3.3 page 82-3) Let G be the grammar S SAB |
A aA | a
B bB |
a) Give a leftmost derivation of abbaab.
b) Give two leftmost derivations of aa.
c) Build the deriv
Theory of Computation Class Notes1
1
based on the books by Sudkamp and by Hopcroft, Motwani and Ullman
ii
Contents
1 Introduction
1.1 Sets . . . . . . . . . . . . . . .
1.2 Functions and Relations . . . .
1.3 Countable and uncountable sets
1.4 Proof Techn
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
MCS4653, Theory of Computation
Page
Name
Homework Assignment 11, Due 11/26/03
1
Student ID
(Sudkamp 9.3 pages 291-2)
Construct a Turing machine with the input alphabet cfw_a, b to perform each of the following operations. Note
that the tape head is scanni
MCS4653, Theory of Computation
Name
Homework Assignment 9, Due 11/10/03
Student ID
Use Theorem 6.5.3 and Algorithm 6.6.3 (Sudkamp 6.35 page 193)
a) Build an NFA M1 that accepts (ab)
b) Build an NFA M2 that accepts (ba)
c) Use transitions to obtain a machi
MCS4653, Theory of Computation
Name
Homework Assignment 8, Due 11/3/03
Student ID
Prepare this problem for class discussion. (Sudkamp 6.30 page 192)
Let M be the NFA-
, a
q0
q1
b
j
jg
ba
b
j qj a
q2
3
b
a) Compute closure(qi ) for i = 0, 1, 2, 3.
b) Give
MCS4653, Theory of Computation
Homework Assignment 7, Due 10/27/03
Name
Student ID
Page
1
1. (Sudkamp 6.19 page 191) For each of the following languages, give the state diagram of an NFA that accepts
the languages.
a) (ab) a
b) (abc) a
c) (ba bb) (ab aa)
MCS4653, Theory of Computation
Homework Assignment 6, Due 10/20/03
Name
Student ID
Page
1
1. (Sudkamp 6.5 page 189) Build a DFA that accepts the set of strings over cfw_a, b, c in which all the as precede
the bs, which in turn precede the cs. It is possib
MCS4653, Theory of Computation
Homework Assignment 5, Due 10/13/03
Name
Student ID
Page
1
1. (Sudkamp 3.6 page 83) For each of the following context-free grammars, use set notation to dene the language
generated by the grammar.
a) S aaSB |
B bB | b
b)
S
MCS4653, Theory of Computation
Homework Assignment 3, Due 9/29/03
Name
Student ID
Page
1
1. (Sudkamp Problem 2.10, Page 49) Let X = cfw_aa, bb and Y = cfw_, b, ab.
a) List the strings in the set XY .
b) List the strings of the set Y of length 3 or less.
c
Name
Student ID
MCS4653, Theory of Computation
Homework Assignment 2, Due 9/22/03
Page
1
1. (GRE Problem 5, Page 13) A procedure that printed this binary tree in postorder would produce what output?
A
B
D
C
E
F
2. (GRE Problem 6, Page 14) Which one of the
CS 503 Foundations of Computer Science
01/18-03/06 2012 at Cisco
Solutions for Homework 1
1. Exercise 30 on page 60.
Solution:
The set of strings over cfw_a, b that do not begin with the substring aaa
is represented by
( a aa)( b+ (a b) )
(15 points)
2. E
MCS4653, Theory of Computation
Homework Assignment 1, Due 9/15/03
Name
Student ID
Page
1
1. (Sudkamp 1.2) Let X = cfw_a, b, c and Y = cfw_1, 2.
a) List all the subsets of X .
b) List the members of X Y .
c) List all total functions from Y to X .
2. (Sudka