Tuesday, December 13, 2005

The Splintered Mind by Douglas Cootey

The Splintered Mind by Douglas Cootey

Excellent blog centred on ADDA. Insights for me, and should be useful to the rest of us defects. List of recommended ADD-related books, too, which in previous times would have sent me straight to Amazon. Nowadays, armed with my new self-knowledge, I’m aware that my habit – of buying technical books then only glancing at them once – is not the result of unfortunate circumstances, but something I’m stuck with.

He’s actually remarkably disciplined – makes rules for himself and sticks to them. I find this admirable, but impossible to use for myself. If I started something like this, it would just become another project, and like all self-driven projects I’d lose interest in it the moment I’d done the interesting bits. And then I’d forget to use the mechanism when the time came.

I’ll have to keep looking for my own strategies.

Game Theory, and why Hobbes was wrong

Hobbes’ Thesis
The philosopher Hobbes has been shocking people for centuries with his beautifully-reasoned arguments that Man requires a Supreme Leader – to whom all one’s rights and individuality must be delegated.

Failure to do this will, says Hobbs, leave humans in the ‘State of Nature’ – acted upon only by instinctive forces. Such a life Hobbes famously describes as ‘nasty, brutish and short’. He equates it to a state of war, in which every man is essentially – prefiguring Darwin - in conflict with every other individual for resources like food, shelter, partners and other basic needs.

The solution to this, as proposed by Hobbes, is a King. Of course, monarchs were the natural solution in force at the time of writing, and at that time a ferocious and often bloody debate was raging over the relative supremacy of Parliament and Monarchy, and Hobbes believed that the latter was the proper way forward.

The King was an individual to whom the populace collectively surrendered all their rights and authority, and who then wielded that collective power on their behalf. In the process he acted to remove the conflict between individuals, resulting in a state of Peace – in contrast to the uncontrolled state of war that, thought Hobbes, Nature made inevitable.

It’s an extraordinary thesis, and hugely compelling. I’m extremely impressed by Hobbes’ ability to cut through sentiment and emotions and see society’s raw dynamics so clearly. I think he’s wrong, though. Humans in the natural state are not inevitably brutal to each other.

He couldn’t have known this, as the key information has only recently become clear.

Game Theory and Trust
The Prisoner’s Dilemma is a classic piece of Game Theory. It’s a thought experiment that pits two hypothetical people against each other, both faced with a situation in which they actions of the other – which they can’t control – will affect their future.

They may each choose one of two possible avenues, but it’s the choice of the other that determines whether they have chosen correctly, and the outcome of that choice.

This scenario is normally presented thus:


Two suspects A, B are arrested by the police. The police have insufficient evidence for a conviction, and having separated both prisoners, visit each of them and offer the same deal: if one testifies for the prosecution (defects) against the other and the other remains silent, the silent accomplice receives the full 10-year sentence and the betrayer goes free. If both stay silent (cooperate), the police can only give both prisoners 1 year for a minor charge. If both betray each other (defect), they receive a 5-year sentence each.

This may seem at first both complicated and spurious, but in fact it represents in microcosm the sort of choices that we face every day. We constantly have to assess cost/risk/benefit in almost everything we do: each time we purchase a chocolate bar from a corner store we trust that the storekeeper is selling genuine merchandise and not ripping us off. The storekeeper in turn trusts that our money is not counterfeit.

In more complex transactions, especially high-value purchases, we routinely take greater risks: we trust that the car we buy will not fall apart once it leaves the showroom. The seller trusts that our ability to pay the large sums is genuine. We hand over money in the expectation of future goods. We hand over goods in the expectation of future payment. We constantly trust strangers not to rob, injure or cheat us, even when they could get away with it. Why do we take these risks?

The Iterated Prisoner’s Dilemma
A single Prisoner’s Dilemma ‘game’ is not particularly enlightening. It really only allows one to contemplate the problem of working with others, and the issue of trust. Things become more interesting when repeated games are played, and previous behaviour can be used to estimate the likely future actions of one’s partner in crime: if they have consistently defected in previous games, they’re likely to do it again.

With repeated iterations of the game, it becomes possible to develop a strategy for winning (i.e. minimising one’s jail time). A strategy is essentially an algorithm – a set of rules that provide responses to specific events.

An Iterated Prisoner’s Dilemma Algorithm (IPD) really has only one input – the actions of the other player over the previous games. The sequence of the other player’s actions can be analysed in various ways in order to decide the algorithm’s single output: whether to Defect (turn the player’s partner in) or Co-operate (remain silent).

