Wednesday, 1 April 2009

The curious incident of the dog in the night-time

Reading through the Memoirs of Sherlock Holmes I stumbled upon some reasoning that I had been shown years ago but had since forgotten: the curious incident of the dog in the night-time. Sherlock Holmes and a Detective are investigating the night-time theft of a horse from a stable guarded by a dog.

Detective: "Is there any other point to which you would wish to draw my attention?"
Holmes: "To the curious incident of the dog in the night-time."
Detective: "The dog did nothing in the night-time."
Holmes: "That was the curious incident."

Holmes later explains: 'the dog made no noise because no stranger was there [...] Obviously the midnight visitor was someone whom the dog knew well'.  I often wonder how many of us (non-fictional) people would be capable of such an inference.   

Returning to previous posts' themes: we must make decisions every day and each of those are not usually subject to detailed scrutiny.  Our decisions are based on incomplete information and very brief and/or superficial inferences in complicated domains.  We are certainly good at detecting when things are 'wrong' in the real world.  If one day you were placed into a Truman Show-esque fake world you may for many months be taken in by the illusion, however, it would take only one slip: a lighting fixture falling from the sky,  a badger with an antenna, a problem rendering the sunrise etc. to rip the illusion from your consciousness. 

I'm sure our ability to be accept a reality until we see something unusual is an evolutionary trait.  The asymmetry in our reactions to the usual versus the unusual exists to counter the asymmetry in the outcomes: mistaking a harmless event (an oddly-shaped shadow) and running in fear has little cost whereas missing the shadow of a hungry dinosaur results in a mauling. 

