-1

Note: I'm not familiar with a lot of mathematical terminology, so please excuse any misuses. I'd also make a request to use simpler language (if possible) in an answer

What I'm seeking is similar to this question, but instead of expected distance I'm looking for a probability function.

I'm potentially also looking for an equivalent within 2D space (line replaced with a circle of the line's diameter)

acki02
  • 101
  • 2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 22 '23 at 19:04
  • 2
    This Bot is stupid : your question is clear but there is a big issue in it : how do you define $n$ points distributed uniformly on a line ? – Jean Marie May 22 '23 at 19:16
  • Is this your question: "Consider a fixed point $p$ on a given line (segment) and a set of $N$ points drawn uniformly at random from that line (segment)? What is the probability distribution of the distance of $p$ closest to it among those $N$ points?" – sudeep5221 May 22 '23 at 19:31
  • @sudeep5221 Unless I understand your interpretation incorrectly, then yes, that would be my question. – acki02 May 22 '23 at 19:54

2 Answers2

1

I understand the problem as this: I draw a point at random uniformly inside the segment $[0,1]$. I draw another $n-1$ points (also uniform and independent). Let $D$ be the distance from our point to the nearest neighbour. Find the probability density of $D$.

$$P(D\ge d|X=x) = ( \max(x - d,0) + \max(1-x-d,0) )^{n-1}=\\ \left(\frac12 -d +\frac{|x-d|+|1-x-d|}{2}\right)^{n-1} \tag 1$$

Hence $$P(D\ge d) = \int_{0}^1 P(D\ge d|X=x) dx \tag 2$$

This is messy to evaluate. For large $n$, you can assume

$$P(D\ge d|X=x) \approx (1 -2d)^{n-1} = P(D\ge d) \tag 3$$

for $0<d<1/2$ Hence the probability density of the nearest distance is given by $$f_D(d) \approx 2(n-1) (1-2d)^{n-2} \tag 4$$

enter image description here

This gives an expected value of $E[D]=\frac{1}{ 2 n}$ (in agreement with this answer)

leonbloy
  • 63,430
-1

If $x$ and $y$ are drawn independently from a UniformDistribution[0,1], the distribution of absolute distance $z = |x-y|$ is $p(z) = 2- 2z$:

enter image description here

The expected distance is $\int\limits_{z=0}^1 z (2 - 2 z)\ dz = 1/3$.