Katkat

Model particle hits on a screen

OpenAISoftware Engineer · Onsite

Last updated

This question evaluates geometric reasoning and probability theory skills, specifically transformation of random variables and derivation of CDF/PDF from angular sampling, together with practical competence in Monte Carlo simulation and interpretation of numerical and visualization artifacts; domain: Software Engineering Fundamentals.

A point source at (0, 0) emits particles toward an infinite vertical screen located at x = 1. For each particle, sample an angle theta uniformly from [-pi/2, pi/2] relative to the positive x-axis, and let the particle travel in a straight line until it hits the screen.

  1. Let Y be the y-coordinate where the particle hits the screen. Express Y in terms of theta.
  2. Derive the CDF and PDF of Y.
  3. Write a simulation that generates many particles and verifies the theoretical result by comparing a normalized histogram of the sampled hit locations with the true density.
  4. Briefly explain any numerical or visualization issues you would expect in this simulation.