Wednesday, May 5, 2010

Permanent link to archive for Wednesday, May 5, 2010

Running Barefoot

A few months ago, an interesting headline about how we evolved to run made the news:

I've always been a "heel plodder", but my friend Dave has always been a good runner, and once ran a marathon in 4:10 despite only 2 weeks training and otherwise being in pretty poor shape. He always runs "on his toes" - so I decided that if I want to become a better runner, I too need to learn to run "on my toes".

So I decided to start trying to run on my toes, in my normal shoes, so that my calve muscles would get stronger. Initially, my calve muscles would be tight - but I was expecting this and thought they just needed time to get stronger (wrong!).

I got blisters under my big toes from the wear and tear there. But, I thought, "that's also expected - my feet and muscles have to toughen up" (also wrong!).

Then one day in the gym, I tried running on the treadmill wearing just my socks. It was a revelation. My heel was able to reach the ground, whereas in normal running shoes, because of the padded foam underneath the heel, I was always having to run "too much on my toes".

However, about a day later, I could barely walk - because my foot hurt so much! I later learnt that this was because you need to build up slowly, and most importantly, running on the cushioned surface of the treadmill meant that it did not hurt immediately when I was running with poor style - it only hurt a day or so later.

But I really wanted to start running in some shoes that let my heel go all the way to the ground. If you're landing on the ball of your foot, heel cushioning just gets in the way. So I bought a pair of Vibram Five Fingers. I went out for a few runs in these, but would always get quite a big blister under my big toe in a very short amount of time, and the ligaments in my foot would often end up very tight. So I switched back to my normal Asics trainers for a bit. Then, after a particular fast "sprint" in which I really went up on my toes, I found that the base of my left index toe was really tender and sore.

So hopefully you're getting the idea that in my attempts to transition gradually to a more natural running style, I was always injuring my feet.

OK so what's the upshot of all this?

I should have just started running barefoot, completely barefoot, from the very beginning.

If you want to learn to run properly in Vibram Five Fingers, learn to run barefoot first. Preferably on hard ground like pavement (not soft ground like grass). The "rougher" the terrain you try to run barefoot on, the more quickly you will learn how to run properly, in a way that does not damage your feet.

This is actually the established advice on websites such as, founded by legendary barefoot runner Ken Bob Saxton. Above all, it should never hurt. It's not a case of "toughening up" your feet. Even your calve muscles should not get tight (this is caused by your heel not going all the way to the ground). The analogy he gives goes like this: While a deaf person can learn to speak, but generally not very well, people who can actually hear can sing! Running with shoes is like trying to learn how to sing while being deaf. We have to listen to the soles of our feet, which give constant feedback on whether you are running properly or not.

I started going for short runs (5-10 minutes) around Canary Wharf, slowly, completely barefoot. For the first time, the injuries in my feet started to improve (they are fine now!)

I'm still a beginner at this - but yesterday I ran 5.4 km at a pretty fast pace, and it was a turning point because I think I actually ran faster and with less effort than when I was wearing shoes. The movement felt so natural! I felt a sense of joy at the way it felt to run this way. My feet felt alive!

Oh and one other thing - people always ask about broken glass. So far, it hasn't been a problem. I keep my eyes open of course, I certainly don't try to run over broken glass. But if you are running "softly" then it seems you can even run right on top of small particles of glass and they don't get stuck in your feet. I've done enough running that I almost certainly have run over some small bits of glass (unintentionally) but it has not been a problem.

Here's a picture of the sole of my foot now. As you can see, there are no callouses or blisters. I can tell you that the skin actually feels softer - I think this is because there is a layer of subcutaneous fat that is developing giving me additional padding (and the skin seems thicker). My feet in general feel more flexible and supple, but also stronger:

I'm never going back to trainers - although I may wear some Vibram Five Fingers when it gets colder.

If you're interested,  I recommend you read this page and this page for some very good advice from one of the masters - then take off your shoes and give it a try!


Sunday, April 18, 2010

Permanent link to archive for Sunday, April 18, 2010

Zermatt 2010

I've put some pictures up from New Years Eve in Zermatt.

Sunday, November 1, 2009

Permanent link to archive for Sunday, November 1, 2009


Well, I finally got a chance to post my pictures from when I went to California this September.


Monday, August 3, 2009

