[Math] How to calculate the probability that the distance between two points is less than some value

probability

If I have two points $A=(x_A, y_A)$ and $B=(x_B, y_B)$ generated uniformly ate random in 2D Euclidean space. Here, I assume $0­\le x_A, x_B, y_A, y_B \le 100$. I would like to calculate the probability that the distance between them, $d_{AB}$, is smaller than some given constant $\alpha$.

This is given by

$$
\begin{align}
\mathbb{P}[d_{AB}\le \alpha] = &\;\mathbb{P}\left[\sqrt{(x_A-x_B)^2+(y_A-y_B)^2}\le \alpha\right]\\=&\;\mathbb{P}\left[(x_A-x_B)^2+(y_A-y_B)^2\le \alpha^2\right]
\end{align}
$$

How can I finish this?

Best Answer

Basically you require the probability that $B$ lies within a disk or radius $\alpha$ from $A$.

Whenever $A$ lies more than $\alpha$ from the edge this is $ 10^{-4}\pi\alpha^2$.   For sufficiently small $\alpha$ this is a reasonable approximation of the required probability.

It will be somewhat less if there is a significant probability that $A$ lying within $[0;\alpha)$ from an edge or two (or maybe three or four for really large $\alpha$).   The calculation of which would involve the equation for the areas of circle cut by chords.   When $\alpha<100$ this would look something like

$$10^{-4}\big(\pi\alpha^2 - 400\int_0^{\alpha} \operatorname {chordSlice}(x,\alpha)\operatorname d x +4\int_0^{\alpha}\!\!\!\int_0^{\alpha}\operatorname {twoChordSlice}(x,y,\alpha)\operatorname d x\operatorname d y \Big) $$

Related Question