Editorial for ICPC NWERC 2014 F - Finding Lines


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Given n points in \mathbb R^2, is there a straight line passing through at least a p fraction of them?

  • If line exists it is uniquely determined by any two of its points.
  • Probability that a random point lies on the line is \ge p.
  • Repeat 250 times:
    1. Pick two distinct points uniformly at random
    2. Check if line defined by the points has enough points.
  • Pr[\text{false negative}] \approx (1-p^2)^{250} \le (1-\frac{1}{25})^{250} < 4 \times 10^{-5} (cheated slightly – it's a bit worse)

Many other ways e.g. divide and conquer


Comments

There are no comments at the moment.