Permanent link to archive for Monday, August 3, 2009

Kingsdown: My favourite new golf course

Depending on traffic, it's one or two hours away from central London, but I love this golf course (I'm sure you can understand why! ;) ):


Thursday, July 30, 2009

Permanent link to archive for Thursday, July 30, 2009

OK, this is a drunken post. Apologies in advance.

First, there's a couple new TV programs that I've really enjoyed lately.

1. Bang Goes The Theory

Great program! It's like Mythbusters, but somehow cooler. This week they built a "vortex" gun that essentially sends high powered smoke-rings (powerful enough to knock down a pile of bricks from 30 meters away!)

2. Inside Natures Giants

So far, they've dissected:

  • an Elephant
  • a Whale
  • a Crocodile
  • a Giraffe

It's fascinating, and well done, not insulting your intelligence, but really explaining how their bodies work and explaining things in the context of how they might have evolved.

3. I've come to the conclusion that our biggest problem still remains that we do not share a collective vision of our future.

In fact, it's worse: we block the future out of our thoughts. People don't even think about the world as it will be 1000 years from now.


A profound pessimism has set in.

I have a theory on why this is.

We are constantly being reminded that the future is going to be awful. Day after day we are inundated with stories telling us that the future is going to be terrible, "unless we do X". The proponents of these news stories say all of this to try to induce the general population towards doing "X".

But, this doesn't work.

Their motives are probably sincere - but the effect is anything but what they want. The problem is, everybody realises that they themselves cannot personally change the outcome. Everybody collectively goes through the thought process "anything I might personally do is not going to change anything, and in fact will make me, personally, worse off, unless everyone else also changes their behaviour". A classic "Nash Equilibrium".

Faced with this situation, most people choose a form of irrationality. Subsconciously, think go "If I know that I can't affect things, there's no point being unhappy about it. Better to absolve myself of guilt too then and just deny that the calamity will even happen". Or worse, they'll suspend rationality by thinking that merely performing some sort of penance like turning the TV off instead of letting it go to standby will make a significant difference.

We're still a very young society, with only the most primitive ways of organizing collective action. We're woefully inept at organizing our collective behaviour in the ways that actually accomplish what everyone wants. It must be so frustrating, as an environmental activist, to advertise so widely about the problems we all face and yet see George Bush elected in office twice.

For me, the big picture, the really really big picture, is profoundly optimistic. We've evolved, through billions of years, to where we are now. Life, in some form or another, will go on, no matter what we do. As capable as we are of self destruction, we are still not actually capable of destroying life on earth - only our own civilisation and our own way of life, and only then if we trully fuck things up.

The future exists, and we are most probably still in it.

Well... I wrote a bunch of things after this but realised that I don't really have any answers other than a vague concept that if we could just communicate the awesome facts we already know about our existence to every living person on Earth, this might help build a sense of shared identity and purpose, which is what is required for collective action such as this...

In fact, that's another interesting point, which is that we're brought up to believe that the people in charge have some better idea about what we should be doing than we do ourselves but of course in reality we will always be, metaphorically, the blind leading the blind.

But I digress... Time for bed!

Thursday, March 26, 2009

Permanent link to archive for Thursday, March 26, 2009

Two thoughts

That I had today:

  1. I am constantly reminded of the fact that when you gain a proper perspective of our place in the universe... the concept that a mere human brain is able to discover and understand everything that is trully knowable is... ridiculous. We are just the best that 4 billion years of evolution has managed to come up with in our little speck of the universe. Compare the most stupid person who has eve lived to the most brilliant person who has ever lived: the difference is utterly insignificant compared to how intelligent someone, or some machine, could in theory be.
  2. I was having a discussion with a friend about "big-O" notation... (basically, looking up a name in the phone book by searching sequentially through the pages is much slower than other ways you could adopt given that you know the names are sorted). As hardward has improved, "preferred" programming languages have changed towards what programmers can express against efficiency of execution... Yet, "big-O" notation has still kept dominion over what constructs people invent in programming languages.  Paul Graham wants to design an "idealized" programming language ... a "perfect" programming language, if you will. But... think really big for a moment: Suppose some technological advance (quantum computers or such) made it possible to compute any decidable proposition in constant time? What would programming languages look like then? The most important thing would be how easy it was to express the answer that you wanted. There would never be any point in saying "how" you wanted to calculate something - you would only ever be interested in the sorts of "questions" you could pose...  (what a delicious thought... to have such a machine!...)... I'm thinking of constructs such as the "amb" operator in Scheme.

