The system that sets public spending in Scotland, Wales and Northern Ireland is known as the Barnett funding formula, named after its inventor, the former Labour Treasury secretary Joel Barnett, who devised it in the late 1970s.

One of the reasons it is so controversial is that it has led to public spending per head being typically 20% higher in Scotland than in England. Last year under the formula, Scotland got £10,152 per head, Wales, despite being much poorer, got £9,709, and England got £8,529.

The formula is calculated partly by the population of each nation and partly on which powers each nation has devolved to them. Some departments are almost fully devolved, such as education and health, while others are partly so.

In 2010 the Conservatives said the Barnett formula was reaching the end of its useful life, but David Cameron and the two other main party leaders, Ed Miliband and Nick Clegg, have vowed that it will continue.

In a paper in 2011 (pdf), the Welsh assembly gave the following example of how the Barnett formula worked. If the UK government increased its spending on transport by £100m, then the calculation would be £100m x 0.731 x 0.0579 = £4.23m.

The formula assigns transport a comparability percentage – relating to the extent to which services delivered by UK government departments correspond to services for which, say, the Welsh government has responsibility – of 73.1% for Wales, and Wales's population is 5.79% the size of England's. Therefore, the Welsh Barnett consequential would be an additional £4.23m.