AV is not a good voting system. FPTP is worse.

The UK is currently running a referendum on whether to change the voting system from First-Past-The-Post (which is more naturally called ‘simple plurality’) to Alternative Vote (which is sensibly called Instant Runoff Voting in other parts of the world).

Having been interested in the technical details of voting systems (or ‘social choice theory’ as it’s also known), one of the big disappointments to me about the way the campaigns both for and against (as well as the media coverage) are being run is their lack of technical information. The Economist describes both campaigns as ‘insulting the publics intelligence’. There’s an awful lot of talk about things completely tangential to the voting system, such as whether soldiers have enough armour or not, lies being spread about supposed cost, and arguments in both directions about whether this moderate change for the better makes other changes more or less likely in the future, but so far I’ve seen nothing that tries to appeal to voters considered judgements rather than their emotions.

This is a shame because voting systems are essentially technical, and decisions about them should be made on an unemotional basis. In 1951 Kenneth Arrow published a book which expanded on his PhD theory that’s become known as Arrow’s Impossibility Theorem. In it, he takes a number of criteria that you would hope to be true of any voting system, and then proves that no voting system (with more than two options) can meet all of them. This doesn’t mean that all systems are equivalent of course, just that any voting system is going to be a trade off.

My personal favourite for a long time was a system called Ranked Pairs and some of its variants, although these days I do find myself swayed by the arguments of the range voting supporters. Wikipedia has an interesting table listing a number of voting systems by criteria that they meet.

Part of the difficulty is that it’s not clear whether the voting system should select winners who can most motivate one extreme of the political spectrum (commanding loyal support, and with a clear vision for moving forwards), or whether it should select winners with the most broadbased support (who will continuously have to hammer out compromises), or whether it should prioritise not selecting the most hated candidate (something that Plurality often does). Different systems strike that balance in different places and are good for different kinds of situations.

Plurality voting (FPTP) in the UK has led to a situation where your vote is either a vote for the government or a vote against the government (in which case you must vote with the nongovernment party most likely to win in your constituency). Other votes are interesting from a popularity contest point of view, but make no more difference to the make up of Parliament than those who stayed at home. Is it therefore any wonder that so many do stay at home.

Of course, the biggest injustice in our voting system is the lack of proportional representation. It is possible under the UK system for a party to win the majority of popular votes in the country and still not win a single seat in Parliament. While this is unlikely, as people’s political views become less associated with the area they live in, this becomes a bigger and bigger problem. It seems bizarre that the system rewards parties for having their supporters ghettoized, and this will become only more bizarre in the world of the internet. The Green Party already suffer from this kind of geographic diffusion disadvantage.

The Conservatives scuppered a referendum on anything that might address that issue, so the referendum is a choice between a poor system of choosing the single winner in a constituency (AV / IRV) and an even worse one (Plurality / FPTP). Neither of those systems support one of my favourite criterion – the Condorcet Criterion. The Condorcet Criterion is simply that if there is a candidate that is preferred to all of the other candidates then that candidate should win. Seems obvious, but neither IRV nor Plurality can guarantee it.

A related criterion that does separate IRV and Plurality is the Condorcet Loser Criterion. That is the idea that the most disliked candidate should never win. IRV satisfies that criteria while Plurality does not. It’s the interaction between this criterion and another known as ‘independence of clones’ that pushes our system towards two parties. Imagine that the Conservative candidate is preferred by 35% of the voters, and absolutely hated by the other 65% of the voters, however those 65% are split between 30% Labour, 25% Lib Dem and 10% Green. Every one of those other voters would prefer the Labour, Lib Dem or Green candidate to the Conservative candidate. The Conservative candidate is the most disliked candidate, however Plurality might still elect them despite the fact that 65% of the voters don’t want them. Because of this, under plurality, the opponents of the Conservative candidate need to concentrate their votes to Labour to ensure the Conservative doesn’t get in.

One problem with IRV is that the tactical voting that is so necessary in Plurality happens with IRV too, and when there is widespread tactical voting in IRV, the result is pretty much as bad as Plurality – two party domination etc. What often happens in countries that use IRV is that a party gives a suggested preference order to its supporters, and so even though tactical voting is more complex under IRV than Plurality, it becomes just as widespread. If IRV is the best system on offer to the population of the UK, I’d like to see rules that stop political parties from suggesting preference orders.

Something that is very interesting is that despite ambivalence or active campaigning against IRV from most of the political establishment, most opinion polls put the result fairly close. The people of the UK know that they need change, I hope that they also know that at best this is just a small step on what is probably quite a long road to a more sane voting system.

[This report brings out some of the technical issues. ]

Playing on the CouchDB

Let’s say you’re playing with CouchDB and javascript. It’s great fun, but you’re in development mode, you want to be able to change a file and then reload in your browser without having to mess around uploading and deploying stuff.

The ‘proper’ way of doing this is probably to set up a reverse proxy so that your couchdb is visible through your development webserver, and all is good, but that sounds like a lot of configuration for a playing around kind of setup.

What you’d like to do is run a normal couchdb install on your machine, and use whatever you normally do for webserving (for just playing around, I tend to use a jetty jar I’ve created as it’s very light and easy, but you could equally use tomcat or whatever), and edit the javascript and html files in place. If you have this set up, you can’t usually load the javascript couchdb api from the couchdb server, since it uses an XHR to communicate with the couchdb server, and these are restricted to using exactly the host that the page is loaded from. The fact that the couchdb server is on a different port to your webserver stops it from working.

You can get around this by saving a simple html document as an attachment in your couchdb (any database). This html document is then loaded in an iframe, sets the document.domain to the hostname (removing the port), and then it passes the api object up to the parent window.


If you’ve attached that file to a document with id ‘document’ in a database called ‘webaccess’, you would then use it as below: