

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The homework 4 for the cs 373 course, combinatorial algorithms, taught at the university of illinois at urbana-champaign during the spring semester of 1999. The homework includes a set of problems related to computational geometry and algorithms, such as determining collinearity, finding the convex hull, testing circle intersection, and solving a ghostbusters problem.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


and others who want extra credit. (There’s no such thing as “partial extra credit”!) Unmarked problems are extra practice problems for your benefit, which will not be graded. Think of them as potential exam questions. Hard problems are marked with a star; the bigger the star, the harder the problem. Note: When a question asks you to “give/describe/present an algorithm”, you need to do four things to receive full credit:
Give an O(n^2 log n) algorithm to determine whether any three points of a set of n points are collinear. Assume two dimensions and exact arithmetic.
Consider the following generic recurrence for convex hull algorithms that divide and conquer:
T (n, h) = T (n 1 , h 1 ) + T (n 2 , h 2 ) + O(n)
where n ≥ n 1 + n 2 , h = h 1 + h 2 and n ≥ h. This means that the time to compute the convex hull is a function of both n, the number of input points, and h, the number of convex hull vertices. The splitting and merging parts of the divide-and-conquer algorithm take O(n) time. When n is a constant, T (n, h) is O(1), but when h is a constant, T (n, h) is O(n). Prove that for both of the following restrictions, the solution to the recurrence is O(n log h):
(a) h 1 , h 2 < 34 h (b) n 1 , n 2 < 34 n
Give an O(n log n) algorithm to test whether any two circles in a set of size n intersect.
You are given a set of points in the first quadrant. A left-up point of this set is defined to be a point that has no points both greater than it in both coordinates. The left-up subset of a set of points then forms a staircase (see figure).
(a) (3 pts) Give an O(n log n) algorithm to find the staircase of a set of points. (b) (2 pts) Assume that points are chosen uniformly at random within a rectangle. What is the average number of points in a staircase? Justify. Hint: you will be able to give an exact answer rather than just asymptotics. You have seen the same analysis before.
Only 1U Grad Problems
A group of n ghostbusters is battling n ghosts. Each ghostbuster can shoot a single energy beam at a ghost, eradicating it. A stream goes in a straight line and terminates when it hits a ghost. The ghostbusters must all fire at the same time and no two energy beams may cross. The positions of the ghosts and ghostbusters is fixed in the plane (assume that no three points are collinear).
(a) Prove that for any configuration ghosts and ghostbusters there exists such a non-crossing matching. (b) Show that there exists a line passing through one ghostbuster and one ghost such that the number of ghostbusters on one side of the line equals the number of ghosts on the same side. Give an efficient algorithm to find such a line. (c) Give an efficient divide and conquer algorithm to pair ghostbusters and ghosts so that no two streams cross.