-1

I came across the below question and I am unable to find a way to find the closest pair distance using Divide and Conquer for the same, could someone please help?

L is the closest pair distance among all points with negative x co ordinate and R is the closest pair distance among all points with positive x co ordinate.

Assume there are atleast 2 points with positive and 2 points with negative x coordinate. if L<R and that no point has x co ordinate in the interval (-L/2, R/2), What is the Closest Pair Distance?

Grim0419
  • 19
  • 7
  • Have you tried to draw a picture? – n. m. could be an AI Sep 17 '21 at 19:41
  • Yes and the answer seems to be L, but needed explanation. – Grim0419 Sep 17 '21 at 20:15
  • So what would happen if you tried to place two points at a distance `< L` in the picture? Consider several cases of where such a pair could be located. Which condition would be violated in each case? – n. m. could be an AI Sep 17 '21 at 20:20
  • There are multiple cases right, how does one arrive to the case where it can be declared as the closest? P.S. Apologies if the replies are not to the point, trying to understand the concept and i appreciate your time for explaining me. – Grim0419 Sep 17 '21 at 20:27
  • Suppose there are two points closer than L. Can they both have negative coordinates? If not, why not? Cab they both have positive coordinates? If not, why not? Can one have a positive coordinate and the other one a negative coordinate? If not, why not? – n. m. could be an AI Sep 17 '21 at 20:47
  • TBH, I am completely lost now :( – Grim0419 Sep 18 '21 at 02:26
  • This belongs in Mathematics SE rather than here as it is a question about reasoning, not about programming. – CiaPan Sep 18 '21 at 07:49

1 Answers1

2

no point has x co ordinate in the interval (-L/2, R/2)

So, the closest distance between a point of the left (x <= -L/2) and a point on the right (x >= R/2) is if the two points are on the boundary (with the same y coordinates): Distance = L/2 + R/2

L < R

So, (L/2 + R/2) > (L/2 + L/2) = L

In other words, the shortest between a point that is on the left and one on the right is always greater than L, so L is the shortest distance.

Elliott
  • 2,603
  • 2
  • 18
  • 35