The problem is that many interactions in the modern virtual world don't evoke reactions even a fraction as strong as seeing a scary face in an  odd-shaped shadow might.  Granted, the cost of making a mistake isn't as high when compared trials of our animalistic ancestors (the internet can't kill you!) but there are still harsh consequences, as the many people who give their life savings to email scammers will attest.  It's not just on the internet: it occurs in all aspects of modern life - irrationally I find it easier to put the 3.50 for coffee and a croissant on my (debit) card than handing over the equivalent cash.

So with all blog posts I have to have a conclusion.  Sherlock had it easy, he was operating within a domain of which he had full understanding, I don't think he'd fare so well in the modern world.

Friday, 27 March 2009

United we tag

A depth first and pruned 3D rendering of the tags similar to 'obama'.   The video should be embedded below, if it is not then it can be found here.

Thursday, 26 March 2009

Mockneys

This post was originally published in 2006 and was lost when my disk crashed.

The Metropolitan Police, Linguistics Division are today on the hunt for a number of dangerous criminals. Raids are expected all over London as the Police crack down on the fake accents of celebrities. Suspects include:
  • Vernon Kay for his attempts to convince people he really is from Bolton.
  • Jamie Oliver for his mockney twitter.
  • Russell Brand for his Elizabethan tone which leaves the young women he bogarts* in a dazed and confused state.
  • and finally Sir Alan Sugar who is alleged to have use voice enhancing drugs during filming of The Apprentice to ensure his accent is as cockney as the day he first started out selling shoe laces on the streets of Hackney.
*bogart (verb) To keep something all for oneself, thus depriving anyone else of having any. The act of persuing a woman through charm, sharp suits and expensive dinners.

Wednesday, 25 March 2009

The Formula Formula

London, UK. Scientists have finally uncovered one of the most elusive secrets of modern tabloid journalism: the so-called 'formula formula'.

The editor of 'Super News Celebrity Fun' explains: 'picture the scene: it's 11PM on a Monday. The final copy is due in 20 minutes and there's still half a page unfilled because the pullout 'grow your own clothes' ran under-length. Our only recourse is to ring some media-friendly pseudo-scientists for a 'madcap boffin formula' that renders some banal aspect of everyday life in nauseatingly pedantic mathematics. Recent 'successes' include 'duncability analysis' and the 'Brittany Spears Ratio'.

'Duncability' is an approximated count of the number of biscuits that can be 'dunked' into the unit cup of coffee before the unit research group runs out of funding. The formula is complicated but elegant:

Dunkability = mu / gamma + 2 * phi.

Where mu is the number of biscuits in a packet, gamma is the mass of the earth divided by its angular momentum and phi is very complicated, you probably wouldn't understand.

'The problem', sighed the editor, 'is that with this whole credit crunch thing going on it's a lot harder to get enough junk science to fill our pages'. It is for this reason that interest in the 'formula formula' has peaked.

The 'formula formula' is a formula that generates all manner of nonsense formulae (a meta-formula) without the need for a misguided research group.  The formula formula is imprecise and is more a recipe for creating further nonsense than an actual formula.  The most important aspect of the guide dictates that subject of the research must be able to be prefixed with 'formula for the perfect ...', e.g. 'toast, woman, haircut, etc.'. The second key ingredient is plenty of Greek letters, these summon up images of bearded men (and women) of science in white coats, lending the formula an air of credibility. If this isn't sufficient simply replace every instance of 'scientist' and of 'researcher' with 'boffin'.




The final ingredient is to ensure that you use language that completely alienates the reader from scientific enquiry for themselves. If you are to televise your formula ensure that the narrator is standing in front of a blackboard with as many wave equations as you can muster.   For larger 'feature' length articles  include a picture like the one to the right.

Next week: 'knit yourself thin'.

Tuesday, 24 March 2009

Pirates

Inspired by the exploits of Somali pirates, local pirates off the cost of Southampton have gone one further and stolen one square mile of the English Channel.

The coastguard has advised sailors to avoid the affected area which is located twenty miles due South North South of the Isle of Dogs (becoming cyclonic). It is thought than in an audacious heist pirates pumped the precious salt-water 200 miles inland into an evil network of disused swimming pools, leaving a gap as wide as it is fat.

This is not the first the high seas have been stolen, in 1998 two youths stole some of the Atlantic and part of the Thames. If anyone has seen the Seine or any of the Channel Islands they are advised to contact their MP.

Monday, 23 March 2009

In abstract

After hearing the story of the Black Swan it is impossible not to feel (at least slightly) smug.   As programmers, however, we often have to deal with objects from the 'real world', (which to remind people that we are sort-of scientists,  we call 'the problem domain', or if we're sitting opposite a logician: the 'domain of discourse').

Nomenclature aside, it is often our task to build a model of the real world, a world about which we do not have complete information.   A model (my CS inspired definition) is really just the result of taking salient features of the real world and representing them in a way that is suitable for a computer to do something useful with.  If you hang around with enough programmers for long enough the word 'abstraction' will rear its head, which (at least on my blog) is a synonym for the act of modelling.

Modelling (or abstraction) is favoured by programmers because it allows great swathes of the real world to be captured by very little code.  Imagine you are building a till/checkout system for a supermarket, which to reduce the size of this post, contains only 3 items:
  1. bread
  2. milk 
  3. the guardian
Let us implement this as naively as possible:
  • scan bread, add £1.10 to the bill, display total on screen
  • scan milk, add £0.90 to the bill, display total on screen
  • scan the guardian, add £0.70 to the bill, display total on screen
The problem with this code is that we're treating every item with too much reverence.  For every extra item we add to the shop (a fine cheese for example) we'd have to add some more code.   We don't really care about the specifics of each item, all we care about is their price.   By treating the goods of the supermarket as  'priced products' we can simplify the logic:  (although unrealistic, we will assume the price is encoded in the barcode):
  • scan priced product X, convert barcode to price, display total.
If you've ever received junk mail you can be sure it was generated by treating all 'customers' as 'named addressable units', not as the unique individuals all my readers inevitably are.  Back to our example, the shopkeeper has been adding extra products to his store without need to update any software until one day he decides to add a 'pick and mix' counter.  His 'pick and mix' bags have a barcode, but the price is determined by the bag's weight, not just the barcode.  

To fix this we have to add an exception or specialisation:
  • if product is 'pick and mix' weigh product, calculate price times weight, display total
  • else scan priced product X, convert barcode to price, display total 
I'd hoped this post would lead nicely into an overview of default reasoning, where we accept a default argument (the price of an item is determined by its barcode) unless we have further information (the item 'pick and mix' and should be weighed) but I have had more fun writing about a fictitious supermarket.   Sorry!

Transport

The government announced today that the District Line is to join the long list of National Parks. The line was selected primarily for its proximity to central London, but its serenity and tranquilly were all key to its selection. Inspectors OHMNPATF (On Her Majesty's National Park Acquisition Task Force) rejected both the Central and Piccadilly lines noting that moving trains presented a significant risk to picnicking families. It is expected that Earl's Court station will be repurposed; creating a two storey cafe and visitors' centre. Holborn station will return to its pre-war role as an owl sanctuary. Entry to the park will cost 1.50 per badger and the park opens from 6AM to 12PM closing briefly at 8AM to allow the 08:01 to Uxbridge to settle just outside Earl's Court. Commuters are advised not to add any extra time to complete their journey.