Wednesday, 8 July 2009

Lottery

Assume that you're an avid lottery player. This particular lottery has slightly different rules to the one we're all familiar with - there still are 49 balls, however you win 10,000 pounds by matching all six numbers. There are no other winning combinations and there is no sharing or splitting of prizes: matching 6 balls gets you 10,000 pounds. Since there are 49 choose 6 = 13 983 816 possible draws you have around a 1 in 10 billion chance of winning with a single ticket.

Question:
A local businessman decides to scam his customers and claims that the largest ball is numbered 25 (i.e. customers may only select the numbers from 1 to 25). He reckons that his tickets will win less and he'll have to pay out less money. He states that his customers are only half as likely to win. Is he right?

Which convention?

The image below shows my application's attempt at assigning tags to political parties during the 2008 Democratic and Republican National Conventions.



Tuesday, 7 July 2009

Hill climbing

The old footballing cliché, "You have to go backwards to go forwards", is a fitting analogy for today's topic: local maxima. I must admit that my only exposure to football strategy was by playing FIFA '95 on the Megadrive, however I think I understand the sentiment - by just running towards the opposing goal you make superficial progress (you are closer to the goal), however you will surely be tackled and lose possession of the ball. If you'd passed it backwards and 'built up play' you might have got further.

In this (admittedly ill researched) example by naively running towards the goal after each pace you end up closer to the goal (exactly one pace closer!), but because you've charged on ahead as soon as you meet an opposing player you will probably lose the ball - you've been 'tricked' by a local maximum. If you'd passed backwards to a team mate you might have had more success and found the global maximum: the ball in the back of the net. The graph below makes this a lot clearer; the blue line represents the path of a player who charges ahead and the red line represents a player who 'builds up play' (it's very clear now that I should have used an analogy that I knew something about).




Other examples include dropping out of school and working in a manure factory: you'll be earning far more than your colleagues at university until they realise their earning potential at which point you'll be stuck under a glass ceiling. The point of this article was not to rubbish the achievements of manure specialists; I'm more interested in situations where we accept these imperfect solutions over the globally optimal solutions. When I go to a particular supermarket I may search for the cheapest bag of sugar; however this is a local minimum because I have not considered the plethora of completing sugar merchants - I've found the cheapest sugar within my local search space.

There is, of course, a cost associated with a more extensive search for cheap sugar: car miles, bus fares, wasted time, opportunity costs etc. My GCSE Economics textbook split products into two categories: comparison and convenience goods. We're happy to shop around for high-price infrequently purchased goods because the cost of the search is only a fraction of the cost of the product whereas for convenience goods, such as the sugar, it's not worth the hassle. So we're willing to accept the local minimum as being 'good enough' (a behaviour known as bounded rationality).

So the conclusion of today's post is that it's ok to accept a local minimum/maximum as long as you remember that there's probably a better solution still to find.

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'.