Thursday, 30 September 2010

Fermi Problem: The Day The Music Dies

A Fermi Problem, in case you've not heard of one, is a bit of a game really.  It's a riddle in a way, a question that generally asks for a rough estimate to a technically very difficult problem.  You're not expected to be get the right answer, in fact for many problems if you're within a hundred times the right answer then it's pretty good.  Not to be confused with the Fermi Paradox (same Fermi, different quandry) which is related to the existence or otherwise of extra-terrestrial life.

The point is to show your working.  That's the interesting bit, come up with a wild guess, but base it on a few real life factors.

So my problem is this:

Music is finite.  If you're fairly strict about the standard rules of western music and the range of human hearing, then there's only so many combinations of notes.  "All the tunes possible" is a very big, but finite set.

If humans continue writing tunes and expanding at their current rate then when will we have used up all the music?

Obviously, you could just make the tunes longer and longer to get more and more of them, so I'm also going to place a time limit on "All the tunes possible": you've got a maximum tune length of nine minutes forty eight seconds.  If it was good enough for Bat Out Of Hell it's good enough Fermi.

Hit the read more link for my proposed answer...

Wednesday, 29 September 2010

Mice, Chickens, Eggs & Evolution

I'm being out-evolved by something living behind my fridge. We've got a mouse in the flat. It's no big deal, the Old Town of Edinburgh is swarming with the blighters, the place is a six hundred year old labyrinth, bridges have been built over streets, covered up, filled in, tunnelled through, it's a mouse paradise. They're not usually much bother - the bleepy deterrents normally do the job, and on the rare occasions when they get a bit overly courageous we put down poison. No, it's not the kindest method, but it is one of the few that works on Old Town mice, and kinder than those sticky traps.

The mice, however, seem to have got wise to it, the poison doesn't work anymore. Actually, that's not technically accurate. I'm sure the poison still works, the mice just aren't falling for it any more. Not because they know it's poison of course, they don't, the absence of very small toxicology textbooks is all the proof I need of that. They're just not touching the stuff any more. What must have happened is that sometime in the last couple of years there was a community of mice. Most of them liked blue coloured grain, they took it and ate it and died hopefully peaceful deaths from hypothermia. A couple of them didn't. For some reason or another they didn't go for the free food. Maybe it was the smell, maybe the colour, maybe they just didn't like the taste - maybe they're refined mice and expect more presentation than a small plastic tray. For whatever reason, they didn't eat it. So most of the mice died...but a few survived to have baby mice. The baby mice inherited their parents' dislike of the grain we put down, so they don't touch it either, and they have more babies, none of who are partial to warfarin laced wheat.

Nothing has changed except the fact that the humans are a weapon down in the ongoing struggle for Old Town domination. The drugs don't work.

So if anyone doubts evolution, I've got some mice you should meet.

Speaking of evolution, which came first, the chicken or the egg? It's a bloody stupid question. Ever since I was a kid I've hated this one. The fact of the matter is, the egg came first, end of story, argument over, you're very welcome.

Firstly, let's go a little further back. There weren't always chickens. There were dinosaurs, and then there was Archaeopteryx, then there were the proto-chickens. Humans began to domesticate these birds and slowly they crept their way towards full-blown chickenhood. Of course, what constitutes full-blown chickenhood is still up for debate - there's maybe one specific genetic tweak that produces some morphological change that defines a chicken, but the point remains: however you define a chicken, there was a first one.

The first chicken hatched from an egg that was laid by an animal that wasn't a chicken. It was very nearly a chicken, in fact you'd probably need to run a battery of tests to confirm that it wasn't a chicken. This nearly-chicken laid an egg. As is the way with the world, the reproduction from adults to offspring wasn't perfect, there were small glitches in the DNA. Most of them did very little indeed, but in this case there was one tiny error in the strand that made the offspring a little different to anything that went before. It was a chicken, the first in a long, noble and tasty line.

