CS 3133 Foundations of Computer Science
C term 2014
(Last) Homework 5, due Monday, March 3
READING: Chapters 7, 8, 14, 15, 16.
1. Exercise 17.b. on page 249. (20 points)
2. Let M be the Turing machine dened by
q0
q1
q2
B
a
b
c
(q0 , B, R) (q0 , a, R) (q0
CS 3133 Foundations of Computer Science
C term 2014
Homework 4, due Monday, February 24
READING: Chapters 6, 7, 8.
1. Use the technique from Section 6.1 in the book (i.e. constructing an
NFA- for a given regular set by following the recursive denition of
CS 3133 Foundations of Computer Science
C term 2014
Solutions for Homework 2
READING: Chapters 3, 4, 5, 18.
1. Exercise 2 on page 97.
Solution:
(a) The following is a leftmost derivation of aabbba:
S
ASB
aAbSB
aaAbbSB
aabbSB
aabbB
aabbba
(b) The fol
CS 3133 Foundations of Computer Science
C term 2016
Homework 3, due Monday, February 8
READING: Chapters 4, 5, 6.
1. Exercise 1 on page 184. (20 points)
2. Exercise 12 on page 185. (20 points)
3. Design a DFA that accepts the language consisting of the se
CS 3133 Foundations of Computer Science
C term 2015
Homework 3, due Monday, February 9
READING: Chapters 4, 5, 6.
1. Exercise 1 on page 184. (20 points)
2. Exercise 11 on page 185. (20 points)
3. Design a DFA that accepts the language consisting of the se
CS 3133 Foundations of Computer Science
C term 2015
Solutions for Homework 4
1. Exercise 3 on page 217. (There is an error in the book, it should say:
The language of the DFA M in Example 5.3.7 consists of.)
Solution:
After deleting the state [oa , eb ] w
CS 3133 Foundations of Computer Science
C term 2014
Solutions for Homework 5
1. Exercise 17.b. on page 249.
Solution: (with the pumping lemma for context-free languages) Let
us assume indirectly that the language L = cfw_ai bj ci dj | i, j 0 is
context-fr
CS 3133 Foundations of Computer Science
C term 2014
Sample Problems for the Midterm Exam
These problems are sample problems for the midterm exam, so you may
expect similar problems in the midterm. Do not hand in your solutions.
Solutions will be handed ou
CS3133
HW#3
DUE: Monday, September 10
*
1. (10 points) Define the shuffle-reverse operation : * * 2 for any alphabet by
ax x a ,
ax x a ,
ax by x by a ax y b
for all a, b , x, y * . For example, 01 ab ba10, b1a 0,1ba 0,10ba,1b0a, b10a . We
extend the d
CS 3133 Foundations of Computer Science
C term 2014
Homework 3, due Monday, February 10
READING: Chapters 4, 5, 6.
1. Exercise 1 on page 184. (20 points)
2. Exercise 12 on page 185. (20 points)
3. Design a DFA that accepts the language consisting of the s
CS 3133 Foundations of Computer Science
C term 2015
Solutions for Homework 2
READING: Chapters 3, 4, 5, 18.
1. Exercise 2 on page 97.
Solution:
(a) The following is a leftmost derivation of aabbba:
S
ASB
aAbSB
aaAbbSB
aabbSB
aabbB
aabbba
(b) The fol
CS 3133 Foundations of Computer Science
C term 2014
Practice Final Exam
These problems are sample problems for the nal exam, so you may expect
similar problems in the nal. Do not hand in your solutions. Solutions will
be posted on the web tomorrow. The na
CS 3133 Foundations of Computer Science
C term 2014
Solutions of the Sample Problems for the Midterm
Exam
1. Give a regular expression that represents the set of strings over =
cfw_a, b that contain the substring ab and the substring ba.
Solution:
a+ b+ a
CS 3133 Foundations of Computer Science
C term 2014
Solutions for Homework 4
1. Use the technique from Section 6.1 in the book (i.e. constructing an
NFA- for a given regular set by following the recursive denition of
the regular set) to build the state di
CS 3133 Foundations of Computer Science
C term 2015
Solutions for Homework 5
1. Exercise 17.b. on page 249.
Solution: (with the pumping lemma for context-free languages) Let
us assume indirectly that the language L = cfw_ai bj ci dj | i, j 0 is
context-fr
Solutions Manual
for
Languages and Machines:
An Introduction to the Theory of
Computer Science
Third Edition
Thomas A. Sudkamp
Preface
This solution manual was written to accompany the third edition of Languages and Machines: An
Introduction to the Theory
CS 3133 Foundations of Computer Science
C term 2015
Homework 4, due Monday, February 23
READING: Chapters 6, 7.
1. Exercise 3 on page 217. (There is an error in the book, it should say:
The language of the DFA M in Example 5.3.7 consists of.) (20 points)
The Pumping Lemma for
Regular Languages
The Pumping Lemma forRegular Languages p.1/39
Consider the language
Nonregular languages
.
The Pumping Lemma forRegular Languages p.2/39
Consider the language
Nonregular languages
.
If we attempt to nd a DFA that re
CSE 322
Introduction to Formal Models in Computer Science
Myhill-Nerode Theorem
D EFINITION Let A be any language over . We say that strings x and y in are indistinguishable by A iff for every string z either both xz and yz are in A or both xz and yz are
Programming Languages and Lambda Calculi
(Utah CS7520 Version)
Matthias Felleisen
Matthew Flatt
Draft: March 8, 2006
Copyright c 1989, 2003 Felleisen, Flatt
2
Contents
I
Models of Languages
7
Chapter 1: Computing with Text
1.1 Dening Sets . . . . . . . .
Foundations of Computer Science
CS 3133
Pi Fisher
C Term 2015
1
Formal Languages
The alphabet is the set of symbols (a, b, c, . . . ) that make up strings in our
language. is the set of all possible strings using . A formal language is a set
L . The empty
CS 3133 Foundations of Computer Science, C term 2015
Homework 2, due Monday, February 2
READING: Chapters 3, 4, 5, 18.
1. Exercise 2 on page 97. (15 points)
2. Exercise 4 on page 98. (20 points)
3. Exercise 7 on page 98. (15 points)
4. Show by induction t
CS 3133 Foundations of Computer Science
C term 2016
Homework 1, due Monday, January 25
Most homeworks will be worth 100 points; consider the point value in
determining how much time you spend on each question. Homeworks must
be legible and stapled, with w
CS 3133 Foundations of Computer Science
C term 2015
(Last) Homework 5, due Monday, March 2
READING: Chapters 7, 8, 14, 15, 16.
1. Exercise 17.b. on page 249. (20 points)
2. Let M be the Turing machine dened by
q0
q1
q2
B
a
b
c
(q0 , B, R) (q0 , a, R) (q0
CS 3133 Foundations of Computer Science
C term 2015
Homework 1, due Monday, January 26
Most homeworks will be worth 100 points; consider the point value in
determining how much time you spend on each question. Homeworks must
be legible and stapled, with w
CS 3133 Foundations of Computer Science, C term 2016
Homework 2, due Monday, February 1
READING: Chapters 3, 4, 5, 18.
1. Exercise 2 on page 97. (15 points)
2. Exercise 4 on page 98. (20 points)
3. Exercise 11 on page 99. (15 points)
4. Show by induction
Chomsky Normal Form
We introduce Chomsky Normal Form, which is
used to answer questions about context-free
languages
Chomsky Normal Form
Chomsky Normal Form. A grammar where
every production is either of the form A BC
or A c (where A, B, C are arbitrary v
CS 3133 Foundations of Computer Science
C term 2016
Solutions for the Midterm Exam
1. Give a regular expression that represents the set of strings over =
cfw_a, b that do not contain the substring aa.
Solution:
b (ab+ ) ( a)
(20 points)
2. Consider the fo
CS 3133 Foundations of Computer Science, A term 2017
Homework 2, due Monday, September 11
READING: Chapters 3, 4, 5, 18.
assess
. Exercise 2 on page 97. (15 points)
Exercise 4 on page 98. (20 points)
Exercise 7 on page 98. (15 points)
. Show by induction
CS 3133 Foundations of Computer Science
A term 2017
Teaching assistants:
Cansu Sen, E-mail: csenwpi.edu, Ofce hrs: T, R 1-3.
Hang Cai, Email: hcaipri.edu, Oce hrs: M, W 1-3.
All ofce hours will be held in FL A22.
CS 3133 Foundations of Computer Science, A term 2017
Homework 2, due Monday, September 11
READING: Chapters 3, 4, 5, 18.
1. Exercise 2 on page 97. (15 points)
2. Exercise 4 on page 98. (20 points)
3. Exercise 7 on page 98. (15 points)
4. Show by induction