CMU 15251
Spring 2015
Homework 2 Writing session on Wednesday January 28
NOTE: On this homework, you may only use facts about regular languages that we proved in
class. More precisely: You may use the fact that if L1 and L2 are regular then so is L1 L2 .
CMU 15251
Spring 2015
Homework 1 Writing session on Wednesday January 21
0. (SOLO) Carefully read the course policies at http:/www.cs.cmu.edu/~15251
1. (SOLO) Prove (by structural induction) that in any propositional formula, the number of
variable occur
CMU 15251
Spring 2015
Homework 1 Writing session on Wednesday January 21
0. (SOLO) Carefully read the course policies at http:/www.cs.cmu.edu/~15251
Pls read.
1. (SOLO) Prove (by structural induction) that in any propositional formula, the number of
vari
15251
Great Theoretical Ideas in Computer Science
Lecture 17:
NP and NPcompleteness 1
March 21st, 2017
The big chasm between polytime and exptime.
testing primality
matrix
multiplication
MST
max matching
shortest path
polytime solvable
subsetsum
sch
15251
Great Theoretical Ideas in Computer Science
Lecture 2:
Strings and Encodings
Jan 19th, 2017
Chessboard Puzzle
neighbors in direction
N, S, W, E
Initially, some of the squares
are infected.
If a square has 2 or more
infected neighbors,
it becomes in
15251
Great Theoretical Ideas in Computer Science
Lecture 28:
Quantum Computation: A gentle introduction
May 2nd, 2017
Announcements
Please fill out the Faculty Course Evaluations (FCEs).
https:/cmu.smartevals.com
Announcements
As a thank you for filling
15251
Great Theoretical Ideas in Computer Science
Lecture 13:
Graphs III: Maximum Matchings
February 28th, 2017
Some motivating realworld examples
matching machines and jobs
Job 1
Job 2
.
.
.
.
Job n
Some motivating realworld examples
matching professo
15251
Great Theoretical Ideas in Computer Science
Lecture 21:
Introduction to Randomness and
Probability Theory Review
April 4th, 2017
Randomness and the Universe
Randomness and the Universe
Does the universe have true randomness?
Newtonian physics:
Univ
15251
Great Theoretical Ideas in Computer Science
Lecture 27:
Cryptography
What is cryptography about?
Adversary
Eavesdropper
I will cut his throat
I will cut his throat
What is cryptography about?
loru23n8uladjkfb!#@
I will cut his throat
encryption
lor
15251
Great Theoretical Ideas in Computer Science
Lecture 22:
Intro to Randomness and Probability Theory 2
April 6th, 2017
SUMMARY SO FAR
Real World
Code
Probability Tree
=
Events
Conditional probability:
Pr[A  B] = Pr[A \ B]/ Pr[B]
Mathematical Model

