Monday, 2 March 2009

What should we know?

I decided a while ago that I didn't want this blog to be a bad science blog. There are plenty of those, I really like them but as the market's a little swamped I thought I'd just talk about stat-mech and hope that someone thinks it's interesting as well. Last weekend, however, I went to a talk by Ben Goldacre in Bath and so these things were brought to mind.

The thrust of the talk was that we, the public, are being misled and lied to by the media when it comes to science. He has compelling examples whereby the media would print unpublished stories from a discredited scientist but ignore several published articles that say the opposite. These examples are clear cut, the media are willing to lie for a good story. Even a well educated member of the public has no chance if information is being withheld.

What if it's less clean cut? Could the blame be shared in some cases? Take this story, the Durham fish oil trial (also mentioned in the talk, I don't have anything new). Uncritically reported by the media this "trial" had no control group, no predefined measure of success and more than a whiff that they knew what the outcome would be before it started. I need go no further describing it. The reasons why this "trial" was of zero scientific value are laid bare for anyone to see. The problem when one accepts what the article is saying (trial will prove fish oil works) without asking the huge question "where the hell's the control group?".

Anyone can ask this question. I expect people to ask this question. The concept of a control group is not difficult and everyone should understand it. In fact a full double blind trial is also easy to understand even if you didn't expect it to be necessary. There are certain things that I believe we should all just know about. Some good starting ones would be
  1. Double blind trials. For me I wouldn't have guessed they need to be double blinded, it's great that scientists don't exclude themselves from ruining their own experiments.
  2. Statistical significance. Small scale experiments can be good, but you need to be able to say when things could have been chance.
  3. Pattern recognition. Related to significance. People are pattern recognition machines, we see things where they are not.
If you ask questions about these things then it'll be a lot harder to slip things past you. If not, you can be taken for a ride. There are few other areas of our lives where we leave ourselves so open to abuse. None of these things are too difficult to understand. It's certainly easier than buying a car...

Anyway, back to physics next time. There's lots I want people to know about physics but that's another fight for another time.

Friday, 20 February 2009

Entropy

I've been meaning to post something interesting about stat-mech about once a fortnight and so far I'm not doing so well. For today I thought I'd share my perspective on entropy.

If you ask the (educated) person in the street what entropy is they might say something like "it's a measure of disorder". This is not a bad description, although it's not exactly how I think about it. As a statistical mechanition I tend to think of entropy in a slightly different way to say, my Dad. He's an engineer and as such he thinks of entropy more in terms of the second law of thermodynamics. This is also a good way of thinking about it, but here's mine.

Consider two pictures, I can't be bothered making them (EDIT: see this post, the T=2,3 pictures) so you can just imagine them. First imagine a frozen image of the static on your television, and secondly imagine a white screen. On the basis of the disorder description you might say that the static, looking more disordered, has a higher entropy. However, this is not the case. These are just pictures, and there is one of each, so who is to say which is more disordered?

Entropy does not apply to single pictures, it applies to 'states'. A state, in the thermodynamic sense, is a group of pictures that share some property. So for the static we'll say that the property is that there are roughly as many white pixels as black pixels with no significant correlations and for the white screen we'll say it's all pixels the same colour. The entropy of a state is the number of pictures (strictly it's proportional to the logarithm of this) that fit its description.

For our blank screen it's easy, there are only two pictures, all black or all white. For the static there are a bewildering number of pictures that fit the description. So many that you'll never see the same screen of static twice, for a standard 720x480 screen it'll be something like 10 to the power 100,000*.

So it's the disordered state, all those pictures of static that look roughly the same, that has the high entropy. If we assume that each pixel at any time is randomly (and independently) black or white, then it's clear why you never see a white screen in the static - it's simply out gunned by the stupidly large number of jumbled up screens.

In a similar way a liquid has a higher entropy than a crystal (most of the time, there is one exception), there are more ways for a load of jumbled up particles to look like a liquid than the structured, ordered crystal. So why then does water freeze? This, as you might guess, comes down to energy.

Water molecules like to line up in a particular way that lowers their energy. When temperature is low then energy is the most important thing and the particles will align on a macroscopic scale to make ice. When temperature is high entropy becomes more important, those nice crystalline configurations are washed out by the shear number of liquid configurations.

And this is essentially why matter exists in different phases, it's a constant battle between entropy and energy and depending which wins we will see very different results.

I'll try and update with some links to better descriptions soon.

*this number is only as accurate as my bad definition of the disordered state.

Monday, 12 January 2009

Busy Bees

The second installment of Swarm was on BBC 1 last night, I missed the first one but I highly recommend catching this before it goes off iPlayer.

The best bit was the fire ants making an ant raft to escape flooding. Ants are ridiculous.  They also had bees trying to decide where to make a new home.  The scouter bees come back with reports on possible locations, conveying the message with a dance. All the scouters sell their location and the others decide who to follow. When one of them gets enough support then they all up sticks and move - pretty smart.

On the same theme, I was at a talk recently about consensus decisions in sticklebacks. Apparently they're very reproducible in experimental terms. Again, they have to make a decision, this time about which way to swim. On their own they make the good decision the majority of the time (say 60%) but when they're in a group the almost always get it right. Each fish is pretty stupid, the group is less stupid.

