Probability N points in range I have looked for an answer to this problem but I didn't find any.
Apologies if my language is not at the level of this exchange.
In my project, I deal with cells (imagine points of different colors) with coordinates x and y. These cells have different types and they are distributed on a surface.
I am measuring three quantities.
Let's assume we have a square surface of side $L$.  We have $N$ points of type $A$ randomly distributes on this surface, and also $K$ points of type $B$ also randomly distributed on this surface.  We can assume these points to be circular, with radius $r_c$ << L and $r_c$ < D (definition of D follows).
I define the function $S(A, D)$ that gives the number of points "B" at a distance lower than "D" from a point A (so, it's really like looking at how many points fall in the circle centered in point of type A with radius "D").
The first measure is:
$$ M_{sum} =  \sum_{i=1}^N S(A_i, D) $$
The second measure is very similar, it's the average:
$$ M_{avr} =  \frac{1}{N} \sum_{i=1}^N S(A_i, D) $$
For the third measure, I need another function, called $V$.
$$
  V(A, D) =
\begin{cases}
1,  & \text{if $S(A,D)>0$} \\
0, & \text{if $S(A,D)=0$}
\end{cases}
$$
The measure is:
$$ M_{neig}=\frac{1}{N} \sum_{i=1}^N V(A_i,D)$$
The problem is the following.  I need to see if there are any significant differences in my data from a random distribution.
So, is there a way to estimate the expected values for these quantities?

The average number of B cells within D of an A cell will be
$$M_{avg}\approx \frac{K\pi D^2}{L^2}$$
The proportion of A cells within reach of at least one B cell will be
$$M_{neig}\approx1-\left(1-\frac{\pi D^2}{L^2}\right)^K$$
There are about $\frac{\pi D^2}{\pi r_c^2}$ cells in the circle.  I think $M_{avg}$ stays about the same, but $$M_{neig}\approx1-\frac{(L^2-\pi D^2)/(\pi r_c^2)\choose K}{(L^2)/(\pi r_c^2)\choose K}$$
