November 12, 2018

The phrases "Every Vote Counts" and "Your Vote Matters!" are common ones to hear around elections. In most cases, though, elections do not come down to a single vote, so no single vote actually matters. This is especially true of larger elections and elections with one clearly-favored candidate.

That would be a boring and mostly uninformative end of the discussion, though. Elections are hardly an individual activity. Politicians, media, and various organizations influence people's decisions to vote and who to vote for, and those people in turn may do the same to those around them.

Most people are not media empires or highly-influential leaders, though. They can still, however, influence those closest to them.

Below I made a little application that shows you what the chances of your candidate(/referendum) winning are if you voted, and what the chances are that you would make a difference in the outcome.

The inputs are as follows:

- Total Votes - expected number of voters in an election
- Total Added Votes - The number of extra votes added to one side of an election. This would be you plus the number of people that you got to vote who otherwise would not have.
- Predicted proportion of votes - What proportion of votes is your candidate expected to win?
- Margin of error for proportion of votes - If you want to provide this, what is the margin of error (95%) of the above proportion?
- Predicted proportion of votes - What proportion of votes is the main opposition candidate expected to win? This is useful if there are third-party candidates who have a low chance of winning, but would still take a small chunk.
- Margin of error for proportion of votes - If you want to provide this, what is the margin of error (95%) of the above proportion (for opposition)?
- Use margin of error in calculations - A quick way to enable/disable use of margin of error in calculations

Total Votes (before addition):

Total Added Votes (You+others):

Predicted proportion of votes (as a percent):

Margin of error for proportion of votes (as a percent) **(optional)**:

Opposition predicted proportion of votes **(optional)**:

Margin of error for opposition proportion of votes (as a percent) **(optional)**:

Use margin of error in calculations

[Probability will appear here]

Number of Votes | Additional Votes | Supporting Prop. | Supporting Error | Opposition Prop. | Opposition Error | P(win) | P(made a diff.) |

To go through some examples of what these probabilities are like, I whipped up some calculations and visualizations in R to demonstrate basic concepts behind these calculations.

For an even 50/50 race out of 10,000 voters, a single extra voter has an 0.789% chance to change the outcome. This is pretty low, but not too unrealistic

.With 5 added friends, the probability of making a difference increases to 4.78%, which is a nontrivial amount, even if it is small. Because the value is closer to the peak of the curve, the amount of probability each additional person adds is roughly the same, just slightly lower.

When the odds are even slightly tilted, however, it is much less likely that a group will be able to make a difference. Note that there is a 25% chance that *if they do win*, then it is a result of the extra voters. This is still as unlikely as one person making a difference with 50/50 odds.

Unlike with the previous graph, the probability of winning added for each additional voter increases because it is moving up the bell curve, not down.

For very large elections, the chances are pretty small, but the size of the peak grows with the square root of the number of voters, so the effect scales down proportional to 1/sqrt(n_voters).

However, if the probability is even *slightly* off (in this case, 50.1% vs. 49.9%, usually considered statistically insignificant), the probability of making a difference is significantly reduced. Since most races are nowhere near this close, the effect that the margin-of-error has on the probability means that the chance of your vote or a small group of people's vote flipping the results is averaged over more low-probability regions than higher ones.

I mostly made this for fun, but there are a few things to note from this:

- A small group of people can have a nontrivial effect on the results of a close local election, even in the thousands
- For larger elections, even if they are "close", chances are that it will not come down to a single votes or even a few votes.

There are a few details to my implementation of this application to note:

- When there is margin of error, I take the two probabilities (winning and losing) and give them a -1:1 anticorrelation, and I run models using the middle 90% of the range of likely values
- When the total percentage between the two proportions doesn't add up to 100% (if both are provided), then I look at the middle 90% of likely numbers of votes shared by both candidates (as opposed to a third party) and weight models over those (similar to above)
- True ties are decided by a 50/50 coin flip (which removes bias/ambiguity from the results)

The full code for calculations can be seen here (for Python 2.7): https://github.com/mcandocia/examples/blob/master/voting_chances/voting_chances.py

Tags: