Category Archives: election systems

Apportionment 1

The interactive examples in this post require installing Wolfram CDF player, which is free and works on most desktop computers using Firefox, Safari and Internet Explorer, but not Chrome.

Notes on viewing.

Election systems

This post begins a new thread in Gyre&Gimble: Election systems.  In 1968 I created a game called Parlement and ran a few games by mail before being absorbed by family and career.  In it you ran a political party in a parliament in the style of many European countries: The parliament forms a government, votes on bills & budgets, then an election is held where each party runs on its record.

My interest in election systems has continued sporadically since them.  Since the nineties I have been programming in Mathematica and made stabs at implementing various systems for achieving proportionality. Now I expect to devote several posts to Mathematica demos of election and apportionment systems.  

Proportional representation

An elected body is chosen by a list method of proportional representation this way: 

  • The election is by districts, each electing several members.  In most cases the number of seats each district has in the body is fixed ahead of the election. 
  • Each voter votes for a party list.
  • The proportion of the integer number of representatives that party will have out of the total number of seats alloted to the district is chosen to be near to the proportion of votes the party list receives out of the total votes.
  • The method for choosing the number of seats for the party can be any one of many methods proposed in the past 200 or so years.  Only a few methods are actually used in practice.
  • Once the number of members for the party is determined, that many persons on the list are chosen according to some method.  There are quite a few different methods used for this.  I will not write about this aspect at all.

This post looks at the method of equal proportions. This method may also be used to apportion the legislature of countries such as the USA that has states or provinces so that each state has a suitably proportionate number of seats.  For most of the history of the USA, that method has been the method of equal proportions, but in the early days other methods were used.

My impression is that the equal proportion method is the most common method used in legislatures elected by the list system, and is also the most common method used for apportioning legislative seats among states or provinces.  There is much information about these things scattered over many articles in Wikipedia, and a close study may prove me wrong about this. 

Note: The summary above is oversimplified and leaves out many details.  The references list more details than most people would ever want to know.

The equal proportions method

Several sites listed in the references describe the equal proportions method in detail.  The method for calculation used in the demo (there are others) works this way:  

  • Create a list $V$ of weights indexed by the party number.  
  • For proportional representation for parties, each party starts with $0$ seats and  $V_p$ is initially the number of votes party $p$ has for the district.
  • For state representation, each state starts with $1$ seat and the the initial $V_s$ is the number of votes state $s$ receives divided by $\sqrt{2}$.
  • Suppose $S$ seats are to be assigned . 
  • Assign the first one to the party $m$ for which $V_m$ is the maximum of the list $V$.  (In the case of states, this is the first seat after the initial one.)
  • Change the list by setting $V_m:=\frac{V_m}{\sqrt{2}}$ ($V_m:=\frac{V_m}{\sqrt{6}}$ in the case of states).
  • At the $k$th step, if $n$ is the party for which $V_n$ is the max of the list $V$ in its current state, assign the $k+1$st seat to party $n$ and set $V_n:= \frac{V_n}{\sqrt{u(u+1)}}$ (the geometric mean), where $u$ is the number of seats party $n$ had before the new one was assigned. 
  • Stop which $k=S$. 

Interactive demos of the method of equal proportions

