Note 5, DM819, fall 2018
Exercises October 1
-
Exercises 4.1, 4.2, 4.3, 4.15, 4.16.
-
Show that RANDOMPERMUTATION
generates all permutations with the same probability.
-
Show that it must take at least the order of n log n
to compute the intersection of n halfplanes
(some model assumptions are required to make this formal,
but take that lightly). Hint: reduce from sorting.
-
From CLRS[1], for instance,
we know that INSERTIONSORT
uses n(n-1)/2 number of comparisons in the worst case.
Use backwards analysis to show that if you randomize first
(using RANDOMPERMUTATION),
then the expected number of comparisons is n(n-1)/4.
Lecture October 2
-
Point Location (sections 6.0 - 6.3).
- ^ Sections 2.1-2.2
of Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein. Introduction to Algorithms (third ed.). MIT Press, 2009. ISBN 978-0-262-03384-8.