I have a finite and discrete 1D chain (edit: linear chain, i.e. a straight line) of atoms, with unit separation, with a set number of impurities randomly distributed in the place of these atoms in the system. What I would like to do is describe the separation between neighbouring impurities (call it "D" which will always be an integer) statistically, and also to work out the average separation .
For example, the plot below was calculated from several thousand simulations of a chain of length 200 atoms and 10 impurities where the y-axis is the probability $P(D)$ of finding an impurity at distance D, and the x-axis is nearest impurity distance $D$. It kind of looks like a Poisson distributon, which one would expect since the system is discrete and random and a kind of counting exercise, but it doesn't work to well as a fit to the data points. It has been a long time since I did any statistics so I'm not sure how to start expressing what I found mathematically. Since I know the system length ($L = 200$) and the number of impurities ($N_i$) is a fair starting point the impurity density $\rho = N_i/L$ ?
EDIT: The chain isn't allowed to self-intersect, it's a straight line in each case. The system I'm using above is a straight line of 200 evenly spaced atoms, and I'm distributing 10 impurities in the place of random atoms (e.g. at sites 4, 11, 54,...so there are still discrete steps between sites). The graph above is the result of finding the spacings between these impurity sites.
EDIT 2: Attached a picture at the top
EDIT 3: Okay so it seems it could be my PRNG code causing problems. I'm using Fortran 95, here is the code:
`CALL RANDOM_SEED(size = n) ALLOCATE(seed(n)) CALL SYSTEM_CLOCK(COUNT=clock) !!! intentionally slows it down to prevent succesive calls from returning the same number do i = 1 , 1000000 end do seed = clock + 37 * (/ (i - 1, i = 1, n) /) CALL RANDOM_SEED(PUT = seed) call random_number(x)`
EDIT 4!: Repeated this for a system size of 50 with 3 impurities (10,000 iterations), fitted a geometric distribution to it, as one can see immediately there is a huge variation. Is this explained by the fact for small n and L when we go from our first impurity (at site j) the probabilities to find the next impurity change drastically since effectively we are now looking for a system with n=2 and L= 50-j, which would be really sensitive to the location of the first impurity hence the huge variation. When we go to a huge system we can essentially treat the remainder of the chain as still being really long, and n and L are pretty much unchanged so this effect is masked and we see a geometric distribution arise? EDIT 5: Just did a bit of reading around Bernoulli Trials, is what I'm seeing and describing a binomial distribution hence the peak I see with smaller systems? Still that wouldn't explain why my 200 system is different from Ilmari's below...