It's a principle of Australian democracy that every vote counts - and is counted. But as results continue to trickle in from Saturday's council elections, many voters will be surprised to learn theirs won't necessarily be.
The electoral commission's approach to vote counting is under fresh scrutiny as an expert warns its "buggy" method of sampling and projecting results in favour of counting ballots individually has likely resulted in two recent cases of the wrong person winning positions on NSW councils.
While voters' first preferences are counted in full, the NSW Electoral Commission instead calculates voters' later preferences by choosing a random sample of ballots and then extrapolates results using a secret computer code.
"People are seriously shocked when they hear that their votes aren't counted in local elections," said Greens MLC David Shoebridge. "There are a number of tight races with multiple candidates and complicated preference flows where this could make a difference and the wrong person gets elected".
Vanessa Teague, a Senior Lecturer in Computing and Information Systems at the University of Melbourne, has long been critical of the reliability of the commission's counting system.
She crunched the numbers on past council elections and highlighted at least two recent cases where the approach probably led to the wrong candidate being elected.
Dr Teague found that had the Commission's software correctly counted votes in 2012, there was a 90 per cent chance that a candidate for northern NSW Griffith Council would have been elected but for a "bug" in the software and the influence of random sampling.
And at last year's half-council election Dr Teague estimates another candidate, in Yass Council, had a better than even chance of being elected, but was not, because of the influence of sampling.
"It could be the sample that is taken is not very representative," Dr Teague said. "The effect is, particularly when we've got to the very last couple of candidates ??? the random selections can have a huge impact.
"In a handful of cases if it's very close in those last couple of seats ??? there are actually two or three different winning candidates who come up when we run [the results again with] different samples".
Aside from problems with sampling, Dr Teague is critical of the NSW Electoral Commission for refusing to release the code it uses for counting votes as the Victorian and ACT commissions have.
"It's buggy," she said, noting that she identified two further errors in the 2016 council elections in addition to the probable election of the wrong candidate. "They probably didn't make a difference, but it's not clear".
Preferences are likely to be determinative of the control of council ballots still being counted this week, particularly in the new Inner West Council, where the final two seats at least are likely to go down to a preferences duel.
A spokesman for the Electoral Commission said that it was required by law to use random samples to distribute ballot papers.
"Some Electoral Commissions have made their source code public, whilst others (including the Australian Electoral Commission and the NSW Electoral Commission) have used a [private] certification process to validate their software," the spokesman said.
But Dr Teague said both she and other experts at the Australian National University had found four instances of bugs in code that private certifiers had signed off on as valid.
Parliament's Joint Standing Committee on Electoral Matters is currently examining whether the system of random sampling is accurate and delivers fair results, and will report back in mid-November.