Game theorists spent a long time developing and testing algorithms for IPD, and pitting them against others: simple ones that respond with the minimum of thinking; algorithms with complex statistical analyses of the accumulated data; heuristic algorithms using neural nets to learn from their mistakes and successes.

And after a great number of experiments, a clear winner emerged: a strategy that consistently outperformed all the others, no matter which opponent it was partnered with – from complex algorithms to random responders. And what was it that this spectacular world-beater did, that swept all before it?

In plain language, the algorithm – called ‘Tit-For-Tat’ by the developers - was ‘Do unto your partner whatever they last did to you’.

That’s it. No analysis, no heuristics, no statistics – just handing back whatever is dished out to you. And Tit-For-Tat beats everything else.

The implications of this to the real world are hard to be certain of. It appears to indicate that over-analysing is not all that wise, and that past performance is an unreliable guide for prediction, no matter how you cut it.

Changing the Context
Tit-For-Tat is the champion when pitted against any other algorithms. So what happens when everyone is playing TFT? Interesting things, as it turns out.

If the background environment consists entirely of Tit-For-Tat opponents/partners, another algorithm scores even better. Once again, it’s not one of the statistical analysts. This algorithm has the name ‘Forgive Once’. Its operation is very similar to TFT, with one exception: as its name suggests, it will forgive (by ignoring it) a single defection by its partner. Apart from this, it will feed back what’s done to it, just like TFT.

And the trend continues: in an environment consisting entirely of Forgive Once partners, a new algorithm called ‘Forgive Twice’ turns out to be the winner. Work out what that one does. And it doesn’t stop there.

What inferences can we draw from this?

  • Although the mechanisms involved in the Prisoner’s Dilemma are simple and numerical, they map well onto real-world situations.

  • People don’t usually make arithmetic calculations when assessing risk/benefit. They go with ‘what feels right’. But those feelings are the result of instinct and experience, and tend to conform accurately to the calculated optimum.

  • Iterated PD games themselves map well onto everyday real-world experiences, in which an individual must constantly engage in cost/risk/benefit transactions with others. So ubiquitous are these mini-transactions that we tend not to notice them.

  • Many such transactions don’t involve the transfer of material goods, and the interactions take place using non-vocal communication. Being highly verbal animals, we tend not to notice the rich non-verbal interchanges that we carry out continuously with others.

  • Some measure of how important such interchanges are can be gleaned from the difficulties that arise when the communication channels are interrupted or blocked: as in cars, where tempers often flare simply because the appropriate permission-seeking and -granting behaviour is not present.

If the IPD is accepted as a valid model for human behaviour, the fundamental first lesson is that cooperation has a survival advantage.

In the early days of humanity, punishment for infractions of any kind tended to be utterly disproportionate to the actual damage done: agonising death was routinely handed out as a penalty for minor crimes. This could be described as Massive Retaliation.

A breakthrough occurred in the legal Code of Hammurabi, which introduced lex talionis – the principle of retribution referred to as ‘an eye for an eye’, which states that a punishment should exact upon the perpetrator the same level of injury experienced by the victim. This principle is still in use today in some formal judicial processes, and in some less formal social interactions.

Lex Talionis bears a strong functional resemblance to Tit-For-Tat. As a more efficient system – more satisfying for punishee and neutral observer; less so emotionally for victim, but undeniably fairer – than Massive Retaliation, Lex Talionis became widely adopted.

As we have seen, though, in an environment where all participants are playing Tit-For-Tat, a still more efficient algorithm – and therefore modus vivendi – becomes possible.

The Old Testament of the Christian Bible is in part a narrative of the rise of Lex Talionis from the previous state of massive retaliation. This natural progression is at the core of Hobbes’ error: he was unaware of the natural processes that make fairer systems of justice arise, overtaking the bestial ‘State of Nature’ he envisaged.

The Biblical narrative continues in the New Testament. In many ways it was an idea whose time had come, but Christianity was - in the ancient middle eastern world at any rate - in the right place to put forward the idea, and has been unfairly credited with inventing it. The idea was the Forgive Once algorithm.

It was expressed as ‘turn the other cheek’, and it’s worth noting that, despite this USP, Christianity remained a small and relatively unsuccessful desert sect for centuries until Emperor Constantine and his mum, Helena Augusta, suddenly decided to renounce the far more interesting Roman pantheon. The rest is history.

It’s possible that the ‘Forgive Once’ aspect of the new religion may have appealed to a Constantine wearied by the excesses of war. At any rate, it came with the territory, and the fact that the new algorithm is more efficient made its success inevitable.

