OpenAI · Probability & Brainteasers
Model particle hits on a screen
TrueInterview
October 7, 2026 · 1 min read
A point-like source sits at the origin . It emits particles into the half-plane to the right, where an unbounded vertical detector plane is positioned at . Each particle’s direction is chosen independently: the angle is measured from the positive -axis and is uniformly distributed on . Once a direction is sampled, the particle travels along a straight ray until it reaches the detector. Angles exactly parallel to the detector, , occur with probability zero and may be ignored.
-
Write the vertical coordinate of the intersection point as a function of .
-
Using the distribution of , derive the cumulative distribution function and the probability density function of . State the support of .
-
Implement a Monte Carlo simulation that draws many independent angles, computes the corresponding values of , and plots a normalized histogram of the hit positions. Overlay the theoretical density from part 2 to verify the derivation.
-
Discuss numerical or visualization effects that could complicate the comparison, such as sample size, histogram bin width, and the presence of very large values of .
Examples
Example
Input:
1
0
Output: 0.5 0.318309886184