CS 341: Foundations of Computer Science II
Prof. Marvin Nakayama
Homework 7 Solutions
1. Give an implementation-level description of a Turing machine that decides the language
B = cfw_ 0n 1n 2n | n 0 .
Answer:
M = On input string w :
1. Scan the input fro
CS 341: Chapter 4
4-2
Chapter 4
Decidability
CS 341: Foundations of CS II
Contents
Decidable Languages
TM Acceptance Problem is Undecidable
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
CS 341: Chapte
CS 341: Chapter 5
5-2
Chapter 5
Reducibility
CS 341: Foundations of CS II
Contents
Reducing One Problem to Another
Examples of Undecidable Problems
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
CS 341
CS 341: Chapter 7
7-2
Chapter 7
Time Complexity
CS 341: Foundations of CS II
Contents
Time and space as resources
Big O/little o notation, asymptotics
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
Ti
CS 341: Chapter 5
5-2
Chapter 5
Reducibility
CS 341: Foundations of CS II
Contents
Reducing One Problem to Another
Examples of Undecidable Problems
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
CS 341
CS 341: Chapter 3
3-2
Chapter 3
Church-Turing Thesis
CS 341: Foundations of CS II
Contents
Turing Machines
Turing-recognizable
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
Turing-decidable
Variants
CS 341: Chapter 1
1-2
Chapter 1
Regular Languages
CS 341: Foundations of CS II
Contents
Finite Automata
Class of Regular Languages is Closed Under Some Operations
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark,
CS 341: Foundations of Computer Science II
Prof. Marvin Nakayama
Homework 8 Solutions
1. Consider the problem of testing whether a DFA and a regular expression are equivalent.
Express this problem as a language and show that it is decidable.
Answer: Dene
CS 341: Chapter 2
2-2
Chapter 2
Context-Free Languages
CS 341: Foundations of CS II
Contents
Context-Free Grammar (CFG)
Chomsky Normal Form
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
Pushdown Auto
CS 341: Chapter 4
4-2
Chapter 4
Decidability
CS 341: Foundations of CS II
Contents
Decidable Languages
TM Acceptance Problem is Undecidable
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
CS 341: Chapte
CS 341: Chapter 7
7-2
Chapter 7
Time Complexity
CS 341: Foundations of CS II
Contents
Time and space as resources
Big O/little o notation, asymptotics
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
Ti
Join the MDA Summer
Camp team today!
Where anything
is possible.
MDA Summer Camp at Happiness is Camping
August 21, 2016 - August 27, 2016
Hardwick, NJ
Jackie Cirello, 201-843-4452, [email protected]
mda.org
#MDAsummercamp
Muscular Dystrophy Association
CS 341: Chapter 3
3-2
Chapter 3
Church-Turing Thesis
CS 341: Foundations of CS II
Contents
Turing Machines
Turing-recognizable
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
Turing-decidable
Variants
CS 341: Chapter 2
2-2
Chapter 2
Context-Free Languages
CS 341: Foundations of CS II
Contents
Context-Free Grammar (CFG)
Chomsky Normal Form
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
Pushdown Auto
CS 341: Foundations of Computer Science II
Prof. Marvin Nakayama
Homework 1 Solutions
1. We are given the sets
C
D
E
F
=
=
=
=
cfw_, aab, baa,
cfw_bb, aab,
cfw_,
.
(a) D C = cfw_, bb, aab, baa
(b) C F = cfw_, aab, baa = C
(c) C D = cfw_ (, bb), (, aab), (
CS 341: Foundations of Computer Science II
Prof. Marvin Nakayama
Homework 6 Solutions
1. Give pushdown automata that recognize the following languages.
(a) A = cfw_ w cfw_0, 1 | w contains at least three 1s
Answer:
q1
1,
0,
q2
1,
0,
q3
1,
0,
q4
0,
Midterm Exam 1
CS 341: Foundations of Computer Science II Fall 2013, day section
Prof. Marvin K. Nakayama
Print family (or last) name:
Print given (or rst) name:
I have read and understand all of the instructions below, and I will obey the Academic Honor
Midterm Exam 2
CS 341: Foundations of Computer Science II Fall 2013, day section
Prof. Marvin K. Nakayama
Print family (or last) name:
Print given (or rst) name:
I have read and understand all of the instructions below, and I will obey the Academic Honor
Midterm Exam
CS 341-451: Foundations of Computer Science II Fall 2013, eLearning section
Prof. Marvin K. Nakayama
Print family (or last) name:
Print given (or rst) name:
I have read and understand all of the instructions below, and I will obey the Academi
CS 341, Fall 2007
Solutions for Quiz 1, Day Section
1. (a) bab, abab, bbab, aabab, abbab, babab
(b) A is not closed under reversal. For example, the string abab A, but its reversal
baba A.
(c) A DFA for A is below:
a
b
b
q1
b
a
q2
q3
b
q4
a
a
1
CS 341, Spring 2010
Solutions for Quiz 1, Day Section
1. (a) ba, aba, bba, aaba, abba, baba
(b) A is not closed under reversal. For example, the string ba A, but (ba)R = ab
A.
(c) A DFA for A is below:
a
b
q1
b
a
q2
q3
b
a
1
CS 341, Fall 2011
Solutions for Quiz 1, Day Section
1. (a) aa, ab, aaa, aab, baa, bab
(b) A is closed under concatenation. To prove this, let w1 and w2 be arbitrary strings
in A. Then |w1| 2, |w2 | 2, and the second-to-last symbol of both strings is
a. Th
CS 341, Fall 2011
Solutions for Quiz 2, Day Section
1. (a) There are two dierent approaches one can use to show that CLIQUE NP:
Show that CLIQUE has a nondeterministic Turing machine that runs in
polynomial time, or
Show that CLIQUE has a polynomial-tim
CS 341: Chapter 0
0-2
Chapter 0
Mathematical Background
CS 341: Foundations of CS II
Contents
Overview of course
Alphabets, Strings, and Languages
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark, NJ 07102
Set Re
CS 341: Chapter 1
1-2
Chapter 1
Regular Languages
CS 341: Foundations of CS II
Contents
Finite Automata
Class of Regular Languages is Closed Under Some Operations
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark,
NJIT
SPRING 2016
Prof. Aarin M. Williams, Esq.
Email: [email protected]
HUM 102(106): Writing, Speaking, Thinking II
CKB 316
Wednesday 6-9:05 pm
Office hours: by appointment only
Department of Humanities
This syllabus is provisional and subject to minor alte