Oh... while typing this I was watching the first episode of the new Apprentice series... it's become so miserable and negative now. All of the contestants are miserable, Sir Alan looks miserable... they are all desperately unhappy. It seems to me, in the first series, he got some really impressive candidates... a few "leaders" (such as James Max) who were able to bring out the best in the team despite all of the negative energy.  But then again, it's no wonder that, after that first episode, they can't find any good contestants. What sane person would want to work for Sir Alan? He's all about "business is all about being aggressive, you're either a winner or a loser"... you'd have to be a masochist to want to work for him. All of the smart people realise that there's so much more to life, and relationships... and anyway, business (and life) is about co-operation so much more than it's about competition...

The program has completely jumped the shark... but I'll probably still watch it anyway. At least until the really fit blonde contestant drops out.


Wednesday, March 18, 2009

Permanent link to archive for Wednesday, March 18, 2009


I've been watching the epic documentary series "Earth Story" on a new TV channel that's opened up here in the UK.

Sometimes, the simple facts about the evolution and origin of life on Earth just "glance off you" - you can't absorb the enormity of it. But this is not one of those times. Right now, I'm feeling... numinous.

Monday, March 16, 2009

Permanent link to archive for Monday, March 16, 2009

OO vs Scheme

A few months ago I posted this:

"So, my plan is, I'm going to write a moderately complex algorithm (a symbolic differentiator) in C++, C#, Scheme, and then OCaml (or maybe F#), and write up my experiences. I'm teaching myself Scheme at the moment..."

Well, I have some progress to report. Here's a fairly lengthy write up of the experience so far.


Wednesday, January 28, 2009

Permanent link to archive for Wednesday, January 28, 2009

Bubbles, psychology and the Blue Eyed Islander puzzle

I've just finished watching  Evan Davis' TV series "The City Uncovered"... This came on TV not long after Niall Ferguson's "Ascent of Money". Both are very good series trying to explain the current financial system and where it came from.

But they have both really annoyed me with their ridiculous attempts to explain the phenomena of "bubbles", or "boom and bust".

Niall's series pretty much said "Bubbles are caused by a herd instinct. Human beings are irrational, and we tend to all get ahead of ourselves, and that's how bubbles happen". (I'm paraphrasing here)

Evan's documentary went even further. He even interviewed one guy, John Coates, who reckoned that not only is it human "psychology" that causes bubbles, but that in particular it is male psychology, and the way that people react. Coates argued on tonight's TV program that testosterone makes people overly bullish, and cortisone makes them overly bearish, and that if only we had more women and older men doing the trading, then bubbles would not happen.

So, both seem to be saying "Bubbles are caused by human nature, and by the fact that people are ruled by their emotions".

I find this "explanation" so simplistic as to be offensive.

They should just admit that nobody really has a proper understanding of boom and bust.

I think the key to understanding the cause of boom and bust will be through the mathematics of puzzles like the Blue Eyed Islander puzzle. If you haven't heard of this puzzle before now, I advise you to visit that link first, and have a good think about it, then come back to read the rest of this!

It's a fantastic riddle. What's incredible about it, once you finally understand the answer, is that the public announcment of a seemingly inconsequential piece of information (I say "seemingly inconsequential" because everybody already knew that at least one person has blue eyes), ends up changing the situation entirely.

When the visitor says to all of the islanders in a public announcement that "at least one of you has blue eyes", each of the islanders now knows that a second islander now knows that a third islander now nows ... that a 100th islander now knows that at least one person has blue eyes. This is the abstract change in information that allows all 100 blue eyed monks to deduce the colour of their eyes after 100 days.

In the real world, the total amount of information that you acquire directly is actually pretty small. Most of the information that we acquire comes from other people who've acquired it from yet other people. Collectively, a population of a hundred million people might all know enough to deduce something, if we could all share that information with each other - but it's not even practical for us to be able to share our knowledge.

Think about this too: Nobody can point to any single event that caused the great stock market crash of October 24th 1929. Only 2 months earlier markets were booming and seemingly placid. What information was gained by everybody to cause them to realise that, indeed they were in a bubble?

