For those outside Australia, or for those Australians who are living (or, understandably, hiding) under a rock, we've just had our national elections, at which our all of the seats of our government have been decided and half of the seats in our Senate (the house of review).
Though almost all of the seats in the lower house have been decided, which is normal for election night, the results for the Senate generally take days to weeks to be fully finalised. Though most of the seats are generally worked out fairly quickly - in particular, those seats going to the major parties - the remaining few seats are far less certain.
The use of the Single Transferable Vote system for the Australian Senate means that votes for minor parties go through a convoluted process of 'transfer' from candidate to candidate, which is further complicated by the Group Voting Ticket system and the deals made by minor parties with each other for preferences. What this means is that a party receiving a very small number of votes can obtain a seat in the Senate simply by the snowballing of preferences from other small parties.
This has been particularly apparent in this election, with the current estimated results by the ABC suggesting that as many as 8 seats are likely to go to parties outside of the main three (the Liberal/National coalition, the Australian Labor Party and the Australian Greens), with seats controversially likely to go to members from the Australian Sports Party and Australian Motoring Enthusiasts Party, which only received a tiny fraction of the initial vote. The popular media has already heavily covered these results even though they are still by no means yet certain.
Because of the above complexities, it can take only a small variation in voting to change the result for one or more seats. In this sense, the ABC's estimate is fairly naive: they assume that all voters have voted 'above the line', allowing their preferences to be decided by their chosen party (though this is not so far from the truth, with over 95% of voters generally doing so) and that the final results will be accurately represented by the results that have come in so far (between 50-80% of the vote for each state). Working out what potential bias there may be in the remaining votes is possible to a certain extent, as the voting information includes voting breakdowns for smaller regions (and can be compared with past elections), and some regions are known to have regular skews in their voting patterns.
What I've done here more simply, however, is to look at how much effect there might be in random fluctuations in the remaining votes to be counted. I assumed that the proportions of votes to each party so far were an accurate representation of the electorate's intent - based on those numbers, I randomly generated the remaining expected votes to be counted (based on current enrolment numbers and last election's turnout - around 94% on average).
For Tasmania, for example, my results usually follow the ABC's results - two each of Labor and Liberal senators are elected, one Greens senator, and one from the Palmer United Party are elected as expected. However, in about 4% of cases (for 1000 election runs) a member of the Sex Party is elected instead of the Palmer United candidate, and in a further 1% of cases a third Liberal Party member is elected.
Taking into account the other sources of fluctuation mentioned above adds to this uncertainty in the results - the Geeklections site and the Truth Seeker blog go into much more detail. This only goes to show that surprises are not only possible but likely as the counting continues...