Solutions for Homework 6
91.304, Spring 2006
Prepared 4/12/2006 by Michael Baker
2.9)
S TC | AR
T aTb |
R bRc |
C cC |
A aA |
The grammar is ambiguous because any string aibjck with i = j = k can be derived ambiguously.
2.10)
Explanation for 2.10:
Top
Spring 2010 - 91.304 - Theoretical Foundations
Computer Science Department
University of Massachusetts Lowell
Lowell, MA 01854
March 9, 2010
Name:
1.
2.
Total:
3.
4.
5.
6.
7.
/60
Each problem is worth 10 points - 60 pts total.
Do 1; do four of 2-6; do 7 .
Spring 2006 - 91.304 - Theoretical Foundations
Computer Science Department
University of Massachusetts Lowell
Lowell, MA 01854
March 6, 2006
Each problem is worth 10 points - 60 pts total.
Do 1; do four of 2-7; do 8 . If you attempt more than six, dentify
Spring 2011 - 91.304 - Theoretical Foundations
Computer Science Department
University of Massachusetts Lowell
Lowell, MA 01854
March 1, 2011
Name:
Points: 1.
Total
2.
3.
4.
5.
6.
7.
8.
/60.
Each problem is worth 10 points - 60 pts total.
Do 1; do four of
Spring 2006 - 91.304 - Theoretical Foundations
Computer Science Department
University of Massachusetts Lowell
Lowell, MA 01854
April 14, 2006.
Each problem is worth 10 points - 60 pts total.
Do any four of 1-5; do any two of 6-8
six problems you wish grad
Spring 2010 - 91.304 - Theoretical Foundations
Second Exam
Computer Science Department
University of Massachusetts Lowell
Lowell, MA 01854
April 15, 2010.
Name:
Points: 1.
Total
2.
3.
4.
5.
6.
7.
/60.
Exam Time: 75 minutes. Each problem is worth 10 points
Spring 2011 - 91.304 - Theoretical Foundations
Computer Science Department
University of Massachusetts Lowell
Lowell, MA 01854
April 5, 2011.
Name:
1.
2.
Total:
3.
4.
5.
6.
7.
8.
/60
Each problem is worth 10 points - 60 pts total.
Do 4 of 1-5; do 2 of 6-8
Spring 2006 - 91.304 - Theoretical Foundations
Computer Science Department
University of Massachusetts Lowell
Lowell, MA 01854
April 14, 2006.
Each problem is worth 10 points - 60 pts total.
Do any four of 1-5; do any two of 6-8
six problems you wish grad
Solutions for Homework 10
91.304, Spring 2006
Prepared 5/8/06 by Michael Baker
4.7)
We demonstrate a one-to-one f: T ! N. Let f(i, j, k) = 2i3j5k. Function f is one-to-one
because if a " b, f(a) " f(b). Therefore, T is uncountable.
4.12)
We o bserve t hat
Solutions for Homework 9
91.304, Spring 2006
Prepared 5/3/06 by Michael Baker
4.2)
Let EBDFA,REX = cfw_<A,R> | A is a DFA, R is a regular expression and L(A) = L(R). The
following TM E decides EBDFA,REX.
E = On input <A,R>:
1. Convert regular expression R
Solutions for Homework 3
91.304, Spring 2006
Prepared 2/28/06 by Michael Baker
1.16 a)
Q = cfw_ , cfw_1, cfw_2, cfw_1,2
= cfw_ a, b
F = cfw_ cfw_1, cfw_1,2
q0 = E( cfw_1 ) = cfw_1
cfw_1
cfw_2
cfw_1,2
a
cfw_1,2
cfw_1,2
Note: cfw_1,2 is a useless state
Solutions for Homework 2
91.304, Spring 2006
Prepared 2/24/06 by Michael Baker
1.3)
1.4 a)
Q = cfw_ (0,4), (0,5), (0,6), (1,4), (1,5), (1,6), (2,4), (2,5), (2,6), (3,4), (3,5), (3,6)
! = cfw_ a, b
Solutions for Homework 2
91.304, Spring 2006
Prepared 2/
Solutions for Homework 1
91.304, Spring 2006
Prepared 2/16/06 by Michael Baker
0.2 a) cfw_ 1, 10, 100
0.2 b) cfw_ i ! Z | i > 5
0.2 c) cfw_ n ! N | n < 5
0.2 d) cfw_ aba
0.2 e) cfw_
0.2 f) cfw_ or !
0.5)
Note: This explanation comes from http:/mathwo
Spring 2010 - 91.304 - Theoretical Foundations - Final
Computer Science Department
University of Massachusetts Lowell
Lowell, MA 01854
May 14, 2010.
Name:
Points: 1.
10.
11.
Total
2.
3.
12.
4.
5.
6.
7.
8.
9.
13.
/100.
Each problem is worth 10 points - 100
Solutions for Homework 7
91.304, Spring 2006
Prepared 4/12/2006 by Michael Baker
2.13 a)
L(G) is the set of strings of 0s and #s that either contain exactly 2 #s and any number of
0s, or contain exactly 1 # and the number of 0s to the right of the # is tw
Solutions for Homework 5
91.304, Spring 2006
Prepared 4/12/2006 by Michael Baker
2.1 a)
ETFa
2.1 b)
E E+T T+T F+T a+T a+F a+a
Solutions for Homework 5
91.304, Spring 2006
Prepared 4/12/2006 by Michael Baker
2.1 c)
E E+T E+T+T T+T+T F+T+T a+T+T a+F+T a+a+T
Solutions for Homework 1
91.304, Spring 2006
Prepared 2/16/06 by Michael Baker
0.2 a) cfw_ 1, 10, 100
0.2 b) cfw_ i ! Z | i > 5
0.2 c) cfw_ n ! N | n < 5
0.2 d) cfw_ aba
0.2 e) cfw_
0.2 f) cfw_ or !
0.5)
Note: This explanation comes from http:/mathwo
Solutions for Homework 4
91.304, Spring 2006
Prepared 4/4/06 by Michael Baker
1.36)
First, realize what Bn means.
B1 = cfw_ a, aa, aaa, aaaa, aaaaa, aaaaaa,
B2 = cfw_ aa, aaaa, aaaaaa, aaaaaaaa,
B3 = cfw_ aaa, aaaaaa, aaaaaaaaa,
B
B
B
Now it is clear w
Solutions for Homework 3
91.304, Spring 2006
Prepared 2/28/06 by Michael Baker
1.16 a)
Q = cfw_ , cfw_1, cfw_2, cfw_1,2
= cfw_ a, b
F = cfw_ cfw_1, cfw_1,2
q0 = E( cfw_1 ) = cfw_1
cfw_1
cfw_2
cfw_1,2
a
cfw_1,2
cfw_1,2
Note: cfw_1,2 is a useless state
Solutions for Homework 8
91.304, Spring 2006
Prepared 5/3/06 by Michael Baker
Note: B means the blank symbol.
3.2 a)
C111, xC31, x1C3B, x1BCreject
3.2 b)
C11F1, xC3F1, xFC51, xC6Fx, CGxFx, xC1Fx, xFC8x, xFxC8B, xFxBCaccept
3.2 c)
C11FF1, xC3FF1, xFC5F1, x
Solutions for Homework 2
91.304, Spring 2006
Prepared 2/24/06 by Michael Baker
1.3)
1.4 a)
Q = cfw_ (0,4), (0,5), (0,6), (1,4), (1,5), (1,6), (2,4), (2,5), (2,6), (3,4), (3,5), (3,6)
! = cfw_ a, b
Solutions for Homework 2
91.304, Spring 2006
Prepared 2/
Solutions for Homework 10
91.304, Spring 2006
Prepared 5/8/06 by Michael Baker
4.7)
We demonstrate a one-to-one f: T ! N. Let f(i, j, k) = 2i3j5k. Function f is one-to-one
because if a " b, f(a) " f(b). Therefore, T is uncountable.
4.12)
We o bserve t hat
Solutions for Homework 9
91.304, Spring 2006
Prepared 5/3/06 by Michael Baker
4.2)
Let EBDFA,REX = cfw_<A,R> | A is a DFA, R is a regular expression and L(A) = L(R). The
following TM E decides EBDFA,REX.
E = On input <A,R>:
1. Convert regular expression R
91.304 - Second Homework
February 10, 2006
The following problems are due on Feb. 13:
1.3, 1.4a, 1.4c, 1.5d, 1.5f, 1.6e, 1.6f, 1.7b, 1.7c, 1.9a, 1.14b.
1
91.304 - Fourth Homework
February 21, 2006
The following problems are due as indicated:
1.36, 1.39, 1.41, 1.46a, c, 1.51, read 1.52 and its solution, 1.55c, e, g, 1.60, 1.61.
1
Solutions for Homework 4
91.304, Spring 2006
Prepared 4/4/06 by Michael Baker
1.36)
First, realize what Bn means.
B1 = cfw_ a, aa, aaa, aaaa, aaaaa, aaaaaa,
B2 = cfw_ aa, aaaa, aaaaaa, aaaaaaaa,
B3 = cfw_ aaa, aaaaaa, aaaaaaaaa,
B
B
B
Now it is clear w
Solutions for Homework 5
91.304, Spring 2006
Prepared 4/12/2006 by Michael Baker
2.1 a)
ETFa
2.1 b)
E E+T T+T F+T a+T a+F a+a
Solutions for Homework 5
91.304, Spring 2006
Prepared 4/12/2006 by Michael Baker
2.1 c)
E E+T E+T+T T+T+T F+T+T a+T+T a+F+T a+a+T