I think it's very similar to the Blue Eyed Islander puzzle. You're an islander, you're looking at 99 other blue eyed islanders. You think you yourself might have blue eyes, but without the information about what the other islanders know, you can't be sure.

You're an investor. You think you might be in a bubble - prices keep going up - but you're not sure what the people who are buying know. If you knew everything that they knew, and could process all that information, then you'd be able to tell if it's a bubble or not. And it's not just a "greed/fear" thing. If you're a professional investor, whose job it is to trade in that market, you have to decide, each day, whether the market you are in is a bubble or not.

I remember listening to an analyst on CNBC back in 1995, after the Dow had recently risen something like 60%, to 5000. She thought it was a bubble, and had set an end of year target of 3000. Staying out of the market, playing it "safe" would have been just as costly as buying into it a few years ago.

I don't know what causes booms and busts either, but I do know it's a hell of a lot more complicated than testosterone.

Thursday, January 15, 2009

Permanent link to archive for Thursday, January 15, 2009

Xmas in Australia 2008

My friend Pad and I went to Australia this last Xmas.

Also, for all you American and English readers, you might want to take a look at my friend Chris' web page - the The Septic's Companion: A British Slang Dictionary. It's quite a good read actually!


Thursday, November 20, 2008

Permanent link to archive for Thursday, November 20, 2008

Explosion in my head

Sometimes, I'll go for months without having any really inspiring thoughts.

Then, like buses, three will come at once.

"Blade Runner: The Final Cut"

I watched this the other weekend in Hi Definition, and I have to say that it stayed with me. I immediately watched it again. It's not often I'll watch a movie twice in the same day. It was that good. If only I could see it on "the big screen" again.

I have a lot I could say about this XKCD comic.

Are the laws of physics computable? Consider the mandelbrot set. You can approximate the Mandelbrot set with a computer program... but you can never draw it completely accurately in a finite amount of time. Nobody knows of an algorithm which can tell you, in a finite time, whether any given point belongs to the mandelbrot set... and it's this non-computability of the mandelbrot set that makes it infinitely detailed no matter how far you zoom into it....  Personally, I agree with Roger Penrose. I think there must be some sort of "halting problem" aspect to the laws of physics.

Functional programming vs OO (Object Oriented programming)

"Is a set of sheep also a set of animals, given that all sheep are animals?".

Most people would quite naturally and reasonably answer "yes" to this question.

But in OO, this is quite a common mistake to make when designing a class hierarchy if you also allow your "set of animals" to be a mutable set (i.e. you can change the contents of the set over time). This is because it then becomes possible to add, say, a "cow" to your "set of sheep", breaking the invariant that a homogeneous list of "sheep" contains only sheep....

I see this as a failure of OO. When such an obviously "correct" answer is the wrong answer in the "OO" methodology, it's the methodology that's broken.

People naturally think in terms of "immutable" concepts. We're not actually very good at "simulating" little machines in our head.

But also, I've realised that all I ever do now when writing "my style" of OO code is to write anonymous, immutable implementations of interfaces anyway... I write "factory methods" which "compose" immutable objects out of other immutable objects into chains of delegating implementations of interfaces, splitting apart the different bits of functionality to the scope in which they were created. Up to now, it seemed verbose, but necessary in order to model things correctly and keep the right information in the right parts of the program.

Now I've realised that what I'm really doing is a horribly syntactically verbose form of functional programming.

I think we've reached the end of the road for "Object Oriented" programming... All of the stuff about Decorator, Factory Method... they're all just ways of doing what comes naturally, with better language support, in a purely functional language like OCaml or F#.

So, my plan is, I'm going to write a moderately complex algorithm (a symbolic differentiator) in C++, C#, Scheme, and then OCaml (or maybe F#), and write up my experiences. I'm teaching myself Scheme at the moment...

Oh, and if you're interested, I've finally fixed the RSS feed for this site...


Saturday, October 18, 2008

Permanent link to archive for Saturday, October 18, 2008

Just a small update.

1. I really need to stop using the word "actually"

2. I wish I had started doing the part time Mathematics degree 3 years ago. It is fantastic!!

3. It seems to me that we may just have reached "the bottom" of this crisis... it is looking like the banking bailout has worked, and people are lending to each other once more... We will not enter "financial armageddon"... at least not yet

