A memorable fortnight for election wonks got even better yesterday when one of the most arcane technical controversies known to psephology escaped from the laboratory and made a material difference to the result of the Victorian election.

Owing to a mathematical illogicality given practical effect by a flawed law, yesterday’s determination of the upper house result delivered a seat in the Northern Victoria region to Jaclyn Symes of Labor at the expense of Robert Danieli of the Country Alliance, the rightful winner according to the logic of the system.

At issue is the complex question of how a winning candidate’s preferences should be passed on after they achieve the quota required for election.

Say we have an election at which the quota is 10,000 votes, and a candidate with 9000 primary votes receives a bundle of 2000 preferences from a last-placed candidate who is excluded from the count. The candidate is elected with 1000 votes to spare, and this surplus must now be passed on to other candidates remaining in the count.

The question is, how are the candidate’s 11,000 ballot papers, acquired from two different sources, to be condensed into the requisite 1000?

Back when the proportional representation system was introduced for the Senate in 1949, there appeared to be only one thing for it — choose the votes randomly from the bundle of 2000 that pushed the candidate over the line to a quota. This monstrosity survives to this day in elections for the New South Wales upper house, although the introduction of above-the-line optional preferential voting in 2003 has greatly reduced the chances of it making any difference.

The failings of this system became a live issue at the double dissolution election of 1974, when Australia’s first Aboriginal MP, Neville Bonner, was elected from No. 3 on the Liberal Party ticket in Queensland.

According to Labor scrutineers, it appeared that a number of otherwise left-wing voters enthused by the idea of an Aboriginal parliamentarian had placed Bonner at No. 1 before allocating their next preferences to Labor.

However, Bonner only reached a quota when the surplus of the top two Liberal candidates was passed on to him, and the “last bundle” rule meant it was these ballot papers rather than his own that provided the votes for his surplus transfer.

It can never been known for sure, but it is entirely possible that the deficiency of this method caused a Labor candidate, Malcolm Colston (later to become synonymous with travel rorts), to narrowly lose out to Country Party candidate Glen Sheil (whose future claim to fame lay in his expression of support for apartheid). If direct votes for Bonner had been allowed to have a bearing on the result, as they logically should have done, the events of 1975 might have played out very differently.

When Labor next came to office in 1983, it sought to correct the anomaly by introducing the “inclusive Gregory” method, which includes every ballot paper that gets a candidate elected, but reduces their value so that the preferences in their totality are equal to the size of the surplus. When Victoria finally got around to introducing proportional representation for its upper house at the 2006 election, it adopted the Senate model.

But inclusive Gregory comes with a problem of its own, which was allowed through to the keeper in 1983 because Senate election counts were at that stage still conducted manually, and a trade-off was required in terms of complexity.

The issue relates to the infrequent occurrence of the same bundle of votes being passed on as a surplus at two different points in the count.

Logically, these ballot papers should be reduced in value twice — a notion that’s become known as the “weighted inclusive Gregory” method. But because the necessary bookkeeping was too hard, and the number of affected votes seemingly trivial, such ballot papers were allowed to revert to full value before the second reduction was applied.

With preference counts now computerised, there is no reason why this anomaly should continue to be suffered. And now, in Northern Victoria, we have a non-theoretical example of the problems it can cause.

As Antony Green explains in detail, Daniel Young of Shooters & Fishers won election after scooping up preferences from a number of sources, including the Coalition’s small surplus after its second candidate was elected.

Young’s election left him with a surplus of 3256 to pass on as preferences. But under inclusive Gregory, the value of the Coalition votes in Young’s pile was inflated at this point, as they were dealt with as a huge number of ballot papers and not as the very small surplus transfer that Young actually received.

This meant other preference votes received by Young from Palmer United, the Sex Party and the Cyclists Party were of correspondingly lesser value. Since preferences from these parties then passed on to the Greens, the Greens did not receive as many preferences as they should have. Had it been otherwise, Labor rather than the Greens would have dropped out at the last exclusion, and Labor preferences would have elected the Country Alliance, rather than Greens preferences electing Labor.

In an irony characteristic of the system, inflating Liberal votes at the expense of the Greens meant that the Greens rather than the Liberals ended up with the result they would have preferred. With the system riddled with such perversities, the inclusive Gregory distortion may well seem the very least of its problems.

Nonetheless, Labor can consider itself lucky to have obtained its 14th seat in the 40-member Legislative Council, and to have one fewer crossbench conservative to whom it must go begging to get its legislation passed.