Our present-day society operates on a variety of ‘Forgive n’ algorithms. Formal transactions tend to be based on Tit-For-Tat (which can be considered to be ‘Forgive Zero’). More ad hoc transactions – especially between friends, and between regular transactors – will involve multiple ‘forgivenesses’. These may be offerings in the expectation of future profit – as in the case of presents to good customers; or effectively symmetrical, as in the case of a temporary loan. Regularly, acts of pure altruism take place, in which not only is there no benefit to the initiator, he must actually lose out: each time someone allows a car from a side-street into the queue, they perform a small sacrifice with no possibility of direct recompense. Why do they do it?

The short answer is that they do it because in the long run such behaviour carries survival benefits, and so selection pressure favours it. The overall trend toward increasing trust continues as each new level is reached: Forgive(1) is overtaken by Forgive(2) and so on, until the population is dominated by increasingly generous and trusting people.

(Note that this treads perilously close to Group Selection, but avoids the problem: TFT is immediately beneficial to the individual, and tends to spread. F(1) has benefits in the TFT environment that results, and so on.)

If the point hasn’t already been banged home enough – which it probably has: Hobbes’ Natural State turns out to be a lot less nasty and brutish than he anticipated. In the absence of an all-powerful monarch or other supreme authority, Man is nevertheless able to adopt a fair, trusting and mutually-beneficial modus vivendi for peaceful interaction with his fellows. This type of morality is neither God-given nor imposed – we get it for nothing because of its survival advantage, and the IPD shows how.

Flies in the Ointment
Of course, in such a fair and trust-based environment, the occasional rogue individual is able to make considerable headway at others’ expense. His rampage is usually limited, however: along with the tendency to trust, humans have an acute ability to detect cheating and falsehood, and good mechanisms for branding the Cheater. The society will tolerate a limited number of truly amoral people, especially the true psychopath with no moral scruples, willing to go to any length to disguise his true nature (in contrast, the average crook is often limited by his own guilty conscience).

A significant social problem is that, ironically, laws tend to be framed in the context of the normal, moral person, and may be weak in dealing with truly 'evil' people except when their transgressions are suitably profound – as in multiple murderers and so on. In this situation, the psychopath may be able to live comfortably within the law, despite causing great harm to others.

A mechanism for detecting such people, and removing them from society - even deleting them from it entirely - would benefit all of society, much more than punishment of those who merely break the letter of the law.

DRM Again

According to The Register, Gartner reckons "the music industry will abandon attempts to encumber CDs with DRM software and refocus its efforts on pushing legislation to require that DRM technology be integrated into PCs."

(Sigh) And so it goes on. Nowhere is the long-running and futile attempt to use technological locks to keep the world away from what they want so concentrated as in the matter of DRM. Having apparently realised the futility of building it into the media, they figure to put it into the base hardware.

This is as likely to work as the last such attempt: making DVD-ROM players region-specific via firmware. No doubt there are some people whose DVD-R players are actually locked to a specific region, but anyone who doesn't want this lockdown will find that a crack is a brief Google away at worst. If you can get in before the firmware locks itself, you can probably find a freeware defeat. After the lock comes in to force, you may have to pay for the crack, but you can certainly still defeat it. More recent DVD burners and their drivers appear to have stopped bothering about the issue altogether, so pointless has it become.

If future brand-name PCs appear with hardware-based DRM, they will simply provide more incentive to go for less mainstream motherboards without such features. The mainstream manufacturers will presumably not be unaware of this factor, and will resist their inclusion. Their best bet would be to make any locks they put in inherently crackable, and the online community will no doubt supply the goods in a while. Chances are there’ll be a ‘secret’ back-door defeat that will mysteriously leak to the public in short order after the kit hits the street.

If the mechanism is put into the O/S, the first cracks for it will probably appear while the stuff is in Beta.

It’s a senseless waste of energy, except for one factor: it’s clear that Apple’s success in getting the music industry buy-in to iTunes was strongly influenced by the ‘uncrackable’ MP4 DRM they included. This appears to have convinced the music publishers to allow their precious files out into the world.

It didn’t stay uncrackable for long. Prior to iTunes 6.0, Apple's DRM was comprehensively cracked, and translation of iTunes music files to straight MP3 became trivial. iTunes v6 introduced a new algorithm, which at the time of writing is still uncracked. It’s unlikely to remain so for long, though. I can only assume that the music moguls complained to Apple, or that Apple felt that they should maintain the façade of uncopyable music for a while longer, until they had more music houses on board. Eventually they’ll presumably give up, lest they force the community they’re frustrating to come up with a mechanism that’ll crack anything – it’s already quite feasible to read the sound synth’s data tables directly.

I guess this is a transition period. They’re always a drag.

Saturday, December 10, 2005

