No Variance in Monte Carlo Simulation I wanted to do a Monte Carlo simulation for some of the electoral districts in my state in the upcoming US midterms. My methodology essentially was as follows:

*

*I have a list of populations and vote percentages per district averaged over the last few elections

*To simulate one district, I generated one random number per voter and then checked if it was above or below the percentage of Democrats out of 100. If it was below, the vote was counted as a Democratic one, and as a Republican one if not. All of the votes are then tallied to see who wins the district.

*I then ran the simulation 100 times to generate a probability for which side would win the election in the election.

The thing that is confusing me is that I get much less variance than I expected. If the vote percentage is exactly 50/50, I get about 50% for the result of the election (as one would expect). But if I make it 49/51 democrat/republican, the republican wins 100% of the time. And if I make it 51/49 democrat/republican, the democrat wins 100% of the time. In real life, I would expect there to be more variance between these -- there should be at least some cases where a democrat could win in a 49/51 district, right?
Here's the MWE of my code, in Python:
def sim_district(population, percent_dem):
    votes = np.random.rand(population)
    dem = len([x for x in votes if x <= percent_dem])#tallies democrat votes
    rep = len([x for x in votes if x > percent_dem])#tallies republican votes
    if dem > rep:
        return True #democrat election win
    else: 
        return False #republican election win

demwins = 0
repwins = 0
for x in range(100):
    if(sim_district(87559, 0.51)):
        demwins += 1 #tallies democrat election wins
    else:
        repwins += 1 #tallies republican election wins


print(demwins/(demwins + repwins))
#with an average democratic vote share of 51%, I get democrats winning this district 100 out of 100 times

I guess my question is: am I doing something wrong statistically/mathematically that's resulting in less variance in the results? Is this just the law of large numbers saying that simulating 80,000 votes in a 49/51 district will always result in the 51 winning (as opposed to simulating 10 or 100 votes)? Or is it just my expectation of 49/51 having more variance that is incorrect?

There is probably nothing wrong in your code.
I have to admit I didn't check the code itself. We are at CrossValidated, not Code Review, after all, so I'll argue statistically.
What you are looking for is the probability that sampling $80,000$ votes with a success probability of $0.49$ gives less than half successes, or at most $39,999$. This is simply the cumulative distribution function (CDF) of the binomial distribution with parameters $n=80,000$ and $p=0.49$, evaluated for $k=39,999$. In Python:
from scipy.stats import binom
binom.cdf(39999,80000,0.49)
# 0.9999999921577211

It is practically certain that your voting will yield the results you have observed.
Conclusion: people's political preferences and voting is probably not very well described by a simple binomial distribution. But now we are in Politics territory...
