15-251: Great Theoretical Ideas in Computer Science
Homework 4 (due Thursday, February 23)
Directions: Write up carefully argued solutions to the following problems. The rst task is to be complete and correct. The more subtle task is to keep it simple and
15-251: Great Theoretical Ideas in Computer Science
Fall 2014; Lecture 23
November 18, 2014
Efficient Reductions
Reductions
How to tell a mathematician from and an engineer:
Put an empty kettle in the middle of the kitchen floor and tell
your subjects to
1. Generating Functions
(a) Find the generating function for the sequence 1, 1, 1, 1, . in closed form.
Solution: This is just 1 + x + x2 + . Ignoring convergence, we get this is equal
1
to 1x .
(b) Whats the coecient of x2005 in the generating function G
1. Not Pirates and Not Gold
(a) In lecture we developed a solution to this question:
How many nonnegative integer solutions are there to the equation
x1 + x2 + x3 + x4 + x5 = 40
Solution: This is just pirates and gold with n = 40, k = 5. Thus, the answer
1. Problem 1
Let L1 L2 .
(a) If L1 is a regular language, then is L2 necessarily a regular language?
Solution:
(b) If L2 is a regular language, then is L1 necessarily a regular language?
Solution:
2. Problem 2
Consider a regular language L that accepts a
1. Axiomatic Systems
Youre a military commander and your intelligence sta has intercepted some enemy
communications. Theyve determined that all of the messages the enemy sends are
strings in the set cfw_+, . Theyve also gleaned that every message s that
15-251: Great Theoretical Ideas in Computer Science
Lecture 1010
Challenge (to work on during lecture)
for those of you who know it all
already:
Probability 1
Construct four dice (where each face has a
number between 1 and 9). Call these dice A, B, C,
and
15-251: Great Theoretical Ideas In Computer Science
Recitation 12 Solutions
Review Material
A problem is in NP if YES instances of the problem have polynomial-length certicates proving
that the instance is a YES instance which can be veried in polynomial
15-251: Great Theoretical Ideas In Computer Science
Recitation 14 Solutions
Approximately Satised
For simplicity, in our version of 3-SAT, dont allow a variable to appear more than once in a given clause.
7
(a) Prove that for any 3-SAT expression, we can
15-251: Great Theoretical Ideas In Computer Science
Recitation 12 Solutions
Review Material
Voting Systems:
Plurality - voters have one vote, candidate with the most votes wins
Borda Count - voters rank candidates n.1, candidates receive that many points
1. Isomorphisms
Show that there are eleven nonisomorphic simple graphs on four vertices.
Solution:
2. Eulers Formula
A soccer ball is a convex polyhedron whose faces are either hexagons or pentagons. Prove
that a soccer ball has exactly 12 pentagonal face
15-251: Great Theoretical Ideas in Computer Science
Lecture 24
November 20, 2014
P vs. NP
$1,000,000
the prize for solving any
of the Millennium Prize Problems
www.claymath.org/millennium/P_vs_NP/
Millennium Prize Problems
1. Birch and Swinnerton-Dyer Co
Great Theoretical Ideas In Computer Science
Victor Adamchik
CS 15-251
Carnegie Mellon University
Approximation Algorithms
P NP
Computational hardness
Suppose we are given an NP-complete problem
to solve.
Can we develop polynomial-time algorithms that
alwa
1. Not Pirates and Not Gold
(a) In lecture we developed a solution to this question:
How many nonnegative integer solutions are there to the equation
x1 + x2 + x3 + x4 + x5 = 40
Solution:
(b) How many nonnegative integer solutions are there to the equatio
1. Axiomatic Systems
Youre a military commander and your intelligence sta has intercepted some enemy
communications. Theyve determined that all of the messages the enemy sends are
strings in the set cfw_+, . Theyve also gleaned that every message s that
15-251: Great Theoretical Ideas In Computer Science
Recitation 10 Solutions
Review Material
Countability:
|N| = 0 . N is countable and anything that is countable has a bijection to the naturals.
Uncountable:
The reals are uncountable. Any innte set whic
15-251: Great Theoretical Ideas In Computer Science
Homework 4 Solutions
Prelude:
After destroying the evil SHRDLU, all the sleeping people on earth woke up. The TAs were so proud
of their splendid accomplishment that they decided to spend all their money
15-251: Great Theoretical Ideas In Computer Science
Recitation 9 Solutions
A pleasant re of mssrs. Turing, Church, Kleene, and Gdel
o
We usually deal with Universal Register Machines (or URMs). AKA, computers. Without anything
that Kesden will tell you a
15-251: Great Theoretical Ideas In Computer Science
Recitation 6 Solutions
Some Re
A random variable is neither random nor a variable. It is a function mapping the outcome of an
experiment to a real value. Not the best wording.
Random variables are dene
15-251: Great Theoretical Ideas In Computer Science
Recitation 5 Solutions
Training
First Theorem of Graph Theory
d(v) = 2|E|
vV
Counting each edge at each vertex double counts the edges since they are attached to two dierent
vertices.
Tree
These are equi
15-251: Great Theoretical Ideas In Computer Science
Recitation 1 Solutions
Golden AdminisRetriever
Hw2 is due Thursday midnight now because of duplicate problem! Woof!
We are trying very hard to get your hw1 graded and handed back before hw2 is due! (we
15-251: Great Theoretical Ideas In Computer Science
Recitation 3 Solutions
Administration of Champions
HW3 is due Wednesday night! Not Thursday!
Does Winning the Olympics Even Count
Partition: If A is the disjoint union of B and C, |A| = |B| + |C|.
Pro
15-251: Great Theoretical Ideas In Computer Science
Homework 13 Solutions
0.No More Skcirbs! (15 points)
Wandering around, you nd yourself in Bricksburgh. You decide that in order to gure out what on
earth is going on, you should talk to President Tepper.