Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are given n points in the plane (each given by a pair (x, y) of coordinates). Your job is to find the pair of

image text in transcribed

You are given n points in the plane (each given by a pair (x, y) of coordinates). Your job is to find the pair of points that are closest to each other, the same problem we aimed to solve in Lecture 7. During that lecture, we discussed a deterministic algorithm for this with worst-case running time theta(n log n). Now, you are asked to design an algorithm runs in O(n) expected time for uniformly distributed inputs; that is, assuming that the inputs' coordinates (x_1, y_1, x_2, y_2, . ... ., x_n, y_n) are selected independently, uniformly and independently in [0, 1]. The algorithm can be deterministic. It should run in expected time O(n) where the expectation is taken over the choice of the input. The output should be the coordinates of the two closest points among those in the input. First, explain your algorithm concisely in English (feel free to use pictures). Second, specify your algorithm using clear pseudocode. Prove that your algorithm is correct. Your algorithm has to find the nearest pair of inputs on all possible inputs-you are not allowed to use the fact that the points are randomly distributed for correctness. Prove that your algorithm's expected running time is O(n). (We assume here that figuring out which cell a point belongs to can be done in constant time (say, by dividing each of the coordinates by 1/t and rounding down to the nearest integer), and that the operations needed to compute distance can also be done in constant time.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions