Complete · 60 Days65 / 143
EasyAlgorithms & Numerical
Monte Carlo — Estimate π
Goldman SachsTwo Sigma
You throw N uniform random points into the unit square and count the fraction that land inside the quarter unit circle. To estimate π, what should you multiply that fraction by?
Approach
What fraction of the unit square does the quarter circle cover?
Related problems
Product of Array Except SelfMediumKth Largest ElementMediumMaximum Subarray (Kadane)MediumRandom Pick with WeightMediumShuffle an Array (Fisher-Yates)MediumBest Time to Buy and Sell StockMedium
More in Algorithms & Numerical.