Just an addendum to the previous post...

I was curious to see how being close to an edge would affect the
distance to the nearest neighboring point.  One would expect that, with
the direction to the nearest point restricted -- allowing fewer chances
for close points -- that the nearest neighbor would be farther away than
for a centrally located point.  Indeed, that is the case.

I chose a point actually ON an edge of the square, but in the middle --
that is, away from the two edges on either side.  This is essentially
the same calculation as before, except forcing all the other points to
be on one side of the selected point, instead of all around it.

The distance to the nearest neighbor turns out to be greater by a factor
of sqrt(2) than for a point with neighbors all around it.  Thus, for a
point on the edge of the square (but far enough away from the edges on
either side so that they don't also restrict the solution), the formula
for large N turns out to be...

   [L*sqrt(2)]/[2*sqrt(N)] or L/[sqrt(2*N)]

When not simplified for large N, the formula is...

   [L/sqrt(2)]*[G(N)/G(N+0.5)], where G() is the Gamma Function

Both in this situation and with the "centrally located" point, this
latter formula can be used regardless of the size of N.  That is, it is
valid even for N=2, as long as you assume that the selected point is
away from the edges that it is supposed to be away from, according to
assumptions.

Interestingly enough, however, the "simplified" formula is only about 6%
off at N=2, and only 0.6% off at N=20 (indicating distances smaller than
they are).  So it doesn't do too bad.

--
T. Arthur Wheeler
MathCraft Consulting
Columbus, OH 43017



"MathCraft Consulting" <[EMAIL PROTECTED]> wrote in message
rKPR6.172425$[EMAIL PROTECTED]">news:rKPR6.172425$[EMAIL PROTECTED]...
> "Sumeet Dua" <[EMAIL PROTECTED]> wrote in message
> Z3eR6.22973$[EMAIL PROTECTED]">news:Z3eR6.22973$[EMAIL PROTECTED]...
> > Maybe this helps. If the radius of the set of points is r , and
> assuming
> > random distribution of points.
> > The average shortest distance between points in r/(2*sqrt(n)).
>
>
> This formula appears to be off by a factor of sqrt(pi).  I have
> calculated the formula directly (and have RE-checked both the
underlying
> logic and the calculation itself several times), and have arrived
at...
>
>     [r*sqrt(pi)]/[2*sqrt(N)]
>
> In the case of a square with sides of length L -- instead of a circle
> with radius r -- the formula would then be...
>
>     L/[2*sqrt(N)]
>
> It is worth noting that both of these formulas depend upon the
> assumption of large N.
>
> These two formulas are equivalent.  All that has happened is that the
> circle area pi*r^2 has been replaced by the square area L^2, so that L
=
> r*sqrt(pi).  This is valid in this case because of the reasons listed
> below, which apply for large N.
>
> What the large N assumption does for us is:
>
> 1) Large N lets us ignore the situation in which a randomly selected
> point is too close to an edge of the square (or whatever shape) so the
> direction to the nearest neighboring point might be restricted.  Such
a
> situation will have a neglible probability for large N.
>
> 2) Large N lets us ignore the shape of the area containing the
points --
> so
> it doesn't matter whether it's a square, a circle, or whatever.
>
> 3) Large N lets us simplify the resulting formula.
>
> With these considerations, the calculation can assume that the
"randomly
> selected point" is at the center of a large circle.  This is okay
> because, by the time the distance from the point gets large enough for
> the actual shape to matter, the probability associated with the
nearest
> neighbor being that far away is neglible (given the large N), so its
> contribution to the integral for the expected value is also
negligible.
>
> NOTE: If we want to know the average distance to the nearest neighbor
> for a centrally located point, instead of a randomly selected one, we
> don't need to depend upon large N in an absolute sense (as the above
> formulas do).  We only need a RELATIVELY large N.  That is, N need
only
> be large enough to ensure that the expected distance to the nearest
> neighbor is small compared to the distance to an edge.  In that case,
we
> may not want to use the simplified formula that depends upon large N.
> Instead, we can use...
>
>    (L/2)*[G(N)/G(N+0.5)], where G() is the Gamma Function.
>
> This formula simplifies to the previous formula for large N.
>
> --
> T. Arthur Wheeler
> MathCraft Consulting
> Columbus, OH 43017
>
>
> >
> > "John Garber" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I am looking for a solution of the following problem:
> > > Assume a square area with sides of length L. N points are randomly
> > distributed
> > >  within area. The location of each point is independent of other
> points.
> > > The location of a point is a uniform random variable - a point is
> > > equally likely to be anywhere within the square.
> > >
> > > Find the expected value of the distance from a randomly selected
> > > point to its nearest neighbor.
> > >
> > > Thanks, John Gerber
> >
> >
>
>
>
>




=================================================================
Instructions for joining and leaving this list and remarks about
the problem of INAPPROPRIATE MESSAGES are available at
                  http://jse.stat.ncsu.edu/
=================================================================

Reply via email to