Sunday, July 28, 2013

Slugs

I was walking back from the gym this morning and had just entered a concrete path about 100 metres long which runs the length of a field to the right (figure 1), when I noticed two black slugs about a metre apart crossing the path with a trail of slime behind them.

'How likely is that?' I thought to myself. 'What are the chances of seeing any more?'

In fact there were no more. So what's going on here?

Figure 1 - markings in field are grass, not slugs!
Suppose the slugs are randomly distributed in the field . We imagine the path and field divided into a large number of cells as shown in figure 2 below, each of which may, or most likely not, contain a slug. (We only care about the row of cells along the path which we take to have the same distribution as the adjacent row in the field).

For each row, as we have a large number of cells (n large) and a small probability p of a slug being in any particular cell we can use the Poisson distribution. As we actually observed 2 slugs, our best estimate for the mean, μ = n * p, is 2.

The Poisson distribution calculator tells us that in this case the probability of seeing 3 or more slugs on the path (i.e. given μ = 2 what is  P(x>2 ?) is 32%.

That's way too high for me.

I prefer to reject the null hypothesis that the slugs were randomly distributed and take an alternative, that there was a slug family or cluster down there by the gate and they were crossing in a correlated way :-).

Figure 2

I was rubbish in the gym this morning, BTW. Like Chris Froome, reduced to eating a forbidden energy bar on the Tour de France, I ran out of energy pretty fast and also felt a twinge in my right knee. It was either the humidity (terrible today) or too much Alpen this morning just 90 minutes before I got started!
---
PS. Don't write me notes saying the chat about slugs above muddles the sample spaces - of course it does.

Try this: divide the path into two. In the first 50 metres we had n=50 and two slugs so the Poisson distribution applies as before with μ = 2. Assume the same distribution holds for the second 50 metres (the new sample space). The probability of seeing at least one slug there (according to the calculator)  is more than 86%.

But I didn't. So I think that sees off the random distribution hypothesis!