# Math Help - The probability of two random points on a plane being closer than a certain distance?

1. ## The probability of two random points on a plane being closer than a certain distance?

Hi,

I've been struggling with the following problem for some time now, and it seems that I need some pro help:

I have a process that generates a point $x$ on a plane, and I need to find the pdf $p(x)$ of that point. The process goes like this: First, points $x_1$ and $x_2$ are independently generated on the plane with pdfs $p_1(x_1)$ and $p_2(x_2)$. Then, only if the two points are closer than a certain distance $r$, i.e. $||x_1 - x_2|| < r$, I take as my point $x \equiv x_1$.

This point $x$ is used for Monte Carlo integration, and if I use the pdf $p(x) = p_1(x_1) p_2(x_2) \pi r^2$ it all works nicely. However, I'm having a hard time justifying this particular pdf. I see two possible ways: (1) this pdf is a decent approximation of the real pdf; (2) this pdf is an unbiased estimate of the real pdf. More specifically, $\pi r^2$ is the result of a one-sample Monte Carlo estimation of the integral that appears due to the distance probability.

I'm having a hard time mathematically formulating this pdf. Any ideas? Thanks very much in advance!

2. ## Re: The probability of two random points on a plane being closer than a certain dista

Hi,

As far as I understand, you define $X$ to be $X_1$ conditioned to be at distance smaller than $r$ to $X_2$, right? In other words, you sample $X_1$ and $X_2$ repeatedly until they are closer than $r$ from each other and then you set $X=X_1$. Is that indeed it?

If so, first the law of $X$ should not symmetric with respect to $p_1$ and $p_2$ as they have different roles. And second there is no meaning to writing $p(x)$ as a function of $x_1,x_2$ which are not defined in terms of $x$? So something has to be wrong; it may be my understanding, but let's carry on.

Given my rewriting of the problem, the pdf of $X$ is derived as follows (I use a slightly sloppy notation "dx" that stands for an "infinitesimal subset around x"; you can turn it to fully rigorous by writing a Borel set A instead of dx, but I feel this writing with dx gives more feeling of what happens):

$P(X\in dx)=P(X_1\in dx |\, \|X_2-X_1\| $=\frac{P(X_1\in dx)P(X_2\in D(x,r))}{P(\|X_1-X_2\|
hence
$P(X\in dx)=\frac{p_1(x) \int_{D(x,r)}p_2(y)dy}{\int_{\{\|z-y\|
so the pdf is the function on the right hand side.

If $p_2$ is continuous at $x$, the integral at the numerator is close to $p_2(x)\pi r^2$ when $r$ is small. Then, for small $r$, one may say that the pdf $p$ of $X$ is close to $\frac1C p_1(x)p_2(x)$, where $C=\int p_1(y)p_2(y)dy$ (so that $p$ integrates to 1).

I hope this answers your question. Feel free to ask for further details. Or to make your question more specific, if I got it wrong.

3. ## Re: The probability of two random points on a plane being closer than a certain dista

The generated point will be used for Monte Carlo integration of a function that is defined everywhere where $x_1$ can be (e.g. the whole plane). Actually, I can already use $x \equiv x_1$ for the MC integration with PDF $p(x) = p_1(x_1)$. Just that I want to have another sampling strategy that takes $x_1$ only if a random point $x_2$ with PDF $p_2(x_2)$ lands within a distance $r$ of $x_1$.
Therefore, I'm not sure about whether this normalization is needed. Otherwise the nominator looks OK: If I assume that $p_2$ is constant within the $r$-neighborhood around $x_1$, then I can take $p_2(y)$ out of the integral as $p_2(x_2)$ and then I get my result $p_1(x_1) p_2(x_2) \pi r^2$.