Calculation of Voting Power

This is a project hosting software for calculating the voting power of voters with weighted votes in an assembly.

The software is open source and released under the terms of the BSD license.


A common error is the assumption that, in weighted voting, the power of a voter is their voting weight. In reality, although the weight of a voter is important, we must take into account the weights of the other voters, as well as the decision making rule, in order to arrive at a conclusion about the actual voting power each participant in the vote has.

The term voting power refers to an index that captures the power of a voter to influence the outcome of a voting process. There have been several definitions of voting power in the literature, although they remained outside the discussions of mainstream politics until late in the 20th century; what's more, definitions of voting power were proposed, forgotten, and reinvented during the years. Perhaps the most intuitive definition is the one given by Lionel Sharples Penrose in 1946; according to this definition, the voting power of a voter is the probability that they can swing the vote. This is known as the Penrose index or the Penrose Banzhaf index, after John Francis Banzhaf III who reinvented the index in 1965.

The index is as follows:
  • Suppose we have n voters, each with a specified weight.
  • The voters are free to vote as they please.
  • All votes are yes or no.
  • There is a rule that decides when a vote passes; it may be 50% of the weights of the proponents (simple majority), or some other figure; in addition, it may require that a number of voters also support (a given quorum).
  • A voter is critical in a vote if without them the vote does not pass, but with them it passes. That is, the vote must be a swing vote, decided by the voter.
  • Count the number of critical votes for a voter.
  • Take all possible partitions of voters in yes and no camps.
  • Divide the number of critical votes for a voter by the number of all possible voter partitions.
  • The result is the probability that the voter can swing a vote.

The above definition does not lead to a practical procedure for non-toy problems, as suffers from combinatorial explosion regarding the enumeration of swings and the partitions; hence, one has to find an alternative method to calculate it for many real-world assemblies.

The Software

The software consists of a Perl script that calculates the Penrose index. It calculates the index by a Monte Carlo method: it generates a large number of voter groups and determines the percentage of those where a voter is critical; this is the Penrose index for the voter. Currently it does not give a confidence interval for the estimate it provides; however, since there will be a number of voters with identical weights, one can check how accurate the results are by noting the differences between voters with identical weights.

To use the program, type

perl < voter_file

The input file is a text file containing in each line the id of the voter, a colon, and the number of votes, e.g.:


(These were the weights of the countries that formed the first European Economic Community in the Treaties of Rome in 1957 - 1958. Interestingly, Luxembourg had a vote but no voting power.)

If you want to work with coalitions, then you add the votes for all of them, you remove the individual voters and add one supervoter (standing for the coalition) in the input file. The supervoter's line can have an additional field that specifies the numbers of members in the coalition (this additional field, set to 1, will not hurt if present
in single voters). That means, if Belgium, Netherlands and Luxembourg always voted as a block, the correct voting power should be calculated based on the following file:


The operation of the program is specified by the following switches:

-q, --quorum
     Set the quorum (number of voters required to reach decision)
-s, --samples
     Set the number of samples
-t, --threshold
     Set the threshold (amount of votes required to pass)
-p, --percent
     Output results as percentages
-v, --verbose
     Outputs group information (very large output)
 -h, --help
     Print this help screen     


For questions, comments, suggestions, etc., you may contact its author, Panos Louridas. The address is the author's surname at the hosting organisation (grnet in greece).