I love problems like this because, while it is a biology problem, it's simple units (fish, ants, bees) that can interact with their peers in some measurable way (well, if you're really clever and patient it's measurable). From this emerges surprising a complex behaviour that didn't exist with the individual - that's what statistical mechanics is all about.

Critical-point post is still delayed, when you're debugging code at work all day it's hard to feel motivated to come home and do the same thing. It's coming though.

UPDATE: Just seen part one, those starlings are badass. They look like drops of liquid, just wait until I get my MD code working and I'm going to be simulating me some birds! (not in the weird science sense, although that would be cool as well).

Sunday, 14 December 2008

Out of place



This was in Bath Physics Department, seems a bit out of place...

In other news there's a bug in the Ising model code which means I'm getting rather beautiful squares appearing across the system. I can't remember the last time I coded something that wasn't riddled with bugs.

Sunday, 23 November 2008

Scientists are possibly a little obsessive

I'm feeling pretty smug tonight because I finally managed to implement a new way of simulating the Ising model that I'd been thinking about off and on for years. At the same time I'm also feeling a bit sad that I've stayed up until 3am on a Saturday night doing it. I think it's the element of obsessive scientist that comes out occasionally where you have a tea/coffee fueled binge until you've solved the problem - it's probably not limited to scientists.

The reason I wanted to do this will become clear soon (as in I'll post on it). I wanted to simulate a lattice with as many sites as possible so that I can do some visualisation of renormalisation group ideas (again more on this soon). Instead of storing each site inside a byte of memory I store 8 sites in each byte and then use a bit of binary operating to get the bit I need. This means each site now only takes one bit of memory.

That was the easy bit. The hard bit was simulating this setup around the critical point. Critical points in statistical mechanics are incredibly interesting but real buggers to simulate. Fortunately there have been some very clever people who have worked out how to do this. I've not done anything that clever, but I have worked out how to implement a Wolff cluster algorithm using ~ N/4 bytes of memory which I think is good going.

I will post on this again when I've managed to run the programme on our fancy new computer (it's got 8GB of RAM) and have a nice picture to show. I will also explain what the Ising model is and what a critical point is...

Sunday, 16 November 2008

Viva and Backup update

I thought I'd return to backups briefly and say how I was getting on with some of the web based ones. Initially I was using Mozy but after some problems with the software I uninstalled it. I'm too impatient to fix problems with this sort of programme so I ditched it. Live mesh, on the other hand, just worked. I have to say I'm getting on well with it. I don't really have a lot to say about it except that it's relatively unobtrusive and I don't think it's slowing the computer down too much.

In other news I passed my viva! Hopefully this means I can start talking about statistical physics more which is sort of what I wanted to do with this blog in the first place.

Thursday, 6 November 2008

Backups

I'm pretty much backup obsessed. Of all the obessions you can have this is probably quite healthy. For example I wish I was a bit more exercise obsessed but what can you do? It's staggering how many people still don't think about backup despite the fact that they switched all their photos and music over to their PC years ago. One hard disk failure and you're buggered - and they fail depressingly often.

At work I've been using this rsync system for years. It's great, I never have to think about it but every day any new work is saved and you can track changes for as long as you like. Unfortunately I could never get this to work in Windows (through cygwin), I think it's a file system thing. Apple introduced Time Machine with their latest version of OS X. This is exactly the same system but packaged up in the neat Apple way as you'd expect. I haven't got this working on remote servers yet but I'll update if I do.

At home I'm still stuck with Windows XP (see earlier posts on why I won't switch to Linux) and I have an external hard drive. I'd really like something like Time Machine but at the moment I have to copy everything each time I backup - this is far from ideal. The simplest, and most effective, long term backup is still to post a DVD to your parents or a friend. It's cheap and it's off-site. The trouble with these last two (my current home setup) is that if my hard drive goes down I'll still lose 2-4 weeks worth of data as I can only be bothered backing up about once a month. Fortunately there is a new (new to me) solution brewing in the clouds.

It seems that storage is becoming sufficiently cheap that companies can now offer large amounts of online space for free. After reading this page I checked out a few of their recommendations. Initially Mozy looked really good but I didn't get on too well with the software so I moved to Microsoft's "Live Mesh". I have to say Microsoft appear to have knocked it out of the park with this one. I already had a hotmail account so setting it up was a breeze. Once it's installed you can just drag whatever folders you want to synchronise with the mesh. After that you just leave it in the background and it quietly makes sure you're files are synchronised. Seems to work well, I'll let you know how it goes.

This is more meant for synching files than it is backup but it obviously serves both purposes. I'm looking to use these kinds of service to fill in the month-6 month backup gap. I'll still use more traditional methods for older stuff. These systems all seem a bit early days and no doubt will improve with time, it's definitely a move in the right direction though.

If I could afford it I'd get a new mac £950 and a time capsule £200. But I can't. Damn expensive Apples. There are other network hard drive options though so that's worth keeping an eye on. Oh, and don't forget the ultimate. Despite being backed up on three computers I still emailed my thesis to my gmail account as soon as it was finished!