The last point is quite important for me with respect to political motivations.

I was all set to vote Tory, but I must say, like Mr Krugman, I was very impressed by the speed and decisiveness of the UK Labour government in dealing with the current crisis, and the leadership role they played in getting other governments to adopt similar plans. To understand what a profound accomplishment this was, you only had to observe the incompetence of the US government and its inability to do the same in the crisis.

The UK government correctly analyzed the problem (or listened to the right people who correctly diagnosed the problem), and reacted swiftly and decisively, with a well constructed plan that precisely targeted the cause (insufficient bank capitalization).

Whatever Gordon Brown and Alistair Downing may fail at otherwise, they can rightly claim that "they did good" here (in contrast to, for example, Paulson and Bush)... This really was a case of good government saving thousands of jobs and billions of dollars of "lost growth"...


Tuesday, September 23, 2008

Permanent link to archive for Tuesday, September 23, 2008

Well, it's been a long time since I last updated this blog. Sorry about that.

Barclays Capital

I've taken up a position a Barclays Capital - working on their fixed income exotics risk system.

The Credit Crunch

Well, to say that this is an "interesting" time to be working in the city is an understatement!

I refer to the following blogs to keep me "up to speed" about what's going on and, more importantly, why: - a really top notch analysis. - much more frequently updated, and with a strong left-wing bias - but very readable and not so "dumbed down".

Alan Greenspan

I also recommend reading Alan Greenspan's "The Age of Turbulence". The first "half" is mostly a biography - very interesting and readable. For one thing, despite being a "Libertarian Republican", he is very critical of Bush, and praises Bill Clinton... (of course, in hindsight this is an easy choice)... He also praised Gordon Brown.

The second half is perhaps even more interesting because he outlines his own views on how the global economy etc. should work... and states as his main thesis that "free market economies are incredibly resilient"... oh, and yeah, all except the epilogue was published July 2007, just before the shit hit the fan.

A particularly interesting chapter ("The Condundrum") claims that the Fed didn't actually have anywhere near as much control over "real"interest rates (the rate people/banks *actually* had to borrow money at), as people normally thought...  He mentions several times when the Fed raised rates, but long term rates actually went down after an initial "jump up"... He credited this to "disinflationary forces" due to globalization... I find this argument actually easy to agree with (that the Fed doesn't have anywhere near as much control over real interest rates as people think) precisely because we're having the exact opposite problem now (The Fed is lowering rates but LIBOR etc. remain unchanged).

Gordon Brown

Personally, I'm in favour of high taxes and government spending, if it's done efficiently, and not too centralized. However, I don't think that Labour has done a very good job at all with tax payer's money - not compared to, say, Denmark.

I was pretty sure that Gordon Brown was doomed to lose the next election (I hope he does!) - but after hearing his sound bite: "No time for a novice" - I can see it for the political genius that it is. Both David Cameron and David Milliband come across as completely inexperienced naive "show pony's" given the scary problems we are facing right now. I think Brown could pull off a campaign with this premise...


I'm working on an article to describe how to write "parallelizable" scripting languages implemented on top of a "grid" of computers (such as Data Synapse)... but...


I'm also starting an undergraduate Maths degree at Birkbeck University... so I might not have much time for blogging for at least a couple of months (then again, this isn't much of a change from the last few months in any case ;-0)



Wednesday, July 23, 2008

Permanent link to archive for Wednesday, July 23, 2008

Relational Grid

Over the years working in risk systems for banks, the structure of what we have to do has always been the same.

  1. Load the input data for your calculations: "Give me all of the details of all of the trades that belong to book 'ABC'"
  2. Based on that input data, generate what you want to do: "For each of the following scenarios ('FTSE20%UP', 'FTSE20%DOWN', ...), perturb the market data appropriately and value the book"
  3. Split the stuff that you want to do into lots of separate "tasks": (e.g. Value trade '101452' for scenario 'FTSE20%UP')
  4. Farm out those tasks onto a "grid" of computers (thousands of them) so that they can be executed in parallel
  5. Store the results in a reporting database
  6. Generate reports based on what you got from the reporting database

There's third party software readily available to do step 4 for the most part.