15251
Great Theoretical Ideas in Computer Science
Lecture 18:
NP and NPcompleteness 2
March 23rd, 2017
Some important reminders from last time
Summary of last time
How do you identify intractable problems?
(problems not in P) e.g. SAT, TSP, SubsetSum,
15251: Great Theoretical Ideas in Computer Science
Lecture 24
(Interactive) Proofs
Proofs from 900 BCE until 1800s
Pythagorass Theorem:
Proof:
Looks legit.
Then there was Russell
Principia Mathematica
Volume 2
Russell and others
worked on formalizing
pro
15251
Great Theoretical Ideas in Computer Science
Lecture 10:
Power of Algorithms
February 16th, 2017
Computable cousins of uncomputable problems
Halting Problem
Input: Description of a TM M and an input x
Question: Does M(x) halt?
This is undecidable.
H
15251
Great Theoretical Ideas in Computer Science
Lecture 4:
Deterministic Finite Automaton (DFA), Part 2
January 26th, 2017
Formal definition: DFA
A deterministic finite automaton (DFA) M is a 5tuple
M = (Q, , , q0 , F )
Q = cfw_q0 , q1 , q2 , q3
= c
15251
Great Theoretical Ideas in Computer Science
Lecture 23:
Randomized Algorithms Continued
April 11th, 2017
mincut
S < RandInt(6) + RandInt(6)
if S = 12: I < 1
else:
I < 0
RandInt(6)
RandInt(6)
(1,1)
S=2
I=0
(1,4) (1,6)
S=5
I=0
S=7
I=0
RandInt(6)
Ran
15251
Great Theoretical Ideas in Computer Science
Lecture 9:
Introduction to Computational Complexity
February 14th, 2017
Poll
What is the running time of this algorithm?
Choose the tightest bound.
def twoFingers(s):
lo = 0
hi = len(s)1
while (lo < hi):
CMU 15251
Great Theoretical Ideas in Computer Science
Spring 2017
Course Notes:
Definitions and Proofs
April 27, 2017
Please send comments and corrections to [email protected]
Acknowledgements
These notes are based on the lectures given by Anil Ada and Be
CMU 15251
Great Theoretical Ideas in Computer Science
Spring 2017
Course Notes:
Solutions/Hints to Selected Exercises
April 29, 2017
Please send comments and corrections to [email protected]
Acknowledgements
Thanks to Dongyu Li and Brendan Ney for sending
15251: Great Theoretical Ideas in Computer Science
Lecture 12
Graph Algorithms
L.F.O.A.
Lecture Full Of Acronyms
The most basic graph algorithms:
BFS:
Breadthfirst search
DFS:
Depthfirst search
AFS:
Arbitraryfirst search
What problems do these algorit
15251: Great Theoretical Ideas in Computer Science
Spring 2017, Lecture 15
Boolean Formulas and Circuits
Today
Briefly mention the P versus NP problem
Remind you of Boolean formulas
Tell you about Boolean circuits
Relate circuit size to algorithmic e
15251
Great Theoretical Ideas in Computer Science
Lecture 3:
Deterministic Finite Automaton (DFA), Part 1
January 24th, 2017
input
data
computer
output
data
Computation: manipulation of data.
How do we mathematically/formally represent data?
Representing
15251: Great Theoretical Ideas in Computer Science
Spring 2017, Lecture 20
Approximation Algorithms
SAT
3SAT
given a Boolean formula F,
is it satisfiable?
same, but F is a 3CNF
given
G
and
k,
are
there
k
VertexCover
vertices which touch all edges?
Cliq
15251
Great Theoretical Ideas in Computer Science
Lecture 1.5:
On proofs + How to succeed in 251
Jan18th, 2017
1. What is a proof ?
2. How do you find a proof ?
3. How do you write a proof ?
1. What is a proof ?
2. How do you find a proof ?
3. How do you
15251
Great Theoretical Ideas in Computer Science
Lecture 1:
Introduction to the course
Instructors:
Bernhard Haeupler
Anil Ada
Jan 17th, 2017
What is computer science?
What is theoretical computer science?
Motivational Quote of the Course
Computer Scien
15251
Great Theoretical Ideas in Computer Science
Lecture 4:
Deterministic Finite Automaton (DFA), Part 2
January 26th, 2017
Formal definition: DFA
A deterministic finite automaton (DFA) M is a 5tuple
M = (Q, , , q0 , F )
Q = cfw_q0 , q1 , q2 , q3
= c
15251
Great Theoretical Ideas in Computer Science
Lecture 14:
Graphs IV: Stable Matchings
March 2nd, 2017
From Last Time
Bipartite maximum matching problem
Bipartite maximum matching problem
Input: A bipartite graph G = (X, Y, E) .
Output: A maximum matc
15251
Great Theoretical Ideas in Computer Science
Lecture 3:
Deterministic Finite Automaton (DFA), Part 1
January 24th, 2017
input
data
computer
output
data
Computation: manipulation of data.
How do we mathematically/formally represent data?
Representing
15251
Great Theoretical Ideas in Computer Science
Lecture 14:
Graphs IV: Stable Matchings
March 2nd, 2017
From Last Time
Bipartite maximum matching problem
Bipartite maximum matching problem
Input: A bipartite graph G = (X, Y, E) .
Output: A maximum matc