I made a Monte Carlo voting simulation. No particular reason, I just think it’s neat.
Okay, so I was thinking about the Median Voter Theorem, which says that the winning position in an election is the position of the median voter. Of course, this conclusion only holds under certain assumptions, and none of those assumptions are actually true. And yet the conclusion is approximately correct in many situations. That’s why we care disproportionately about the median congress members (like Susan Collins), the median Supreme Court Justices (like Roberts), and the median “swing” states (like Pennsylvania).
But it should be obvious that the median voter fails in a lot of ways. In particular, it doesn’t predict the political polarization that occurs in US politics. And there are plenty of possible explanations: voter turnout, third parties, primary elections, politician’s charisma factors, multidimensional political spectra, and so on. But I’m not sure which among those explanations are most important.
The voting simulation won’t answer any of these questions, I’m just setting the context. One of the assumptions of the Median Voter Theorem is that political preferences exist along only one dimension. I thought I’d try running simulations with two dimensions to see what would happen, and to make some pretty graphs.

Voters and candidates in a 2D space