CS 341 Automata Theory
Elaine Rich Homework 1 Due Thursday, September 7 at 11:00 a. m. 1) Write each of the following explicitly: a) P(cfw_a, b) P(cfw_a, c) b) cfw_a, b cfw_1, 2, 3 c) cfw_x : (x 7 x 7 d) cfw_x : y (y < 10 (y + 2 = x) (where is the set of
CS 341 Automata Theory
Elaine Rich Homework 14 Due Friday, Dec.8 at 11:59 pm
1)
Construct unrestricted grammars that generate each of the following languages L: a) cfw_wwRw : w cfw_a, b*. b) cfw_anbmcn+m : n, m > 0. c) cfw_anbmcnm : n, m > 0.
2) Construct
CS 341 Automata Theory Elaine Rich Homework 8 Due: Thursday, March 8, 2007 This assignment covers Sections 11.7 - 11.8. 1) Let G be the ambiguous expression grammar of Example 11.14. Show at least three different parse trees that can be generated from G f
CS 341 Automata Theory
Elaine Rich Homework 1 Due Thursday, September 7 at 11:00 a. m. 1) Write each of the following explicitly: a) P(cfw_a, b) P(cfw_a, c) b) cfw_a, b cfw_1, 2, 3 c) cfw_x : (x 7 x 7 d) cfw_x : y (y < 10 (y + 2 = x) (where is the set of
CS 341 Automata Theory Elaine Rich Homework 6 Due: Thursday, February 22, 2007 This assignment covers Sections 5.10-5.13 and a review of regular languages. 1) Consider the problem of counting the number of words in a text file that may contain letters plu
CS 341 Automata Theory Elaine Rich Homework 6 Due: Thursday, February 22, 2007 This assignment covers Sections 5.10-5.13 and a review of regular languages. 1) Consider the problem of counting the number of words in a text file that may contain letters plu
CS 341 Homework 1 Answers
1) Prove each of the following: a) (A B) C) (A B C). (A B) C) (A B C) (A B) C) (A B C) (A B) C) (A B C) (A B C) (A B C) True Definition of de Morgans Law Associativity of Definition of
b) (A B C) (A (B C).
(A B C) (A (B C) (A B
CS 341 Automata Theory
Elaine Rich Homework 15 Due Friday, Dec. 8 at 11:55 pm
1)
Let M be an arbitrary Turing machine. a) Suppose that timereq(M) = 3n3(n+5)(n-4). Circle all of the following statements that are true: i) timereq(M) O(n).
ii) iii)
timereq(M
CS 341 Homework 2 Answers Chapter 2 1) Consider the language L = cfw_1n2n : n > 0. Is the string 122 in L?
No. Every string in L must have the same number of 1s as 2s.
2) Let L1 = cfw_anbn : n > 0. Let L2 = cfw_cn : n > 0. For each of the following string
CS 341 Automata Theory Elaine Rich Homework 3 Answers
1. Construct a deterministic finite state machine to accept each of the following languages: a) The set of binary representations, without leading 0s, of integers that are divisible by 4.
b) The set of
CS 341 Automata Theory Elaine Rich Homework 7 Due: Thursday, March 1, 2007 This assignment covers Sections 11.1 - 11.6. 1) Let = cfw_a, b. For the languages that are defined by each of the following grammars, do each of the following: i. List five strings
CS 341 Homework 3 Answers Chapter 5
2) Show a DFSM to accept each of the following languages: b) cfw_w cfw_a, b* : w does not end in ba.
a 2 a 1 b 4 b
c) cfw_w cfw_0, 1* : w corresponds to the binary encoding, without leading 0s, of natural numbers that a
CS 341 Automata Theory
Elaine Rich Homework 10 Due Thursday, Nov. 9 at 11:00 1) Determine, for each of the following languages, whether it is (I) Regular, (II) Context free but not regular, or (III) not context free. Prove your answer. a) L = cfw_wwRw : w
CS 341 Automata Theory Elaine Rich Homework 4 Due: Thursday, February 8, 2007 1) Consider the following FSM M: a a 1 a) b b 2 a 3 b 4 a,b
Show a regular expression for L(M). (a bb*aa)* ( bb*(a ).
b) Describe L(M) in English. All strings in cfw_a, b* that
CS 341 Automata Theory
Elaine Rich Homework 2 Due Thursday, September 14 at 11:00
1)
2)
3)
4)
5)
6)
7) 8)
For each of the following languages L, give a simple English description of L. Show two strings that are in L and two that are not (unless there are
Name:
1a
b
c
d
2
3a
b
c
4a
b
5a
b
6
Total
15
15
15
15
15
8
8
8
5
15
8
8
20
155
CS 341
Second Midterm Exam
Practice
Use extra paper to determine your solutions then neatly transcribe them onto these
sheets.
You may use any claim we proved in class as a the
Name:
1a
b
c
d
e
f
g
2
3
4
5
Total
20
20
20
20
20
20
20
10
30
12
15
207
CS 341
Practice Final Exam
1. Please write neatly. You will lose points if we cannot figure out what you
are saying.
2. Whenever you answer a question with a machine or a grammar, add
Name:
1a
b
c
d
e
f
g
2
3
4
5
T otal
20
20
20
20
20
20
20
10
30
12
15
207
CS 341
Practice Final Exam
1. Please write neatly. You will lose points if we cannot figure out what you
are saying.
2. Whenever you answer a question with a machine or a grammar, ad
Name:
1
2a
b
3
4a
b
c
d
5a
b
c
6
7
8a
b
c
Total
10
5
10
10
15
15
15
15
5
15
15
15
15
5
5
5
175
CS 341
First Midterm Exam
Practice
1. Use extra paper to determine your solutions then neatly transcribe
them (including intermediate steps) onto these sheets.
Name:
1a
b
c
d
e
f
g
2
3
4
5
T otal
20
20
20
20
20
20
20
10
30
12
15
207
CS 341
Practice Final Exam
1. Please write neatly. You will lose points if we cannot figure out what you
are saying.
2. Whenever you answer a question with a machine or a grammar, ad
CS 341 Automata Theory
Elaine Rich
Homework 6
Due: Tuesday, February 26
This assignment covers Section 8.6, Chapter 9 and a review of regular languages.
Chapter 8
1) Prove that the regular languages are closed under each of the following operations:
a) pr
CS 341 Automata Theory
Elaine Rich
Homework 10
Due Tuesday, April 2
This assignment reviews Chapter 13 and covers Chapter 14 and Sections 17.1 - 17.3.
1) For each of the following languages L, state whether L is regular, context-free but not regular, or n
Name:
1
2a
b
3
4a
b
c
d
5a
b
c
6
7
8a
b
c
Total
10
5
10
10
15
15
15
15
5
15
15
15
15
5
5
5
175
CS 341
First Midterm Exam
Practice
1. Use extra paper to determine your solutions then neatly transcribe
them (including intermediate steps) onto these sheets.
Name:
1a
b
c
d
2
3a
b
c
4a
b
5a
b
6
Total
15
15
15
15
15
8
8
8
5
15
8
8
20
155
CS 341
Second Midterm Exam
Practice
Use extra paper to determine your solutions then neatly transcribe them onto these
sheets.
You may use any claim we proved in class as a the
Name:
1a
b
c
d
e
f
g
2
3
4
5
Total
20
20
20
20
20
20
20
10
30
12
15
207
CS 341
Practice Final Exam
1. Please write neatly. You will lose points if we cannot figure out what you
are saying.
2. Whenever you answer a question with a machine or a grammar, add
Name:
1a
b
c
d
e
f
g
2
3
4
5
T otal
20
20
20
20
20
20
20
10
30
12
15
207
CS 341
Practice Final Exam
1. Please write neatly. You will lose points if we cannot figure out what you
are saying.
2. Whenever you answer a question with a machine or a grammar, ad
Name:
1
2a
b
3
4a
b
c
d
5a
b
c
6
7
8a
b
c
Total
10
5
10
10
15
15
15
15
5
15
15
15
15
5
5
5
175
CS 341
First Midterm Exam
Practice
1. Use extra paper to determine your solutions then neatly transcribe
them (including intermediate steps) onto these sheets.
Name:
1
2a
b
3
4a
b
c
d
5a
b
c
6
7
8a
b
c
Total
10
5
10
10
15
15
15
15
5
15
15
15
15
5
5
5
175
CS 341
First Midterm Exam
Practice
1. Use extra paper to determine your solutions then neatly transcribe
them (including intermediate steps) onto these sheets.
Name:
1a
b
c
d
2
3a
b
c
4a
b
5a
b
6
Total
15
15
15
15
15
8
8
8
5
15
8
8
20
155
CS 341
Second Midterm Exam
Practice
Use extra paper to determine your solutions then neatly transcribe them onto these
sheets.
You may use any claim we proved in class as a the