And if the animal that comes out of an egg is a chicken then that egg is a chicken egg by definition. The egg belongs to the animal inside it, and that animal was a chicken.

The egg came first, but it wasn't laid by a chicken. End of discussion, game over, QED.

Sunday, 26 September 2010

Total Eclipse Pt II: The Explanation

So what on earth was the last post all about?  Well, you know how it is.  It's Saturday night, you've had some wine and cheese and pate and olives and suddenly you start having "good" ideas.  Yup, sorry, I was drink-coding.  These things happen.

Whilst researching for an 80's themed fancy dress party I came across a stunning piece of work by Jeannie Harrell, a flow chart that generates a section of Jim Steinman & Bonnie Tyler's cult hit "Total Eclipse Of The Heart".

As this gloriously demonstrates, most songs have a structure, bits repeat.  Total Eclipse does this repeatedly, and as such is ideal for a really silly coding exercise, which (if you're not familiar with PHP) is what all that gibberish does.  It generates the entire song using a mere 2366 characters, rather than the 3050 in the official version from Bonnie Tyler's website (not including whitespace).  That's a 22.4% saving on keyboard wear and tear if you ever need to type the lyrics out on a website.

Bat Out Of Hell should also work quite fact, I'm tempted to compile a league table of songs and how compressible they are....2 Unlimited may well end up near the top...

"Total Eclipse Of The Heart" (Optimised Version)

// TOTAL ECLIPSE OF THE HEART by Steinman & Tyler //
// (Optimised cover version by McGhee & Robbins) //

$short_turn="Turnaround, Every now and then I get a little bit ";
$rabbits="Turnaround bright eyes";
$longturn="$rabbits, Every now and then I fall apart";
$need="And I need you";
$forever="Forever's gonna start tonight<br>";
$time="Once upon a time";
$eclipse="A total eclipse of the heart<br>";

$v1=array("lonely and you're never coming round<br>",
          "tired of listening to the sound of my tears<br>",
          "nervous that the best of all the years have gone by<br>",
          "terrified and then I see the look in your eyes<br>");

for ($i=0;$i<4;$i++){echo $short_turn.$v1[$i];}
echo "$longturn<br>$longturn<br><br>";

$v2=array("restless and I dream of something wild<br>",
          "helpless and I'm lying like a child in your arms<br>",
          "angry and I know I've got to get out and cry<br>",
          "terrified but then I see the look in your eyes<br>");
for ($i=0;$i<4;$i++){echo $short_turn.$v2[$i];}
echo "$longturn<br>$longturn<br>";

$chorus="$need now tonight<br>
    $need more than ever<br>
    And if you only hold me tight<br>
    We'll be holding on forever<br>
    And we'll only be making it right<br>
    Cause we'll never be wrong together<br>
    We can take it to the end of the line<br>
    Your love is like a shadow on me all of the time<br>
    I don't know what to do and I'm always in the dark<br>
    We're living in a powder keg and giving off sparks<br>
    I really need you tonight<br>
    $time I was falling in love<br>
    But now I'm only falling apart<br>
    There's nothing I can do<br>
    $time there was light in my life<br>
    But now there's only love in the dark<br>
    Nothing I can say<br>
echo "<hr>$chorus<hr>";
echo "$rabbits <br>";
$short_turn="Turnaround, Every now and then I know ";

$v3=array("you'll never be the boy you always wanted to be<br>",
          "you'll always be the only boy who wanted me the way that I am<br>",
          "there's no one in the universe as magical and wonderous as you<br>",
          "there's nothing any better and there's nothing that I just wouldn't do<br>");

for ($i=0;$i<4;$i++){echo $short_turn.$v3[$i];}
echo "$longturn<br>$longturn<br><hr>$chorus<hr>";

Sunday, 19 September 2010

How To Destroy The Universe - A Beginners Guide

Firstly, it should be pointed out that destroying the Universe is considered to be a little anti-social in many quarters, and may even be illegal under your local laws.  Please obtain professional legal advice before attempting it.

Secondly, you're not going to need the Large Hadron Collider.  Let's make it clear from the outset: the LHC simply isn't up to the job, and by many, many orders of magnitude.  Using the LHC to do what I'm going to suggest is like trying to set off a nuclear explosion with a small lump of Uranium ore and a toffee hammer, it simply isn't going to happen.

So with the obvious warnings out of the way, how are we going to destroy the entire Universe?  Simply blowing up a star or two isn't going to do it.  In fact, blowing up all the stars isn't going to do it, despite Steven Moffat's best effort in the last season of Doctor Who.  Even if you could make every star go supernova at once, the Universe would still be there...OK, it would be a Universe full of dust and ashes rather that stars, but it would still be there.  We're going to need a much bigger bang.

The bang we're looking for is something called 'vacuum decay', and it has nothing to do with household appliances.  A vacuum, to a physicist, is a rather complicated thing.  It's exactly what you're thinking of - an absence of matter, a space that contains no atoms, no molecules.  In the middle of the last century, however, it became apparent that a vacuum is never really empty, quite the opposite in fact.  A vacuum, even the most perfect one you can imagine, is a bit busy.  There's space and time for starters, and a plethora of 'virtual particles' popping in and out of existence the whole time...on the smallest scales a vacuum is a seething mass of weirdness.

All of this weirdness requires energy - even in particle physics, there's no such thing as a free lunch.  This energy is called, with remarkable clarity and lack of imagination, vacuum energy.  Depending on the theory you use to calculate it, the vacuum energy in a cubic centimetre of space is somewhere between 0.00000000000000000001 Joules and 1x10^107 Joules (a 1 with 107 zeros after it), so it's fairly safe to say there's a certain amount of uncertainty.

(As a point of reference it takes about 35,000 Joules to bring a litre of water to the boil)

Whatever the actual value is, the point is that empty space has energy.  There's no particularly good reason why our Universe has the amount of vacuum energy it does, in fact it could have values far outside our (already uncertain) estimates, and therein lies our method for destroying everything.

Now, not content with throwing some big numbers around, I'm going to drop a graph into the mix as well.  Don't Panic.  If it helps you can think of it as a picture of a rollercoaster.  In fact it will probably help if you do, because I'm going to stick with the analogy.  Here it comes, hold tight....

What this shows is a completely made up graph of the possible amount of vacuum energy in the Universe.  We're the little red dot.  Now, imagine pushing the little red dot to one side or the'll just roll back down to where it started.  Push it a bit harder though, and it'll roll over the peak to the right and settle in a new position in the second, lower dip to the right, and a lot of energy will be released in the process (equal to the difference in height between the two dips).  That's potentially a lot of energy.  If you can push one tiny bit of the Universe, a sphere of just a few hundred metres in diameter, over the peak then it gives off enough energy to push the space around it over the edge, which pushes the space around that over the edge, and you have a bit of a chain reaction on the go. 

The bubble expands at nearly the speed of light, and inside it everything changes.  The very laws of physics, and by association those of chemistry and biology, alter, and not in a good way. could always draw stoic comfort from the possibility that perhaps in the course of time the new vacuum would sustain, if not life as we know it, at least some structures capable of knowing joy. This possibility has now been eliminated. 
Coleman & de Luccia

 Voila, we've destroyed the Universe, at least as far as we currently understand it.  So how do we do it in practice?  Well, we need a very high energy density, something like a very, very big bomb to push it over the edge.  This was one of the "risks" associated with the LHC by people who didn't quite get the numbers (or "twats" as Brian Cox refers to them) - the energy densities created by the LHC are indeed very high, but they're nowhere close to high enough.  How do we know when there's such uncertainty over how much vacuum energy the Universe has?  Well several times a day cosmic rays slam into the Earth's atmosphere with very much the same energy density as the LHC's experiments.  Once a month or so we get hit by a cosmic ray with far higher densities even than that, and every decade or so there's a truly exceptional event which surpasses the LHC by hundreds of times.  None of these events seems to have triggered vacuum decay, after all, we're still here.  (So why have we spent so much on the LHC when nature regularly beats the pants off it?  Well the whole point is, in effect, to take a photo of the event with a very big digital camera, and we never know where and when the natural events will happen.)

Supernova, black holes merging, even gamma ray bursters, the most violent explosions ever observed, have so far failed to tip us over the peak and destroy the Universe, so we're going to have to dream up something else, an even bigger bang.

Which brings us to a curious little post-script, one best illustrated by a quote from Douglas Adams:
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened.
 What if we're in a Universe where vacuum decay has already happened?  From the inside of the bubble it would look very much like a Big Bang....

Thursday, 16 September 2010

Why "Galileo Was Wrong" is not even wrong.

The American based Catholic group Galileo Was Wrong (GWR) has been getting a bit of stick recently, noticeably from Slashdot, for their assertion that the planet Earth is, in fact, at the centre of the Universe.

A tad harsh I reckon.

Not that I believe their standpoint is right, you understand.  Certainly not in the same context, with the heavy religious slant and subtitle of "The Church Was Right".

But there are some interesting ideas here - questioning established facts for one.  A world where people question their own beliefs is a better one, we should all do it more often.  Are you still voting for the same political party out of habit, even though the policies have changed drastically over the decades? Still buying the same toilet roll that was all cutting edge (no unpleasant pun intended) in the 1980s?  Still (and here's the rub) believing in the same god you were told about when you were six?  There's nothing wrong with believing in a god in my book - all of the major theologies freely admit that it's entirely a matter of faith, and science freely admits that the axioms of whichever branch you take are also based on faith, so there's no real argument there.

The point is, look at your old beliefs occasionally, make sure you're up to date.  There's nothing more cringeworthy than holding an old belief...nope, not even finding out that your boss follows your Twitter ramblings ;)

That's what GWR are doing, looking at an old scientific belief, one which has changed drastically in the last few hundred years.  That's the beauty of science, it changes, it relishes the mistakes.  If mistakes aren't made, then science isn't doing its job properly.

Sorry guys: Galileo's work is still the subject of a great many questions, but probably not in the way you're thinking.

Unless the Catholic Church have some top secret 17th Century documents concerning hyperbolic geometry and imaginary numbers then the whole argument is akin to getting in a fizzy over whether the Sun is kind of a yellowish colour. 

The truth is a bit weirder.

If the Big Bang theory is even remotely correct, if the entire observable Universe was once all in the same place, then yes, the Earth is at the centre of it.  All of the constituent particles were at the centre, along with everything else.  Then space expanded.  Every single thing moved away from every other single thing at once.  In essence, the three dimensions were curled into a single dimensionless point, and then they unfurled.  Space came into being, without expanding into anything.  There wasn't any thing to expand into, because there wasn't any space...the three dimensions didn't exist, let alone space.

So everything is still at the centre, the centre's just got bigger.  You are, right now, sitting on top of the exact spot where the Big Bang happened.  So am I.  So are the biscuits in the cupboard, and the bit of the Moon they stuck the flag in, and Uranus, and stop giggling at the back.

The Big Bang happened everywhere.  The entire observable Universe, all of it, is still in exactly the same place it always  It expanded, yes, but it didn't expand into anything.  It's still just here, at the centre, where it always was.

Current physical theory does indeed suggest that the Earth is at the centre of the just defines "centre" in a slightly more interesting and physically real way.  The Church, as quoted by GWR, are missing out on something huge, and that's a pity.  If there is a god, and a good scientist has to accept the concept if not the hypothesis, then he's made a very interesting Universe indeed, and choosing to ignore the whole glory of it all is blasphemy in itself.

As a serendipitous follow-up, my flatmate just told me about Guy Consolmagno, a Vatican astronomer who just happened to be on BBC4 last night (iPlayer - 21:15).  A man with some very interesting views, and proof that GWR are probably far from the only Catholic views on spacetime.