Qm
BrainteasersJane StreetCitadel

Dropping needles to estimate pi

A floor is marked with parallel lines a distance d apart. A needle of length d (the same as the spacing) is dropped so that its position and orientation are uniformly random.

  1. What is the probability that the needle crosses one of the lines?
  2. Explain how dropping many needles gives an estimate of pi, and why the estimate converges slowly.
Show a hint

Describe the needle by the distance from its centre to the nearest line (between 0 and d/2) and the angle it makes with the lines (between 0 and a right angle). It crosses a line when the needle's projection perpendicular to the lines reaches the nearest line.

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

Estimating pi by throwing dartsDoes a random triangle on a circle contain the centre?A random chord longer than the side of the triangleWhich card is bigger?The bookworm and the ten volumesThe missing square
All questions →