Katkat

Sample uniformly from a circle’s area

LinkedInMachine Learning Engineer · Onsite

Last updated

This question evaluates understanding of continuous probability distributions and geometric random sampling, testing whether a candidate recognizes how area-weighted uniformity differs from naive radial choices.

How would you generate a point (x, y) uniformly at random from the area of a circle of radius R centered at the origin?

  • Explain why naive choices (e.g., choosing radius uniformly in [0,R]) are not uniform over area.
  • Provide a correct sampling method (math + pseudocode).