Lectures and Reading
- Wds Jan 5: Linear-time median algorithm.
Section 9.3.
Questions to think about (do no hand in!):
- How should the algorithm be modified to handle input sets where the numbers are not distinct, that is, where there can be duplicate elements?
- Question 9.3-3 (review of quicksort algorithm).
- Fri Jan 7: Analysis of linear-time median, randomized version.
Section 9.3,9.2.
Questions to think about:
- Show that any function T which satisfies a recurrence of the form
T(n) <= an + T(pn), 0 < p < 1
is O(n).
- Consider the following experiment: we roll a die. If we roll a 6,
we stop, and if not, we roll again.
Let X be random variable representing the number of times we roll the die.
What is E[x]?
- Mon Jan 10: Analysis of randomized median algorithm, introduction
to skip lists.
Skip list paper, William Pugh,
Communications of the ACM, vol 33, 1990. Hardcopy was distributed in
lecture so no need to print this out if you got the handout.
Questions to think about:
- What is the expected level chosen for a new element x in a skip list?
Express
the answer as a function of the probability p of moving up at each
step in the subroutine which chooses the random level.
- Wds Jan 12: Maximum level in a skip list.
Lecture notes.
Questions to think about:
- We chose a value of L = lg(1/p)n, and we said that this is
O(lg2n). Show with a calculation that lg(1/p)n is indeed
O(lg2n)
- Discussion, Thur Jan 13: Asymptotic notation, proof by
substitution, finding expected running time. Here are Susan's
section notes, and here is the
source file in case you want more LaTeX examples.
- Fri Jan 14: Search time in a skip list, lower bound for
comparison-based sorting.
- Wds Jan 19: Lower bound for comparison-based sorting.
Decision trees and the lower bound for deterministic algorithms, Section 8.1.
Questions to think about:
- We claimed that the average (mean) length of a path from root to leaf in
a rooted binary tree is minimized by a balanced tree. Give an argument
which proves this. Prove it!
- Discussion, Thur Jan 20: Lower bounds. Here are Susan's
section notes.
- Fri Jan 21: Tries and LZ compression.
Handout distributed in class Wds, also available Fri.
Questions to think about:
- One of the differences between the LZ78 algorithm we did in class
and the later LZW algorithm is that in LZW the trie is initialized by
inserting all the possible one character strings, before both encoding
and decoding. Argue that this ensures that the compressed string will consist
of a phrase code, followed by a character, and continue alternating
throughout. What is the adavantage of having this alternating form?
- Mon Jan 24: Universal hash functions. Section 11.3.3
Questions to think about:
- Say we chose a random hash function as described, and then an adversary
tried hashing items until she found a collision. Given that the probability
of a collision is at most 1/m, how many items would she expect to have to try
before finding a collision?
- Wds Jan 26: More universal hash functions. Section 11.3.3
The java applet we saw in class is the
numeroscope,
by Paul Burchard. We just looked at the first one; there are a bunch of others
demonstrating other features of modular aritmetic; quite interesting!
Questions to think about:
- Try using the numeroscope with a non-prime p. Observe that the property
that any linear equation produces a permutation of the numbers mod p fails to
hold.
- We showed in class that the function r =
ax + b mod p maps x to a random element r, when a and b are chosen
randomly and x is in 0...(p-1). Say we try to use this function as an
encoding device, that is, given a sequence x1,x2,... we compute the
encoded string r1,r2,... How easy is this code to break? How many pairs
(x1,r1),(x2,r2),... does an adversay have to see in order to figure
out which a and b we are using?
- Discussion, Thur Jan 27:Here are Susan's
section notes.
- Fri Jan 28: Pairwise independance, Markov's inequality.
Questions to think about:
- Prove Markov's inequality for an integer-valued non-negative random
variable.
-
Mon Jan 31: "Power of two choices" hashing (result only).
A survey paper on results for "power of two"
hashing is at here.
If you are interested in this as a research area, this is a good place to
start.
Introduction to shortest paths, skim Chapter 24.
Questions to think about:
- Given the vector d of shortest paths from s to every other vertex
v, how can you compute the vector pi containing a
pointer from each v to its predecessor along a shortest path from s?
-
Wds Feb 2: Dynamic programming algorithm for all-pairs shortest paths.
Section 25.2.
Questions to think about:
- The Floyd-Warshall algorithm might report incorrect rsults if given a graph containing a negative-weight cycle. How could you implement it to detect that this has occurred?
- Discussion, Thur Feb 3:Here are Susan's
section notes.
-
Fri Feb 4:Introduction to Max-Flow, Ford-Fulkerson Algorithm.
Section 26.1 and 26.2.
Questions to think about:
- Say the original network does not contain either edge (u,v) or edge (v,u), between two vertices u and v. Is it possible that the residual network for some flow will contain either (u,v) or (v,u)?
-
Mon Feb 7:Midterm review.
- Discussion, Thur Feb 10:Here are Susan's
section notes.
-
Fri Feb 11:Max-Flow Min-Cut theorem and correctness of Ford-Fulkerson.
Section 26.1 and 26.2 continued.
Questions to think about:
-
Mon Feb 14:Min-cut as proof of Phillip Hall's Theorem.
Introduction to linear programming.
Questions to think about:
-
Wds Feb 16:Linear programming and the simplex algorithm.
Section 29.1
Questions to think about:
- Verify that the Hirsh conjecture is true on a cube. How about an
icosohedron?
-
Fri Feb 18:Linear programming duality.
Section 29.4
Questions to think about:
-
Wds Feb 23:Markov model of English and
speech understanding.
Questions to think about:
- The Hidden Markov Model process we described in class
computes, at each step, a distribtuion describing our
belief that the speaker's last utterance was the pair of words in
each state $i$. How could you use this to write down our
best guess of the speaker's
sentence as it is uttered? How could you use it to reconstruct the most
likely sentence once the entire sentence is over? Would the results ever
be different?
-
Fri Feb 25:Markov processes and the stationary distribution.
Here is the link to the
Shannonizer text generation page which uses the trigram model of
English.
Questions to think about:
- Consider the Markov process induced by an undirected graph; for
every vertex i, each outgoing edge has equal probability, so that the
probability of an outgoing edge is 1/degree(i), where degree(i) is the
number of edges adjacent to i. Prove that in the stationary
distribution, Pr[state i] = degree(i)/2E, where E is the total number
of edges in the undirected graph.
-
Mon Feb 28:
Kleinberg's
paper on page ranking.
Questions to think about:
- Argue that the adjaency matrix of an
unweighted, undirected, unconnected graph always has at least two real
non-negative eigenvectors.
-
Wds Mar 2:
Introduction to NP-completeness. Intorduction to Ch. 34, begining of section 34.3, section 34.4. Read section 34.5 introducing several NP-complete problems.
Questions to think about:
- Given an n-by-d integer matrix A and an integer n-vector b,
the ZERO-ONE INTEGER PROGRAMMING problem asks whether there is
a vector x in {0,1}d such that Ax<= b.
Using one of the problems in picture 34.13,
prove that ZERO-ONE INTEGER PROGAMMING is NP-complete.
- Discussion, Thur Mar 10:Here are Susan's
section notes.
-
Fri Mar 4:
The first NP-complete problem: Circuit-SAT
Questions to think about:
-
We argued in class that we can construct a circuit of size poly(n)
that will check the certificate for any problem in NP. Let's do the
somewhat easier problem of building a circuit to check the certificate
for any instance of vertex cover with four vertices. To define the
graph, we need to specify which edges are present; we use six input
wires eij, one for each possible edge between vi
and vj. We represent the instance of the vertex cover problem
by putting TRUE on the
wires for edges present in the graph and FALSE on wires for which the
edge is not present. To represent the certificate for the vertex
cover, we just need four wires; we put TRUE on wire i if vi
is in the vertex cover, and FLASE otherwise. Draw a circuit which
takes the signals on these wires as input and outputs TRUE if the
certificate is valid.
-
Mon Mar 7:
Approximation algorithms for NP-complete problems. Introduction to Ch. 35, and section 35.2.1, the approximation algorithm for TSP.
Questions to think about:
-
Wds Mar 9:
Inapproximability of METRIC K-CENTER using DOMINATING-SET. Section 35.2.2 gives another example of an inapproximablity result.
Questions to think about:
- Discussion, Thur Mar 10:Here are Susan's
section notes.
-
Fri Mar 11:
Approximation algorithms using randomness and LP. Section 35.4.
Questions to think about:
-
Mon Mar 14:
LP was knonw to be in NP; after 1979, we know it is in P.
Questions to think about: