The old adage often makes sense: ‘Let’s cross that bridge when we come to it.’ We could spend our lives preparing for horrors that never happen. Yet sometimes, it is worth thinking ahead. A hung parliament is one such event. I am not predicting this will happen next time; but it could happen. We should have our political insurance ready, much as we insure against our car crashing or our home burning down.

The alternative is to wait until the day after the next election before even thinking about what Labour should do. That is a bad idea. First, if we don’t think through the consequences ahead of time, we will come up against people in other parties who have. We could be outmanoeuvred. Second, over the post-election weekend our leaders will be knackered. Negotiating the perils of a hung parliament will require clear thinking; the more that is done in advance, the better.

So: how should Gordon Brown react to such a result? Battle on as the leader of a minority government? Seek a deal with the Liberal Democrats? Resign?

Let’s start with the arithmetic. Some people think of a hung parliament as one where the Lib Dems hold the balance of power. In fact, there are five different scenarios – and the Lib Dems being able to choose to deliver a majority to either Labour or Conservative is the least likely.

Here are the five scenarios. In order to illustrate them with specific examples, I assume the Lib Dems win 50 seats, and smaller parties 30. Within reason, different minor party numbers do not affect the basic analysis.

• Scenario one: Labour 315 seats, Conservative 255. Labour falls 11 seats short of the 326 needed for an overall majority, but has more MPs than the Tories and Lib Dems combined.

• Scenario two: Labour 300, Conservative 270. Now the Tories and Lib Dems can outvote Labour if they join forces, but their combined strength of 320 still leaves them short of an overall majority. However, a Lib-Lab coalition would have an overall majority of 50.

• Scenario three: Labour 285, Conservative 285. If, and only if, the two main parties have virtually the same number of MPs, could the Lib Dems choose to deliver an overall Commons majority to either of them.

• Scenario four: Labour 270, Conservative 300: the reverse of scenario two.

• Scenario five: Labour 255, Conservative 315: the reverse of scenario one.

Scenarios four and five are the easiest to think through. Labour would plainly be seen to have lost the election. It would look terrible if Brown tried to stagger on. He would have to resign.

David Cameron might then go through the motions of inviting the Lib Dems to work with him. But his offer would be one designed to be rejected by Nick Clegg. The reason is simple. Cameron knows that he could expect a honeymoon period with the electorate. His best option is to form a minority government, and then call a second election a few months later. The Conservatives would be almost certain to win this comfortably. A deal with the Lib Dems would make it harder to justify an early second election.

Oddly, scenario four would be easier for the Tory leader than scenario five; for with 300 MPs, no one could blame Cameron for calling an early second election, before the honeymoon effect wears off. The closer he gets to an overall majority, the harder he would find it to defend an early dissolution.

The trickier scenarios for Labour are the first three. In the case of scenario one, Brown might well be tempted to carry on with, at most, an informal understanding with the Lib Dems on a handful of issues, such as Europe and the fight against child poverty.

With scenario three – parity between Labour and the Tories – the Lib Dems would appear to have maximum power. In practice, however, Cameron would be in a stronger position than Clegg. Because of Britain’s political geography, parity in seats would mean around two million more Tory than Labour votes. The public will think that Cameron deserves to become prime minister.

Brown, in contrast, will lead a party that is seen to be unpopular and in decline. He also knows that if he tries to carry on, and subsequently gets outvoted in the Commons, he will not be able to call a second election. Our unwritten constitution doesn’t lay down clear rules, but it is generally accepted that any prime minister is entitled to one dissolution when they want, but not two in quick succession. So Brown would in practice have to resign, unless he could be sure of a robust coalition with the Lib Dems that would last for some time. Were he to try to carry on and fail – either immediately or after a short while – Cameron would become prime minister.

Were I the Tory leader, I would wait for the prize to fall into my lap rather than seek a deal with the Lib Dems (though, again, the pretence of an offer is likely). My guess is that scenario three would lead within a few weeks to a minority Tory government, followed by a majority Tory government a few months later.

Scenario two presents the toughest dilemmas. Labour would still be the largest party, but it would probably have won around one million fewer votes than the Conservatives. Brown would not wish to quit: why should he simply hand over power to a party with significantly fewer MPs and risk a second election which Labour could lose badly? The horrifying vista of a decade or more of Tory rule would open up.

On the other hand, it would not be easy to carry on for any length of time without some kind of understanding, however informal, with the Lib Dems.

Is such a deal possible? In a rational world it ought to be, because Clegg would be as keen as Brown to avoid a second quick election – the Lib Dems would share Labour’s fear of haemorrhaging more seats. On the other hand, the two men must avoid looking like two men thrashing around in the same leaky lifeboat, with no clear idea of where they are heading.

This means that any Lib-Lab deal must be, and seen to be, based on some clear political principles. Here’s one suggestion. The two parties would concentrate on the building blocks of British politics – our election system, the future of the House of Lords, party funding, civil liberties, maybe fixed-term parliaments – while agreeing on a small number of specific economic and social reforms. Brown and Clegg could then say: ‘Britain’s political system needs fixing. Together, we shall spend the next two years fixing it, and then call a further election to choose a new parliament under the new rules.’

Not all voters will like this. Many will dismiss it as a ploy by two failed parties to dodge the fate they deserve. But there is just a chance that it might work – both achieving some much-needed reforms, and keeping the Tories out at the subsequent election. And even if the Tories do return to power in a reformed parliament, the changes will have provided a worthwhile epitaph for Labour’s years in power.

That is one proposal. Other strategies could be considered. The key thing is to start planning them now, not wait until a hung parliament is suddenly thrust upon us.