But what I presented for steps 1, 2 and 3 are just examples. Usually, they are much more complicated - and people are always coming up with new stuff - due to changing market conditions, new trades, new types of market data (and hence new ways of "perturbing" them). All this means that you usually require some programmer to write code (and they usually have to write a new report at the end too). Because all of this takes too long, the trader usually just doesn't bother - and has to make do with some ad-hoc measure instead. There are only so many hours a day to perform "ad hoc" reports, and "what if" analysis.

If only you could drive the whole thing backwards from step 6, and have it automatically figure out steps 1 through 5...

That would dramatically decrease the turnaround time (merely a few days to generate some new risk measure or new scenario report).

That's what I'm working on at the moment... and I honestly think it's the coolest idea I've come up with in a long time (who wants to hear false modesty anyway!).

So you just type in something like:

select tradeId, tradevalue.value,
from trades, tradevalue, scenario, marketdata
where trades.bookId in ('ABC')
and tradevalue.trade_xml = trades.trade_xml
and =
and marketdata.trade_xml = trades.trade_xml
and marketdata.valuation_date = 'today'
and = scenarios.perturbed_market
and in ('FTSE20%UP', 'FTSE20%DOWN')

and it would automatically execute your query on the grid of computers for you.

The trick is, many of the above "tables" aren't really tables - they're grid tasks. The "tradevalue" and "scenarios" tables above are not real tables in a database - it just looks that way. In reality, for each new "trade_xml, market" input combination, a new grid task is created. One way of looking at the "grid tasks" is that they are infinitely big tables - they have an infinite number of rows. Each "row" in that table is an execution of a grid task. But we always use them by "joining" to other tasks, in effect specifying the inputs to those tasks.

Also, just like how relational databases allow you to define "views" for commonly used sub-queries, and as an abstraction layer, you can compose grid tasks out of subtasks in a similar way. For example, if you were using montecarlo techniques to value your trades, your "tradevalue" task might really be another "join" and "group" operation over hundreds of different "sample paths":

define view tradevalue as
select average(pv)
from tradevalue_path
where tradevalue_path.seedpath > 1 and tradevalue_path.seedpath < 1000

(the above "view" is still infinite because we have not specified trade_xml yet).

By providing a library of "primitive" grid tasks, users can then write their own custom components or "views" and compose them together to quickly generate the sorts of answers they need to see - without needing to go through a 2 or 3 month release cycle while the new reports and "grid code" are written.

Of course, you wouldn't actually have to use SQL to define all this - any system for specifying joins, projections, grouping etc. will do. SQL is a bit too high level actually. I've used an XML format instead. But writing some sort of "SQL parser" on top wouldn't be hard. The hard part is the algorithm to get from your "relational algebra" representation to individual tasks to be performed on your grid.

What do you think? Comments and suggestions welcome.

Monday, May 26, 2008

Permanent link to archive for Monday, May 26, 2008

Whitby Golf Course

This is the bit where I gloat to everyone who spent a long rainy weekend in London about what I did on the bank holiday weekend...

Monday, February 18, 2008

Permanent link to archive for Monday, February 18, 2008

The Human Supercomputer

I'm trying to work through a physics book that a friend from work lent me. It's hard going - I have to read each new concept over and over again, until finally "inspiration" hits and I find a way of understanding the concept that they are trying to express.

I think that what makes a lot of it so much "hard work" is that I am having to translate from the author's "view"of things into my own. I suspect that it's like this for most people. Mind you, I'm not claiming that my way of seeing and understanding things is better than the author's - I reckon most times it's far inferior. Most times, my different "viewpoint" simply makes it harder for me to learn and understand things that other people already know.

It would all be a lot simpler and more efficient if I just saw things the same way as the person who is trying to teach me... Then, there would be no ambiguities, or opportunities for mis-understandings. I wouldn't have to "backtrack" and learn whatever things they implicitly "knew".

But then, also, I would be them. And maybe, say one time in a couple billion, my perspective ends up being unique and better, and I get to see something that, perhaps, no-one else in the world would have been able to recognize. That time, I would be able to contribute to the sum of human knowledge, in absolute.

In fact, I had this "revelation" today that this is one way of seeing the human race - it's like all 5 billion of us are individual "nodes" in a massively parallel human "supercomputer", set to the task of discovering the answer to life, the universe and everything.

So maybe Douglas Adams wasn't so far from the truth after all!


Made with CityDesk