Category Archives: Biology

Graph of flies in a house

Flies in Houses

Another twitter science question. Morena Baccarin (@missmorenab) recently posted:

Flies always find a way INTO your house but never OUT. Ugh! (source)

to which Patrick McAvoy (aka @stamponbunnies) said:

That’s because like Mac users, flies don’t understand Windows. (source)

Let’s put aside the funny for a moment. There is an element of truth here, I’d thought I’d simulate it.

Let’s imagine a situation with 100 flies immediately outside the house, randomly hitting windows/doors etc, and no flies inside. Let’s say that in each time interval, there is a 3% chance a fly will go from being an outside fly to an inside fly (or vice versa). As all the flies are outside and none inside, this means that a fly is more likely to fly in than out. As the number of flies inside grows, some start to leave. The number of flies stabilise when the number leaving is the same as the number arriving.

In the simple simulation, stability occurs when 50 flies are inside, and 50 outside – i.e. when the number of flies matches inside and out.

This simulation really refers to ‘fly density’ rather than number – and I’ve assumed a fly is just as likely to enter as to leave. In practice, flies may be more likely to fly toward light, or toward food etc, so this’d make the stable position different. Swatting will upset the balance for a while, but those flies will be replaced unless you shut the window.

In short, it matters not what the chance of a fly coming through your window is exactly, the number will stabilise – even if you swat them. If there are none inside, some will come in. If there are some inside, they will leave, but others arrive. It’s not necessary to assume that the flies came in deliberately and can’t leave, only that they are randomly moving. Of course, none of this proves that the flies aren’t doing it on purpose….

Graph of flies in a house

Note, random fluctuations will happen – but it stabilises (in this simulation) at 50/50. Changing the probability affects how long it takes to stabilise (about 40-50 time periods for 3%), but not the values at which it stabilises.

The only probability which gives no flies inside is 0% – a hermetically sealed house.

Note, with real flies, if the probability of entering the house is low, then night may fall before the stable condition is reached, killing off the flies inside, thus giving fewer flies inside than average fly density would suggest.

Also, in reality it is often true that outsides are bigger than insides. Therefore the outside fly density won’t drop in any significant way.

My table of data is shown in the full post

Happy Birthday, Darwin!

Today is the 200th anniversary of the birth of Charles Darwin. Darwin is, of course, known for the theory of evolution.

Sadly, this is still dismissed as ‘just a theory’ by people who don’t understand the nature of science, in that everything in science is ‘just a theory’. Scientists produce theories which are tested against reality. If the theory fails, and no confounding factors can explain the issue, it is wrong. If the theory passes the test then that test is a confirming instance, but in no branch of science can you say that a theory is ‘true’.

Evolution has been tested against reality and has not been falsified. Yes, it’s a ‘just a theory’, but then, so is quantum mechanics, and that is fundamental to the design of the microchips in the very device which you are using to read this text.

Like quantum mechanics, evolution is a theory with great predictive power. It isn’t simply a ‘just so’ story, it helps us to predict and explain what happens if we stop to use antibiotics before we kill off all of the infection – the bacteria that are left were the more resistant ones, and so when they reproduce the average resistance to bacteria is greater. This is one reason why your doctor shouldn’t prescribe you with antibiotics if you have a cold (as the cold virus is not susceptible to antibiotics, and using the antibiotics increases the selection pressure on bacteria, thus bringing forward the day when the antibiotic is no longer useful).

Evolution helps to explain phenomena as diverse as extravagant plumage displays, cooperation and self-sacrifice in animals (‘good of the species’ if not a good interpretation, the basic unit of selection is the genome), eyes, the vestigial organs like male nipples (see link, number 2), orchids that have parts attractive to bees and so on. (Note that discovering that the appendix has some function, for instance, does not disprove evolution, it has removed one of many pieces of evidence. That is all).

Wikipedia has an article on evidence for common descent (i.e. that what are now different species shared a common ancestor) and of evolution – though be aware that these pages could be a target for vandalism from creationists. I can highly recommend The Selfish Gene. It is worth getting a later edition as they contain appendices providing answers to questions readers raised in earlier editions, so if you’re ready the book and think ‘Ah, what about xxxxx’? There is usually a response. Similarly,
The Blind Watchmaker is also a good read.

I do think that these are books which even a fervent Creationist should read – if you are going to argue against something, it is important that you know what you’re arguing.

There are lots of examples at the Berkeley site, I quite like ‘Survival of the Sneakiest