I promise this is not a politics post. It just uses some vote totals for some fun math!
The Minnesota senate race has so far a total of 2,422,811 votes between the two leading candidates. The margin separating them is 477. It’s about as close to a 50:50 split as we’ve seen this cycle. Probably in the last several cycles.
Now let’s say you have a perfectly fair coin that has a probability of 1/2 of landing heads and 1/2 of landing tails. For any given string of coin tosses you won’t expect to have an exactly even number of heads and tails. flip the coin 10 times and you wouldn’t be totally shocked to get something like 8 heads and 2 tails. In fact, the probability is a little over 4%. The way we know this is by invoking the binomial distribution. Here is is, specialized for the case of p = 0.5.

That gives you the probability of flipping k heads in n flips. For fairly small n and k this works fine. But let n be more than two million as in this case and those factorials become intractable. There’s some approximations that can help, but those only do so much before they get swamped too. And we’re going to be interested in computing standard deviations which means summing over all the possibilities… no way in the world. Too hard. We need a better approximation.
Fortunately as n gets large the binomial distribution gets closer and closer to the normal distribution in shape. In particular for large n, the binomial distribution looks like a normal distribution with a mean as expected of np. The standard deviation is np(1-p). And with a tiny bit of calculus that’s pretty easy to work with.
But we don’t have to work with it, we just want to standard deviation. That standard deviation is a measurement of the average spread, so to speak. Flip a coin ten million times and you expect to get five million heads on average. But you would be very surprised to get five million exactly. In practice there will be some spread. The spread is less than the standard deviation about 2/3 of the time. So for that million coin flip, most of the time the number of heads will be within (it turns out) 1581 of that expected 5,000,000 number. The larger the number of flips the larger the spread, but the smaller the spread is as a percentage of the total number.
For the number of votes in the Minnesota contest, the spread would be 778. So in other words if every single voter picked a candidate a random with a truly 50:50 chance there would on average be about a 778 vote gap between the candidates. Yet in the actual election the spread is even closer than that. Such a close election wouldn’t be very likely even if the electorate were truly exactly evenly split.