Sony DRM woes

Yet more news on the BBC about Sony’s ongoing DRM troubles. All around you can hear the sound of Sony execs weeping into their beers, the outraged howls of stung customers, and the sniggers of those of us who find the whole things hilarious.

Sony are, they assure us, repenting. Good. Is it possible that other organisations will look upon this mess, and learn from it? The lesson is simple:

You can’t use technology to keep the world away from something they want.

It just doesn’t work. There are too many of us out here, and some are cleverer at undoing locks than your guys are at locking things up. Just because your security system baffles you, it’s no guarantee that you’ll baffle every one of us. Statistically, it’s practically inevitable that somewhere out here in the real world will be someone with the patience, experience and intellect to discover what you’ve done, and how to get around it.

As someone said of the IRA: we only have to get lucky once, and we’re in; to keep us out, you have to get lucky every time. And luck, ultimately, is really the only factor.

(I once worked briefly in a flea market. In one corner of the giant cellar in which it was housed was a group of pinball machines. Every few weeks, the people managing these would come and take one away, and replace it with another, different one. As soon as they’d gone, the little tribe of resident teenage pinny-wizards would swarm over the thing, probing its secrets.

(Within an hour, you could go over to them and ask ‘What’s the trick with this one?’, and they’d say ‘You smack it there, and it gives you a free game’, or ‘Tilt it, and then hit it here’. If such simple tricks failed, they’d prise back the beading on the glass cover, feed a wire coat-hook in, and wiggle it on one of the bumpers until they’d run up a hundred free games. When the numbers got low, they’d ring up another hundred.

(These were pubescent kids, most of them truanting from school, where their academic records were doubtless unremarkable. In minutes they could work their way past the best protection Bally could dream up. Necessity is the mother of some pretty amazing inventions.)

The Security Industry – once a simple sop for the paranoid, but since 9-11 an overriding fact of life – responds to these things by cranking up the sensitivity of their systems. This just makes them more likely to go off spectacularly when spuriously triggered. So false positives become a daily occurrence: cash machines that won’t allow you to get at your own money; the lone car in the parking lot, its alarm wailing away, urgently reporting nothing to no-one; ‘license keys’ with enough bits to specify every particle in the universe. Sometimes it’s easier to go on the Web and get the hack than it is to hunt down the box to find the 24-digit key.

All security systems have this in common: they are a wretched inconvenience to those who have legitimate rights to whatever it is they’re protecting. In contrast, they usually pose little difficulty to the properly-equipped people they’re supposed to keep out.

In ‘80-‘81 I worked in one of the first computer shops. Some software was ‘protected’ and some wasn’t. The unprotected stuff we all messed with, and learned to use. Using the protected stuff would cost our little start-up the price of the package, which we couldn’t afford. So we learned the stuff we could work with, recommended it and sold it by the crate-load.

Later, with the help of early cracker programs and bit-copiers, we managed to make copies of stuff we were interested in for our own use, and we learned that too. And we recommended and sold it. Far from losing out because of what’s now dramatically called ‘software piracy’, the developers of the software benefited enormously in new sales.

This is still the situation today, except that many more types of information are available as digital data, able to be reproduced endlessly without degradation. Even in the analogue days - when the only sources were records and radio, and the only recording mechanism was analogue cassette – the music companies allowed themselves to be convinced that every taped song would otherwise represent a sale. They started the ‘Home Taping is Killing Music’ campaign on the back of that notion, but it seems as though nobody paid attention except for an enterprising bunch who set up FACT and FAST, and now make money by propagating the idea that people are ‘stealing’ from the copyright owners. Who gets to see these messages? Why, those who buy or rent DVDs and videos, of course, and then have to sit through little scenes showing what corrupt swine pirate video sellers are, despite the fact that this audience – having bought or rented a genuine DVD – are presumably the last people who need to be told.

Ultimately, such inaccurate targeting is not the most erroneous aspect of this business, of course. The primary raison d’être takes care of that, suggesting that every taped song, film or program is a direct loss to the copyright holder. It isn’t: the overwhelming majority of copied media go to people who would otherwise never obtain a legitimate copy, because it’s too expensive, or because it’s not worth the cost to them – which is really the same thing.

A pirate copier supplies his own media. In the absence of manuals, he may buy 3rd-party books to learn to use the program – and there’s little doubt that pirate software is responsible for a large portion of the sales of such books. He’ll make no use of official tech support, and must fix his own problems. He costs nothing at all.

But those same pirates may well like their stolen property, and recommend it to others. If it’s software, and the need arises for their company to acquire a package, which one is he going to recommend? The same applies to music and film.