There was a general election where I live yesterday and the television network started calling out winners long before all ballots were opened.

They turned out right on all accounts, and I’m not really surprised they did. I know that statistics are absolutely viable. Still, I’m curious. Assuming:

- we have opened $i$ out of $j$ ballots;
- we have $n$ candidates whose current scores are $c_1, c_2, c_3, … c_n$;
How can we calculate the certainty with which the leading candidate is the winner?

**Answer**

The main difficulty in practice is not the statistical uncertainty that a fluke streak of luck would have given one candidate more votes. The main difficulty, by an order of magnitude or more, is that **the ballots which have been opened are almost never an unbiased sample of the votes cast.** If you ignore this effect, you get the famous error “Dewey Defeats Truman,” which occurred with a large biased sample.

In practice, voters who favor one candidate versus another are not equally distributed by region, by whether they work during the day, or by whether they would be deployed overseas hence would vote by absentee ballots. These are not small differences.

I think what news organizations do now is to break the population into groups and use the results to estimate how each group voted (including turnout). These may be based on models and prior assumptions based on previous elections, not just the data from this election. These may not take into account oddities such as the butterfly ballots of Palm Beach.

**Attribution***Source : Link , Question Author : zneak , Answer Author : Douglas Zare*