### Interpoint distances for two colours of points

Suppose red points form a one-dimensional Poisson spatial process
with density λ_{r}. Suppose blue points are distributed
similarly and independently with density λ_{b}.
In the figure, λ_{r}=1 and λ_{b}=1.5.

What is the probability that two neighbouring points are the same or
different colours?

Let r,b be the interpoint distance between red and blue points
respectively. These RVs have pdf
exp(-r/λ_{r})/λ_{r} and
exp(-b/λ_{b})/λ_{b}.
Let λ=λ_{r}+λ_{b}.
The difference d=r-b thus has pdf (here [] is the indicator function)

(exp(-d/λ_{r})[d≥0]+exp(d/λ_{b})[d<0])/λ.

Integrating this, we get the simple final result: if I am a red point,
my nearest neighbour on the right is blue if d>0, and
Prob[d>0]=λ_{r}/λ.

Therefore

Prob[two neighbours are of different colours]

=Prob[red]Prob[neighbour blue]+Prob[blue]Prob[neighbour red]

=(λ_{r}/λ)λ_{r}/λ+
(λ_{b}/λ)λ_{b}/λ