Model particle hits on a screen
OpenAISoftware Engineer · OnsiteLast 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.
- Let Y be the y-coordinate where the particle hits the screen. Express Y in terms of theta.
- Derive the CDF and PDF of Y.
- 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.
- Briefly explain any numerical or visualization issues you would expect in this simulation.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.