To manipulate these demos, click on "Enable Dynamics".  At present the demo has a bug that makes the table pink (Mathematica's way of giving an error message). Move any slider and the pink will disappear forever.  The demos are also available on my website: PartySimple.cdf and PartyComparison.cdf.  If you download them onto a machine with CDF player installed and run them the pink table does not happen.  I can't imagine what could cause an error like that only when run embedded in html. These notebooks are available for free use under a Creative Commons Attribution-ShareAlike 2.5 License..

Both demos have the same controls.

  • Five sliders labeled n1 through n5 control the number of votes they get in the election.  
  • The bottom slider controls the number of seats that district gets to elect.
  • By moving a slider you control the information it represents.
  • By clicking on the plus sign to the right of the slider, you toggle a list of controls below it.  The party vote sliders begin with the controls invisible and the seats slider begins with them visible.

How the EP method works

The demo below assumes that five parties, numbered 1 through 5, are running to get seats in the elected body.  You may change the votes (Column Votes) received by any party, and also the total number of representatives to be chosen (Seats).

Data

  • Total votes is the total number of votes received by all five parties.
  • Seats is the total number of representatives assigned to the elected body. It can be changed using the Seats slider.
  • Quota is Total votes divided by Seats.  Some systems use slight variations on this quota.
  • The Name of the party is given just as a number.  In a suitably fancy demo you might give each party a real name.
  • Votes is the number of votes the party receives in the election, controlled by the relevant slider.
  • SeatsAsgd  is the number of seats the equal proportions method assigns to that party.
  • Weight: This number is $\frac{\text{Votes}}{\sqrt{\text{SeatsAsgd}\times(\text{SeatsAsgd}+1)}}$

Playing with the demo

  • Start with any settings for the sliders, and press the $+$ button underneath the seat slider. This allots one more seat to the representatives.  
  • You will see that the party with the largest weight gets the new seat.  That is how the method works: The algorithm starts with no seats and adds one at a time until the correct number of seats is reached.
  • The weight is a function of the number of seats allotted to the party. 
  • Try changing the Votes for a single party, letting the total number of seats remain the same.  Which parts of the data get changed by doing this?  Do you understand why?
  • Try changing the votes for all the parties, so that one has most of the votes and the others have only a few votes apiece.  Start with Seats at zero and step the seats up one at a time.  Notice what happens in column SeatsAsgd and what happens to Weight.

 

 

 

How close to an accurate apportionment does it get?

  • Quota is Total votes divided by Seats.  Note how it changes when you move any slider.
  • The Name of the party is given just as a number.  In a suitably fancy demo you might give each party a real name.
  • Votes is the number of votes the party receives in the election, controlled by the relevant slider.
  • SeatsAsgd is the number of seats the equal proportions method assigns to that party, given the total number of Seats allotted.
  • SeatsIdeal is the party's Votes divided by Quota.  Note that this is generally close to SeatsAsgd, which is usually but not always either the floor or the ceiling of SeatsIdeal. Try to find a setting where that is not true (hint: Give one party most of the votes.)
  • VotesPerSeat is Votes divided by SeatsAsgd.  Compare it to SeatsIdeal.  They are usually close, but can  be quite far off if only a few Seats are assigned.
  • Deviation is VotesPerSeat divided by Quota.  This is a relative measure of how far away from exactness the representations of the parties are.

Playing with the demo

  • Move Seats down to 2 or 3.  Notice that the deviations are quite bad, even $40\%$ off sometimes. Move Seats  up and see that deviations get much better.  Can you understand why that happens?
  • Note that usually Seats is either the integer just below SeatsIdeal (the floor) or the integer just above it (the ceiling).  This is reasonable and is called "keeping quota".
  • Make one or two parties large and the others small, then move the Seats slider around.  You find examples where Seats busts through the ceiling, "breaking quota".  Sometimes Seats is several units bigger than the ceiling. 
  • Note that if you step Seats up one at a time, the only thing that ever happens is that one party's seats goes up one unit.  Some other common systems cause some other party's seats to go down occasionally when the total seats is incremented.  That obviously never happens with EP.  

 

About demos

These demos were designed for people to learn about a concept by experimenting with them.  Such demo should be fairly simple with only choices and displays relevant to what you are trying to show.  

You can also build elaborate CDF's. Elaborate Riemann Sums Demo.nb contains a command PlotRiemann which allows for many options showing different kinds of Riemann sums with different options, and you could design a single demo of apportionment with many buttons, sliders and other gadgets that allow for all sorts of possibilities (but I have not designed such a monster).  

I do expect to eventually design a command such as PlotRiemann that does for voting systems something like what PlotRiemann does for Riemann Sums, but the way to do that is to create one feature or option at a time.  I will be doing that and they will result in other election systems demos that I will post here from time to time.  (Promises, promises).

References 

 

Notes on Viewing  

This post uses MathJax. If you see mathematical expressions with dollar signs around them, or badly formatted formulas, try refreshing the screen. Sometimes you have to do it two or three times.

To manipulate the demo in this post, you must have Wolfram CDF Player installed on your computer. It is available free from the Wolfram website. The code for the demo is in the Mathematica notebook Equal Proportions.nb.

Send to Kindle