Independent Catherine Connolly is right now fighting tooth and nail to overhaul FG’s Sean Kyne, who beat her to the last seat in Galway West by 17 votes in the first recount last night, prompting her to call a second full recount which is continuing as I type. But a thought struck me in the car on the way home this evening – STV as practised in the RoI is not deterministic, as there is a random element in the distribution of elected candidates’ surpluses. Surely 17 votes is less than a standard deviation? I had to find out.
STV in NI is deterministic: all the second preferences of an elected candidate’s votes are counted and then scaled down by the surplus fraction before being transferred, resulting in fractional votes for the remaining candidates. For example, say that the quota is 900, and candidate A is elected with 1000 votes. The next preferences of all A’s votes are counted and the totals scaled by a factor of (1000-900)/1000 = 1/10 before being added to the appropriate candidates’ totals. A is left holding the balance, which equals the quota, and the total number of votes in play at any stage thus remains constant. In this way, each vote for A is treated identically.
By contrast, in RoI general elections only surpluses attained on the first count are scaled. Subsequent surpluses are transferred using random selection. Instead of counting all votes and scaling down, a random sample of votes equal to the surplus is counted and then distributed at full value. Furthermore, only the last batch of votes given to the candidate is eligible for selection. For example, say candidate A has 800 of the necessary 900 quota, and candidate B with 200 votes is eliminated. A is elected with 1000 votes, a surplus of 100. To distribute this surplus, 100 of the 200 votes which were transferred from B are randomly selected (A’s other 800 votes are ignored). These are then counted and transferred accordingly. Again, A retains 900 votes (the quota) and the total votes in play are constant, however not all of A’s votes are used.
This random element introduces sampling errors – a different choice of 100 random ballots may well produce a different result, and even get a different candidate elected. We can use standard statistical methods to estimate the errors in these processes and determine how much the candidates owe to the voters, and how much to chance.
Consider count 11, the distribution of Nolan’s surplus of 326. We pick 326 ballots from O’Clochartaigh’s transfers to him of 1015, as those transfers were the ones that pushed Nolan over quota. Now, the p=.95 error in a random sample of 326 out of 1015 is 4.47%, and 4.47% of 326 is approximately 15. Therefore we can expect a 15-vote variation either way in the distribution of Nolan’s surplus. The equivalent error for O’Cuiv’s surplus is (1034 of 2101) -> 22 and for Walsh it is (116 of 2706) -> 10. Assuming that each random choice of ballots is independent, the expected error in the final count is sqrt(15^2+22^2+10^2) =~ 28. We can see that a victory in the final count by 17 votes is not a statistically significant result, and therefore has more to do with what order the ballot papers fell out of the boxes than how many went into them in the first place.
What does this mean for the candidates? Not much, as the legal method has been followed. It does however show that haggling over low double-digit margins of victory has nothing to do with the will of the electorate. They might as well just toss a coin for it.
The vote totals for eliminated candidates are assumed to be error-free, even though prior surplus transfers will introduce small errors. These errors make little difference to the results as the error bar formula is relatively insensitive to population size.
Numbers were taken from the first recount data in @misteil‘s spreadsheet here. Error bars were calculated using the utility here. The rules for STV in RoI general elections are here. Thanks also to @garygillanders for pointing out a mistake in my original calculation.