Let XXX and YYY be independent Uniform(0,1)\mathrm{Uniform}(0,1)Uniform(0,1). Return P(low≤∣X−Y∣≤high)P(\text{low} \leq |X - Y| \leq \text{high})P(low≤∣X−Y∣≤high).
The distance has a known cumulative distribution, which you can read off the unit square as the area outside two corner triangles:
Input
low = 0.0 high = 0.5
Output
0.75
This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.
solve(...)