Article

Modeling Elections

My post about the Russian elections on the Computerra Online blog (here it is on the CT site, and here it is on my site) provoked a fairly serious discussion there and here as well. What concerned me most was the claim that the effects I described are merely mathematical phenomena and do not indicate any falsification. Here I describe the results of simulating a random distribution of votes, which make it possible to refute those claims.

My post about the Russian elections on the Computerra Online blog (here it is on the CT site, and here it is on my site) provoked a fairly serious discussion there and here as well. What concerned me most was the claim that the effects I described are merely mathematical phenomena and do not indicate any falsification. Here I describe the results of simulating a random distribution of votes, which make it possible to refute those claims. First, a few words about the claims that troubled me. User bjaka_max, who took an active part in the discussion on the CT site, remarked that my statement that the distribution of precincts by the number of votes cast for a sufficiently popular party should shame those who taught me mathematics was wrong. "But the number of voters varies, and the number who voted for the party cannot be said to be independent of the number of voters. Then we divide one random variable by another that depends on the first. Will the distribution be normal? Of course not, it will be lognormal," writes this user. Among other things, he insisted that by accusing electoral commissions of falsification I should be held liable for defamation. Later he seems to have stopped insisting that the distribution should specifically be lognormal, but continued to ridicule me for saying that it should tend toward a normal distribution. User bjaka_max even posted in the comments something that is apparently some kind of program and placed links to graphs. He describes what he posted as follows: "a diagram from OpenOffice Calc: you take the output of the program, insert it as a column, and build a chart from it." Unfortunately, I do not have the named software, and, perhaps even more importantly, those instructions are not sufficient for me. On Bartachos, user protopostokolo asked me to comment on the correspondence between the images I provided and those placed here and on the following pages of a certain "Zanevsky Chronicle." The chronicler (let us call him that) writes that he generated results simulating the official election commission results using a random-number generator. He claims that when simulating precincts that differ in turnout, the result of the strongest party naturally increases as turnout rises. Here, take a look at the image borrowed from him. [IMG_1] Distribution of the percentage of the registered electorate as a function of voter turnout (taken from here) Well, yes, these pictures do vaguely resemble what we saw in the election results. The chronicler writes: "I will not draw any conclusions, and I will not invent any explanations. Let mathematicians deal with that. Let them try to explain how the distribution of the registered electorate even in an idealized model affects the increase in votes for the leading party. ... And whether these mathematicians are 'party-affiliated,' 'opposition,' or 'independent' (not only from party loyalties, but even from the multiplication table) is not so important..." I did not immediately believe the quoted claims, but I did not rush to refute them either. When one is dealing with models, they often display counterintuitive behavior. What if such effects really do occur, and I simply had not thought of them? So first I built a model. Alas, I do not know programming, so I used my favorite Statistic. To begin with, I created a table with 10,000 rows. I filled the first column of this table (Elec) with random numbers in the range from 0 to 1 (for this I entered the formula "=Rnd(1)" into the column). Based on these random numbers, I determined which candidate the voter corresponding to this row would support. For this I entered the formula "=(Elec<=0,49)*1+(Elec>0,49)*(Elec<=0,68)*2+(Elec>0,68)*(Elec<=0,81)*3+(Elec>0,81)*(Elec<=0,93)*4+(Elec>0,93)*(Elec<=0,96)*5+(Elec>0,96)*6" into the second column (named Party). This formula works as follows. If the value of the random number does not exceed 0.49, the corresponding logical condition is satisfied, and the result of the test is multiplied by one. If the value of Elec lies in the range from 0.49 to 0.68, then the value 2 goes into the Party column, and so on. The codes correspond to Russian parties, and the share assigned to them is determined by the percentages they obtained according to the election commission. The codes are as follows: 1 - PZiV (49%); 2 - KPRF (19%); 3 - SP (13%); 4 - LDPR (12%); 5 - Yabl (3%); 6 - other (4%). Next I simulated 1,000 precincts differing in turnout. As the Chronicler indicated, I specified a normal distribution of precincts by turnout. For this, using the formula "=0,6+RndNormal(0;1)" I obtained a normal distribution around the value 0.6 (60% turnout). This is what I got. [IMG_2] Distribution of 1,000 precincts by turnout used in the simulation Then for each column corresponding to a precinct, I defined a function by which the corresponding share of the ten thousand voters "votes" there according to turnout. For example, if 60% of voters vote at a precinct, the function for that column is: "=(Rnd(1)<=0,6)*Party". This mechanism ensures that the probability of a voter being assigned to a precinct does not depend on which party they vote for: in each cell, a random number (from 0 to 1) is computed and compared with the threshold value. And then it is quite simple. All that remains is to count how many votes at each precinct were cast for each party. Below is the distribution of the number of votes cast for the nominal party called PZiV, which corresponded to 49% of votes in the overall voter pool. [IMG_3] Distribution across 1,000 precincts of the number of votes received by the party for which 49% of voters vote These data are my answer to bjaka_max. If the probability that a voter turns out at a precinct is not related to which party they vote for, the distribution tends toward normal. Incidentally, this is exactly what I stated in my article from the outset. The difference is that there I stated it speculatively, based on my understanding of statistics. Here I have shown that a model built on the stated assumptions generates exactly the distribution I had predicted. And how is the share of votes for the leading party related to the turnout percentage? Exactly as I had assumed. [IMG_4] Dependence of the percentage of votes received by the party for which, on average, 49% of voters cast ballots, on precinct turnout The higher the turnout, the closer the result is to the mean (the law of large numbers takes effect). But if turnout increases not because of supporters of any one party, it does not shift the share of votes received by each party in any particular direction. I knew it. Well, this window demonstrates the invalidity of the Chronicler's conclusions. And why did he get a different result? I do not know; one would need to see how he set up the formulas. My hypothesis is this. The Chronicler wrote: "Purely hypothetically, let us assume that in our virtual world there are three parties differing in popularity: party 1, with 7 percent of supporters; party 2, with 23 percent of supporters; party 3, which receives the votes of everyone else." I suspect that the Chronicler used an algorithm in which supporters of the first party arrive at the precinct first, then those of the second, and only after them those of the third. And the conclusions drawn in the previous post nevertheless seem to be confirmed... Perhaps I should note, just in case, that I was far from the first to make them. After publishing my first article, I read other, better sources on this topic: in Troitsky Variant, Esquire, and an excellent resource on Ukrainian elections. I do not claim any priority, but I am still glad if I contributed to popularizing this approach. P.S. Following a reader's link, V.P., I found here: https://komelsky.livejournal.com/182941.html an excellent photograph. Reproducing it. Strange: for some reason, I also trust Gauss more than Churov or Kivalov... [IMG_5]