About STV

Information and resources relating to STV in general and election methods supported by OpenSTV in particular.

Bibliography of STV books/papers

John Stuart Mill: "Of True and False Democracy; Representation of All, and Representation of the Majority only", Chapter 7 of Considerations on Representative Democracy (1861)

Henry R Droop: On Methods of Electing Representatives (1881)

Brian L Meek: A New Approach to the Single Transferable Vote: Paper I: Equality of Treatment of voters and a feedback mechanism for vote counting (1969)

Brian L Meek: A New Approach to the Single Transferable Vote: Paper II: The problem of non-transferable votes (1970)

Voting matters: "To advance the understanding of preferential voting systems"

STV Database

Brian Wichmann has created a database of election results for different preferential voting methods. Hundreds of ballots files are used and some are data from real elections.

Updated 30 October 2005.

A Guide to an STV Database

Contents

1  Introduction
2  The system
3  The two main tables
4  Using the database
    4.1  Using the election data information
    4.2  Using the result information
    4.3  Using both tables
5  Programs used
6  Related information
7  Likely extensions
8  Problem areas
9  Acknowledgments
A  Installation on you own machine

1  Introduction

This Guide is for a small database concerned with Preferential voting, as used in Single Transferable Vote elections. Given an example election in which a number of seats is contested between several candidates, the preferential votes can be counted in a number of ways. The Republic of Ireland, Malta, the Church of England and Northern Ireland all use STV but with slightly different counting rules. This database is designed to aid in the analysis and research into such systems.
There are two ways of using this database. You can access the database via the Web at https://phpmyadmin-s.sourceforge.net (you will then get a login page to which you need to give the user name s91982ro aand password stv), or you can download the content of the database from the same site and then set it up on your own computer using MySql. This manual is designed for either situation, but the emphasis is on the Internet version. On the SourceForge system, after logging in, select the data base s91982_stvdb.
The SourceForge system has a number of limitations. It is set up to restrict the maximum number of joins. Some of the examples below have a command before the main query of: SET MAX_JOIN_SIZE =4294967295; This need not be included if you are using MySQL on your own computer.
The database is free and it is hoped that others will contribute to the information within it.
As an example of the type of problems the database is designed to resolve, David Hill reports an election (to elect 2 from A ... F) for which:
Elects AD Elects AC
ERS 97 ERS 76
ERS 72 Sequential STV
Meek Church of England
Northern Ireland General Medical Council
Methodists Gazeley's Exhaustive STV
Warren Woodall's QPQ
New Zealand
However, if B, E, and F are withdrawn, all methods elect AC.
It is easy to locate this and similar cases to this as we will demonstrate later.

2  The system

The database is really a component of a bigger system, as it merely acts as a repository of properties of some preferential voting data and the application of counting rules to that data.
In fact, the database is currently just two MySql tables: one of those storing properties of the preferential election data and the other the results of running counting rules on the data. At this stage, no attempt has been made to check the material other than via the use of MySql - all the examples here use MySql. Users not familiar with MySql will probably need to consult the user manual (but you may well be able to manage by using and adapting the examples given here).
For the election data, there are seven categories denoted by a single letter. In alphabetical order they are:
C:
The capacity tests, which are mainly machine generated, to demonstrate the capacity to handle large elections.
F:
The full-disclosure tests. These are from actual STV elections in which the full details are available. This implies that the candidate names are those of real people, etc. Currently, there are very few in this class.
M:
The mock tests. These are like real elections, many modelled on Irish result sheets, which are all machine generated. Data in this class have been used to explore the likely behaviour from changing an election rule.
R:
These are the real tests, collected from actual STV elections. However, the full details are not available - the source is not available. Some details of the type of election is typically available.
S:
These are the semi-real elections. They are based on real elections, but are not strictly appropriate for the real (or full disclosure) categories above. A typical example are the Eurovision Song Contest, since they use a points system, but that can be transliterated into preferential voting. Another example are elections in which equality of preference was used.
T:
These are the test category and arise over special cases in the logic of at least one STV counting rule. This set is large and complex which implies that an SQL search facility is very useful.
(There is another class D which is not used in this database.)
Purists will state that the class is a property of the data which should be stored separately in the database, rather than being part of the data itself. However, the current scheme works and predates the MySql database.
An individual election is denoted by one of the letters above followed by three digits. The actual data file for the election is like: C012.BLT. From a logical analysis point of view, the T class is the most useful, but from the point of view of what might happen in real elections, all the others are most useful. The term election is used here even though for the T class no such election took place.

3  The two main tables

If you go to the Internet site http://stv.sourceforge.net/, log in to the database, and then select Databases, you will see on the column on the left, the two tables: BLT_info and Result.
Select BLT_info which then produces a screen full of a small part of the contents. Then select the left-most item at the top of the screen marked Structure. It is the structure of the two tables which is important (the entire contents is too large to be immediately useful). This table records the main characteristics of the ballot data from more than 700 elections.
You will now see a list of the items in the table as follows:
ID:
The four characters denoting the name of the election, such as C012 an example in the capacity class.
Title:
A string of up to 50 characters giving the title of the election.
Candidates:
An integer giving the number of candidates.
Seats:
An integer giving the number of seats.
Votes:
An integer giving the number of valid votes.
Invalid_votes:
An integer giving the number of invalid votes. (This is only meaningful for real elections and for testing counting software.)
Total_Prefs:
An integer giving the total number of preferences from all the votes.
Withdrawn_Candidates:
The data files have a facility for withdrawing a candidate before the actual election count. This is not used often and hence this integer is usually zero.
Zero_First:
This is the number of candidates who have no first preferences. Like the previous field, this is usually zero.
No_Support:
This is the number of candidates (usually zero) for which no preference has been expressed in the votes.
Largest_Pile:
The BLT file format allows for a pile of papers with the same preferences to be recorded together. This is very useful for constructing test cases with a large number of votes. If the value is 1, then this facility is effectively not used for that BLT file.
Smith_Set:
The set of candidates ranked higher that any member outside that set (see [5]). For those data sets which do not exhibit a Condorcet paradox, this set consists of a single candidate. (A Condorcet analysis could be regarded as a type of STV `election', but this is not quite right since the size of the set is determined by the data, not the number to elect.) This value is recorded as a text string using the number of each candidate. Hence [1,3] would imply that the first and third candidates were ranked higher than any other, but that neither candidate 1 nor 3 were ranked higher than the other.
Single_Prefs:
This gives the number of votes for which only a single preference is given.
Source:
A text string giving the source (if known). This might be a URL for information from the Internet.
Comment:
A string recording information which might be useful and is not otherwise available.
Extra_Doc:
This is recorded as Y if extra documentation is available, and as N otherwise. This additional information is recorded at the end of the BLT file. This is needed when a one or two sentences in the Comment field is not sufficient.
The other main table gives the results of applying a number of election rules to the ballot data. Selecting the table Result and then Structure (as before) one can see the fields of the table which are as follows:
ID:
The four character identifier of the election as in the other table.
Rule:
String giving the identification of the rule being used.
Elected:
The set of those elected by the rule above recorded as per Smith_Set field in BLT_info.
Stages:
Number of stages (assumes the rule has stages!).
Random:
Number of random choices made, often 0.
First:
Number whose first preference votes greater than or equal to the quota (can be one more than those elected).
Tie_Break:
This is for the form of tie-breaking undertaken: 'S' sequential, 'R' random in repeatable fashion, 'T' random in non-repeatable fashion.
Program:
A string giving the program (with version) and relevant options.
The fields of these two tables are used extensively to find interesting election examples.

4  Using the database

It is now easy to make simple lists of the all the elections in order of votes, say. We give more interesting example below.
Some examples now appear of the MySql input (in red) and output (in green). You can paste the input into your own system or the Web system to try out using the database. On the Web, select the third item in the top row marked SQL, and then paste the example into the SQL window and clicking on Go.

4.1  Using the election data information

One important aspect is the total number of elections in the six classes noted above. This can be found by:
SELECT LEFT(X.ID, 1) AS "Class", SUM(X.Votes) AS "Total votes",
       SUM(X.Candidates) AS "Total candidates", SUM(X.Seats) AS "Total seats",
       SUM(X.Total_Prefs) AS "Total Preferences", COUNT(*) AS "Number in class" 
FROM BLT_info X
GROUP BY LEFT(X.ID, 1);

With the Web version of the database, the results look slightly different as they are tabulated without using monospaced fonts.
The result of this is:
+-------+-------------+------------------+-------------+-------------------+-----------------+
| Class | Total votes | Total candidates | Total seats | Total Preferences | Number in class |
+-------+-------------+------------------+-------------+-------------------+-----------------+
| C     |     9844664 |              919 |         206 |          48635283 |              23 |
| F     |     2790567 |             1182 |         299 |           7154306 |              72 |
| M     |    13428201 |             4940 |        1631 |          68078691 |             385 |
| R     |       45311 |             1269 |         494 |            276363 |             119 |
| S     |      204049 |             1102 |         285 |            343927 |              49 |
| T     |     2658466 |             1414 |         788 |           5783467 |             192 |
+-------+-------------+------------------+-------------+-------------------+-----------------+
6 rows in set (0.02 sec)

The number in the full disclosure class (F) is small enough to list the key aspects:
SELECT X.ID, X.Title, X.Votes, X.Seats, X.Candidates
FROM BLT_info X
WHERE LEFT(X.ID, 1) = 'F'
ORDER BY X.Votes;

giving:
+------+----------------------------------------------------+---------+-------+------------+
| ID   | Title                                              | Votes   | Seats | Candidates |
+------+----------------------------------------------------+---------+-------+------------+
| F072 | Stanford Sophomore Class Presidents 2001           |    1022 |     1 |          8 |
| F035 | New Zealand, Taieri Subdivision, 2004              |    1716 |     2 |          4 |
| F034 | New Zealand, Otago Peninsula Community Board, 2004 |    1789 |     6 |          8 |
| F032 | New Zealand, Saddle Hill Community Board, 2004     |    2005 |     6 |          9 |
| F033 | New Zealand, Chalmers Community Board, 2004        |    2036 |     6 |          8 |
| F012 | ASUCD Senate Fall Election, 2003                   |    2447 |     6 |         16 |
| F028 | New Zealand, Porirua City, Western Ward, 2004      |    2631 |     3 |         11 |
| F031 | New Zealand, Waikouaiti Coast-Chalmers Ward, 2004  |    3320 |     1 |          4 |
| F070 | ASUCD Senate - Fall 2004                           |    3584 |     6 |         20 |
| F069 | ASUCD Winter 2005 Senate Election                  |    3718 |     8 |         23 |
| F038 | ASUCD Winter 2005 Senate Election                  |    3718 |     8 |         23 |
| F025 | New Zealand, Porirua City, Eastern Ward, 2004      |    3782 |     5 |         10 |
| F013 | ASUCD Winter 2004 Presidential Election            |    4029 |     1 |          3 |
| F014 | ASUCD Senate Winter 2004                           |    4068 |     6 |         14 |
| F071 | ASSU President 2001                                |    4075 |     1 |          7 |
| F050 | ASUC 2002 Student Advocate Election (UC Berkeley)  |    4357 |     1 |         12 |
| F068 | ASUC 2005 Student Advocate Election (UC Berkeley)  |    4528 |     1 |          6 |
| F044 | ASUC 2001 Student Advocate Election (UC Berkeley)  |    4669 |     1 |          2 |
| F036 | New Zealand, Mosgiel Subdivision, 2004             |    4741 |     4 |          6 |
| F062 | ASUC 2004 Student Advocate Election (UC Berkeley)  |    4890 |     1 |          5 |
| F056 | ASUC 2003 Student Advocate Election (UC Berkeley)  |    5059 |     1 |          2 |
| F022 | New Zealand, Dunedin City, Cargill Ward, 2004      |    5210 |     3 |         10 |
| F039 | ASUC 2001 Academic VP Election (UC Berkeley)       |    5656 |     1 |          5 |
| F041 | ASUC 2001 External VP Election (UC Berkeley)       |    5808 |     1 |          6 |
| F057 | ASUC 2004 Academic VP Election (UC Berkeley)       |    5851 |     1 |          3 |
| F063 | ASUC 2005 Academic VP Election (UC Berkeley)       |    5884 |     1 |          5 |
| F065 | ASUC 2005 External VP Election (UC Berkeley)       |    5927 |     1 |          5 |
| F046 | ASUC 2002 Executive VP Election (UC Berkeley)      |    6046 |     1 |          8 |
| F040 | ASUC 2001 Executive VP Election (UC Berkeley)      |    6057 |     1 |          9 |
| F064 | ASUC 2005 Executive VP Election (UC Berkeley)      |    6156 |     1 |          4 |
| F045 | ASUC 2002 Academic VP Election (UC Berkeley)       |    6175 |     1 |          4 |
| F047 | ASUC 2002 External VP Election (UC Berkeley)       |    6207 |     1 |          6 |
| F059 | ASUC 2004 External VP Election (UC Berkeley)       |    6220 |     1 |          4 |
| F027 | New Zealand, Porirua City, Northern Ward, 2004     |    6288 |     5 |          8 |
| F066 | ASUC 2005 President Election (UC Berkeley)         |    6426 |     1 |          6 |
| F058 | ASUC 2004 Executive VP Election (UC Berkeley)      |    6444 |     1 |          5 |
| F042 | ASUC 2001 President Election (UC Berkeley)         |    6679 |     1 |          9 |
| F043 | ASUC 2001 Senator Election (UC Berkeley)           |    6885 |    20 |        111 |
| F067 | ASUC 2005 Senator Election (UC Berkeley)           |    6916 |    20 |         99 |
| F060 | ASUC 2004 President Election (UC Berkeley)         |    6968 |     1 |          9 |
| F051 | ASUC 2003 Academic VP Election (UC Berkeley)       |    7140 |     1 |          4 |
| F053 | ASUC 2003 External VP Election (UC Berkeley)       |    7144 |     1 |          4 |
| F061 | ASUC 2004 Senator Election (UC Berkeley)           |    7181 |    20 |         81 |
| F052 | ASUC 2003 Executive VP Election (UC Berkeley)      |    7359 |     1 |          4 |
| F048 | ASUC 2002 President Election (UC Berkeley)         |    7567 |     1 |         11 |
| F054 | ASUC 2003 President Election (UC Berkeley)         |    7984 |     1 |          5 |
| F049 | ASUC 2002 Senator Election (UC Berkeley)           |    8080 |    20 |        109 |
| F055 | ASUC 2003 Senator Election (UC Berkeley)           |    8418 |    20 |         99 |
| F023 | New Zealand, Dunedin City, Hills Ward, 2004        |    9844 |     3 |          7 |
| F026 | New Zealand, Porirua City, Mayoralty, 2004         |   13099 |     1 |          6 |
| F024 | New Zealand, South Dunedin Ward, 2004              |   14113 |     4 |         12 |
| F010 | Cambridge, MA 1997 School Committee Election       |   16386 |     6 |         14 |
| F006 | Cambridge, MA 2001 School Committee Election       |   16489 |     6 |         16 |
| F009 | Cambridge, MA 1997 City Council Election           |   16879 |     9 |         28 |
| F005 | Cambridge, MA 2001 City Council Election           |   17126 |     9 |         28 |
| F011 | Cambridge, MA 1999 School Committee Election       |   17961 |     6 |         19 |
| F008 | Cambridge, MA 2003 School Committee Election       |   18698 |     6 |         14 |
| F004 | Cambridge, MA 1999 City Council Election           |   18777 |     9 |         29 |
| F007 | Cambridge, MA 2003 City Council Election           |   20080 |     9 |         29 |
| F021 | San Francisco City Supervisor District 11, 2004    |   23176 |     1 |          8 |
| F020 | San Francisco City Supervisor District 9, 2004     |   24868 |     1 |          7 |
| F017 | San Francisco City Supervisor District 3, 2004     |   25905 |     1 |          4 |
| F015 | San Francisco City Supervisor District 1, 2004     |   28787 |     1 |          7 |
| F002 | Dublin West 2002 (E:53780, D:17th May 2002)        |   29988 |     3 |          9 |
| F019 | San Francisco City Supervisor District 7, 2004     |   31639 |     1 |         13 |
| F016 | San Francisco City Supervisor District 2, 2004     |   34488 |     1 |          5 |
| F018 | San Francisco City Supervisor District 5, 2004     |   35109 |     1 |         22 |
| F001 | Dublin North 2002 (E:72353, D:17th May 2002)       |   43942 |     4 |         12 |
| F037 | New Zealand, Dunedin Mayor, 2004                   |   45720 |     1 |          6 |
| F003 | Meath 2002 (E:108717, D:17th May 2002)             |   64081 |     5 |         14 |
| F030 | New Zealand, Canterbury District Health Board, 200 |  108866 |     7 |         29 |
| F029 | London Mayoral election, 2004                      | 1863686 |     1 |         10 |
+------+----------------------------------------------------+---------+-------+------------+
72 rows in set (0.00 sec)

In some Australian STV elections, all possible preferences must be given. We can find out how many such elections there are by:
SELECT X.ID, X.Votes, X.Candidates, X.Total_Prefs
FROM Blt_info X
WHERE X.Votes * X.Candidates = X.Total_Prefs;

The result of this is:
+------+-------+------------+-------------+
| ID   | Votes | Candidates | Total_Prefs |
+------+-------+------------+-------------+
| S046 |    48 |         13 |         624 |
| T032 |    30 |          4 |         120 |
| T033 |    60 |          4 |         240 |
| T088 |    12 |          6 |          72 |
| T094 |    50 |          6 |         300 |
| T096 |   494 |          7 |        3458 |
| T103 |   100 |          4 |         400 |
| T104 |   105 |          4 |         420 |
| T105 |  1610 |          4 |        6440 |
| T149 |  2000 |         35 |       70000 |
+------+-------+------------+-------------+
10 rows in set (0.00 sec)

Hence there is only one election of this type, other than logical test cases (the T class).
A more interesting example is to see how many elections have more than one member in the Smith set. We have do this by finding if this field contains a comma (we exclude the T class to reduce the output):
SELECT ID, Smith_Set 
FROM BLT_info 
WHERE INSTR(Smith_Set, ',') <> 0
   AND  LEFT(ID, 1) <> 'T';


The result of this is:
+------+---------------------------------------------------------------+
| ID   | Smith_Set                                                     |
+------+---------------------------------------------------------------+
| C002 | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]                   |
| F067 | [1,2,7,19,38,43,46,49,52,57,67,71,75,78,79,86,94]             |
| M001 | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]       |
| M016 | [1,2,4,5,8]                                                   |
| M026 | [1,2,3,4]                                                     |
| M033 | [1,2,4,5]                                                     |
| M041 | [1,2,6]                                                       |
| M044 | [1,2,5,6,9]                                                   |
| M045 | [1,2,4]                                                       |
| M046 | [1,2,3,4]                                                     |
| M052 | [1,2,3,4]                                                     |
| M057 | [1,4,7]                                                       |
| M067 | [1,2,3,4,5]                                                   |
| M074 | [1,2,3]                                                       |
| M079 | [1,4,5]                                                       |
| M081 | [1,2,4]                                                       |
| M083 | [1,2,4,5,6]                                                   |
| M085 | [1,4,6]                                                       |
| M104 | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,22,23]    |
| M105 | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]                |
| M114 | [1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,18]                   |
| M141 | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20]             |
| M145 | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24] |
| M373 | [1,2,4,16]                                                    |
| R018 | [9,11,13,20]                                                  |
| R031 | [1,2,4]                                                       |
| R060 | [6,7]                                                         |
| R116 | [1,6]                                                         |
| S002 | [2,12,15]                                                     |
| S004 | [2,4,6,10,12]                                                 |
| S008 | [1,2,3,4,5,6]                                                 |
| S014 | [3,4,5,7,8,9,11,12,15,19,20,21,22]                            |
| S025 | [2,11,15]                                                     |
| S031 | [1,3,4,7,8,9,10,11,13,14,16,17,19]                            |
| S032 | [12,13,17]                                                    |
| S039 | [4,11]                                                        |
| S041 | [4,7,8,9,11,17,18]                                            |
| S046 | [3,6,8]                                                       |
+------+---------------------------------------------------------------+
38 rows in set (0.00 sec)

4.2  Using the result information

The number of results for each rule is easily found:
SELECT X.Rule, COUNT(*) AS "Results available"
FROM Result X
GROUP BY X.Rule;

+--------------+-------------------+
| Rule         | Results available |
+--------------+-------------------+
| BCSTV        |               832 |
| Borda        |               832 |
| Bucklin      |               123 |
| CambridgeSTV |               555 |
| CofESTV      |               771 |
| Condorcet    |               123 |
| Coombs       |               798 |
| ERS76STV     |               743 |
| ERS97STV     |               832 |
| IRV          |               810 |
| MeekSTV      |               832 |
| NIrelandSTV  |               832 |
| QPQe         |               793 |
| QPQr         |               793 |
| SNTV         |               802 |
| SuppVote     |               123 |
| WarrenSTV    |               832 |
| XXvote       |               776 |
+--------------+-------------------+
18 rows in set (0.06 sec)

Those rules ending in `STV' satisfy the conventional requirements to be regarded as a Single Transferable Vote counting rule.
The details of these election rules are as follows:
BCSTV:
Counting rules proposed for use in the Canadian province of British Columbia in 2005. See http://www.citizensassembly.bc.ca/public for more information.
Borda:
With the Borda count, if there eight candidates competing, then a candidate gets seven points for every first ranking, six points for every second ranking, and so on. If a candidate is not ranked on a ballot then he gets no points. When more than one candidate is to be elected, the Borda count provides some degree of proportionality, but not as well as STV methods.
Bucklin:
With the Bucklin system, if a candidate receives a majority of first choices, then she is elected. Otherwise, if a candidate is first or second on a majority of ballots, then she is elected. This process is repeated for higher choices as necessary.
CambridgeSTV:
Counting rules used by the City of Cambridge, Massachusetts, since 1941. See http://www.ci.cambridge.ma.us/ Election/ for more information.
CofESTV:
The counting rules used by the Church of England (which allows the use of constraints).
Condorcet:
Condorcet elects the candidate who wins all pairwise competitions against the other candidates. Sometimes a cycle will occur where no Condorcet winner exists. In this instance, other techniques are necessary to break the cycle. The city of Marquette, Michigan used Condorcet voting in the early 20th century.
Coombs:
Coombs is like IRV (see below), but with one difference: the candidate with the most last rankings is eliminated at each round.
ERS76STV:
The rules published by the Electoral Reform Society, but now superseded by the next rule.
ERS97STV:
The current rules published by the Electoral Reform Society, see [1].
IRV:
A counting rule more commonly used to elect one candidate, but which can also be used to obtain proportional representation. At each round, the candidate with the fewest number of votes is eliminated. This is also known as the Alternative Vote. (Conventional STV is the same as AV when electing a single candidate.)
MeekSTV:
The counting due to Brian Meek, see [4]. Used is several elections and being used in New Zealand.
NIrelandSTV:
The counting rules used for local elections in Northern Ireland. See http://www.electoralofficeni.gov.uk/faq/PRFAQs.asp for more information.
QPQe:
A counting rules devised by Douglas Woodall, see [2]. This variant does not restart on an exclusion.
QPQr:
A counting rules devised by Douglas Woodall, see [2]. This variant restarts on an exclusion and is thought to be a possible substitute for conventional STV.
SNTV:
Single Non-Transferable Vote. Only the first preferences count - just included for comparison purposes.
SuppVote:
A simpler form of IRV. The voter can rank only two candidates and all but the top two candidates are eliminated after the first round. See http://www.londonelects.org.uk/mayor/ for more information
WarrenSTV:
The rule due to Hugh Warren, see [3]. It is not thought to have been used in real elections.
XXvote:
A counting rule added here for comparative purposes only. Only the first n preferences are used where n is the number of seats. All these are regarded as a single X vote. Hence the order of the first two preferences (in an election for two seats) is ignored.
We can find those cases in which Warren and ERS76 elect different candidates, but excluding the logical tests (class T) and those in which a random choice was made:
SET MAX_JOIN_SIZE =4294967295;
SELECT X.ID, X.Elected AS "Elected by Warren", Y.Elected AS "Elected by ERS76"
FROM Result X, Result Y
WHERE X.ID = Y.ID
 AND LEFT(X.ID,1) <> 'T'
 AND X.Rule = "WarrenSTV"
 AND X.Random = 0
 AND Y.Rule = "ERS76STV"
 AND Y.Random = 0
 AND X.Elected <> Y.Elected
ORDER BY X.ID;

+------+------------------------------------------+-------------------------------------------+
| ID   | Elected by Warren                        | Elected by ERS76                          |
+------+------------------------------------------+-------------------------------------------+
| F006 | [4,5,7,8,9,10]                           | [4,5,6,7,8,9]                             |
| M005 | [1,2,5]                                  | [1,2,4]                                   |
| M010 | [1,3,4,5]                                | [1,2,4,5]                                 |
| M019 | [1,4,8,9]                                | [1,5,8,9]                                 |
| M028 | [1,3,6,7,8]                              | [1,2,3,6,7]                               |
| M051 | [1,3,4,5]                                | [1,2,4,5]                                 |
| M059 | [1,4,5,7]                                | [1,2,4,5]                                 |
| M060 | [1,4,7]                                  | [1,4,5]                                   |
| M066 | [1,2,5]                                  | [1,2,4]                                   |
| M070 | [1,2,6,7,8]                              | [1,3,6,7,8]                               |
| M073 | [2,4,5,8]                                | [1,4,5,8]                                 |
| M078 | [1,3,4]                                  | [1,2,3]                                   |
| M092 | [1,2,3,14]                               | [1,3,5,14]                                |
| M093 | [1,2,3,14]                               | [1,3,5,14]                                |
| M094 | [1,2,3,14]                               | [1,3,5,14]                                |
| M100 | [1,2,4,6,8,17]                           | [1,2,4,7,8,17]                            |
| M103 | [1,2,4,6,7,9]                            | [1,2,3,4,6,7]                             |
| M104 | [1,2,4,6,9,16]                           | [1,2,4,5,9,16]                            |
| M106 | [1,2,6,8,9,12]                           | [1,2,4,5,8,12]                            |
| M108 | [1,2,4,6,7,12]                           | [1,2,4,7,12,13]                           |
| M109 | [1,2,3,5,9,13]                           | [1,2,5,9,10,13]                           |
| M110 | [1,2,3,7,11,12]                          | [1,2,3,6,9,11]                            |
| M111 | [1,2,5,6,9,14]                           | [1,2,3,5,9,14]                            |
| M114 | [1,2,3,5,6,13]                           | [1,2,3,5,6,8]                             |
| M116 | [1,2,4,5,6,7]                            | [1,2,4,5,7,14]                            |
| M117 | [1,2,3,4,9,13]                           | [1,2,4,9,11,13]                           |
| M119 | [1,2,4,5,9,16]                           | [1,2,4,5,6,16]                            |
| M120 | [1,2,5,7,8,15]                           | [1,2,5,7,8,11]                            |
| M121 | [1,2,5,7,8,16]                           | [1,2,4,7,8,16]                            |
| M122 | [1,2,3,5,6,7,10]                         | [1,2,3,5,6,11,13]                         |
| M123 | [1,2,4,5,7,9,13]                         | [1,2,3,4,5,7,9]                           |
| M124 | [1,3,7,8,9,11,12]                        | [1,2,3,7,8,9,11]                          |
| M126 | [1,4,5,6,9,11,13]                        | [1,2,4,5,6,9,13]                          |
| M130 | [1,2,4,5,6,8,13]                         | [1,2,4,5,6,11,12]                         |
| M134 | [1,2,3,5,7,9,11]                         | [1,2,3,5,6,7,9]                           |
| M137 | [1,2,3,4,5,9,13]                         | [1,2,3,4,5,7,9]                           |
| M139 | [1,2,3,5,7,10,13]                        | [1,3,5,7,8,10,13]                         |
| M140 | [1,2,4,5,8,10,11]                        | [1,2,4,5,6,8,11]                          |
| M145 | [1,2,4,5,6,7,11]                         | [1,2,3,4,6,7,11]                          |
| M147 | [1,2,3,5,6,7,16]                         | [1,2,3,5,6,14,16]                         |
| M149 | [1,2,3,4,6,8,18]                         | [1,2,3,4,6,13,18]                         |
| M150 | [1,2,3,4,5,12,14]                        | [1,2,3,4,5,12,13]                         |
| M181 | [1,4,6,7]                                | [1,4,7,11]                                |
| M182 | [1,4,6,7]                                | [1,4,7,11]                                |
| M190 | [2,6,8,14]                               | [6,8,10,14]                               |
| M191 | [2,6,8,14]                               | [6,8,10,14]                               |
| M193 | [1,2,3,14]                               | [1,3,5,14]                                |
| M197 | [2,4,8,12,13]                            | [2,4,8,11,13]                             |
| M198 | [2,4,8,12,13]                            | [2,4,8,11,13]                             |
| M207 | [4,6,11,15,16]                           | [4,6,13,15,16]                            |
| M228 | [2,8,10,11,12]                           | [2,3,8,11,12]                             |
| M229 | [4,5,7,11,13]                            | [5,7,9,11,13]                             |
| M230 | [4,5,8,11,13]                            | [5,8,9,11,13]                             |
| M231 | [4,5,7,11,13]                            | [5,8,9,11,13]                             |
| M253 | [2,3,4,8]                                | [1,2,3,8]                                 |
| M254 | [2,3,4,8]                                | [1,2,3,8]                                 |
| M303 | [1,3,8]                                  | [3,5,8]                                   |
| M353 | [3,5,6]                                  | [3,6,7]                                   |
| M386 | [2,4,6,13]                               | [2,4,6,11]                                |
| M387 | [2,4,6,13]                               | [2,4,6,11]                                |
| R003 | [1,3,8,10,14,16]                         | [1,8,10,14,16,17]                         |
| R004 | [1,4,6,8,10]                             | [1,2,4,8,10]                              |
| R005 | [1,2,3,5,6,7,8]                          | [1,2,3,4,5,7,8]                           |
| R046 | [1,6,7,10]                               | [1,2,7,10]                                |
| R048 | [1,4,5,6,9]                              | [1,4,6,9,10]                              |
| R072 | [1,4,5,7]                                | [1,5,6,7]                                 |
| R081 | [3,4,5,6,7,8]                            | [1,3,5,6,7,8]                             |
| R083 | [1,2,3,4,5,6,9,12,14,15,19,20]           | [1,2,3,4,5,6,9,11,12,14,19,20]            |
| R096 | [2,4,5,6,7,9,10,11,12,14,15,16,18,19,20] | [2,5,6,7,9,10,11,12,14,15,16,17,18,19,20] |
| R098 | [1,3,5,8,9,10,14,20,26,27]               | [1,5,8,9,10,12,14,20,26,27]               |
| R109 | [1,5,6,8,9,10]                           | [1,4,5,6,8,10]                            |
| R113 | [1,4]                                    | [2,4]                                     |
| S044 | [1,3,5,8,9]                              | [1,3,5,7,9]                               |
| S045 | [1,2,3,4,6,7,8,9,10]                     | [1,2,3,4,5,6,7,9,10]                      |
+------+------------------------------------------+-------------------------------------------+
74 rows in set (0.63 sec)

Note the initial command to ensure that the query completes successfully.
We can explore the use of random choices:
SELECT X.Rule,  COUNT(*) AS "Cases with random choice", SUM(X.Random)
FROM Result X
WHERE X.Random <> 0
GROUP BY X.Rule;

+--------------+--------------------------+---------------+
| Rule         | Cases with random choice | SUM(X.Random) |
+--------------+--------------------------+---------------+
| BCSTV        |                      156 |           417 |
| Borda        |                       25 |            35 |
| Bucklin      |                        2 |             2 |
| CambridgeSTV |                       37 |           164 |
| CofESTV      |                      149 |          1054 |
| ERS76STV     |                      126 |           384 |
| ERS97STV     |                      130 |           353 |
| IRV          |                      162 |           372 |
| MeekSTV      |                      110 |           275 |
| NIrelandSTV  |                      132 |           337 |
| QPQe         |                      192 |          1408 |
| QPQr         |                      198 |          1733 |
| SNTV         |                       83 |           136 |
| SuppVote     |                       27 |            35 |
| WarrenSTV    |                      113 |           283 |
| XXvote       |                       69 |           107 |
+--------------+--------------------------+---------------+
16 rows in set (0.02 sec)
+--------------+--------------------------+---------------+

As expected, CofE makes more random choices by not permitting multiple exclusions, and Meek makes only half the number of random choices after the first due to using very small fractions of a vote. (This query fails with a syntax error on the current SourceForge system for reasons which are not clear - it is OK with MySQL version 5.0.16 on an Apple.)

4.3  Using both tables

We now find all the elections for a single seat for which the Condorcet winner is not elected.
SET MAX_JOIN_SIZE =4294967295;
SELECT X.ID, X.Smith_Set, Y.Elected, Y.Rule
FROM BLT_info X, Result Y
WHERE X.Seats = 1
  AND X.ID = Y.ID
  AND INSTR(X.Smith_Set, ',') = 0
  AND X.Smith_Set <> Y.Elected
  AND LEFT(X.ID,1) <> 'T'
ORDER BY X.ID;


+------+-----------+---------+-------------+
| ID   | Smith_Set | Elected | Rule        |
+------+-----------+---------+-------------+
| F053 | [1]       | [4]     | SNTV        |
| R026 | [2]       | [8]     | SNTV        |
| R026 | [2]       | [5]     | Bucklin     |
| R026 | [2]       | [5]     | Borda       |
| R026 | [2]       | [8]     | XXvote      |
| R035 | [1]       | [2]     | Bucklin     |
| R051 | [2]       | [6]     | Bucklin     |
| R054 | [4]       | [1]     | Bucklin     |
| R084 | [6]       | [12]    | SuppVote    |
| R084 | [6]       | [12]    | Bucklin     |
| R084 | [6]       | [12]    | Borda       |
| R097 | [15]      | [3]     | SNTV        |
| R097 | [15]      | [3]     | SuppVote    |
| R097 | [15]      | [3]     | XXvote      |
| S001 | [2]       | [9]     | SNTV        |
| S001 | [2]       | [9]     | SuppVote    |
| S001 | [2]       | [9]     | Coombs      |
| S001 | [2]       | [9]     | XXvote      |
| S006 | [13]      | [6]     | Coombs      |
| S006 | [13]      | [3]     | Borda       |
| S007 | [3]       | [6]     | Bucklin     |
| S009 | [13]      | [10]    | SNTV        |
| S009 | [13]      | [10]    | SuppVote    |
| S011 | [9]       | [4]     | SNTV        |
| S011 | [9]       | [4]     | SuppVote    |
| S011 | [9]       | [21]    | XXvote      |
| S012 | [22]      | [7]     | SNTV        |
| S012 | [22]      | [7]     | SuppVote    |
| S012 | [22]      | [7]     | Bucklin     |
| S012 | [22]      | [7]     | XXvote      |
| S013 | [19]      | [14]    | SNTV        |
| S013 | [19]      | [14]    | SuppVote    |
| S013 | [19]      | [14]    | XXvote      |
| S015 | [17]      | [10]    | SNTV        |
| S015 | [17]      | [16]    | IRV         |
| S015 | [17]      | [10]    | SuppVote    |
| S015 | [17]      | [16]    | BCSTV       |
| S015 | [17]      | [16]    | ERS97STV    |
| S015 | [17]      | [16]    | NIrelandSTV |
| S015 | [17]      | [16]    | MeekSTV     |
| S015 | [17]      | [16]    | WarrenSTV   |
| S015 | [17]      | [16]    | QPQe        |
| S015 | [17]      | [16]    | QPQr        |
| S015 | [17]      | [19]    | XXvote      |
| S015 | [17]      | [16]    | ERS76STV    |
| S015 | [17]      | [16]    | CofESTV     |
| S027 | [9]       | [1]     | SNTV        |
| S027 | [9]       | [1]     | Borda       |
| S027 | [9]       | [1]     | XXvote      |
| S028 | [17]      | [1]     | SNTV        |
| S028 | [17]      | [1]     | SuppVote    |
| S028 | [17]      | [1]     | Bucklin     |
| S028 | [17]      | [1]     | Borda       |
| S028 | [17]      | [1]     | XXvote      |
| S029 | [18]      | [9]     | SNTV        |
| S029 | [18]      | [9]     | SuppVote    |
| S029 | [18]      | [1]     | Bucklin     |
| S029 | [18]      | [9]     | XXvote      |
| S035 | [8]       | [18]    | Coombs      |
| S035 | [8]       | [16]    | Borda       |
| S035 | [8]       | [16]    | XXvote      |
| S036 | [15]      | [13]    | Bucklin     |
| S036 | [15]      | [21]    | XXvote      |
| S042 | [3]       | [2]     | SNTV        |
| S042 | [3]       | [2]     | SuppVote    |
| S042 | [3]       | [2]     | Bucklin     |
| S042 | [3]       | [2]     | Borda       |
| S047 | [10]      | [5]     | SuppVote    |
| S049 | [1]       | [2]     | Bucklin     |
+------+-----------+---------+-------------+
69 rows in set (0.52 sec)

All of these cases indicates that the Condorcet winner is not necessarily elected by STV (as expected).
We can find the difference between Cambridge and Meek and produce the main characteristics from the BLT_info table:
SET MAX_JOIN_SIZE =4294967295;
SELECT Z.ID, Z.Votes, Z.Candidates, Z.Seats,
       X.Elected AS "Elected by Meek", Y.Elected AS "Elected by Cambridge"
FROM Result X, Result Y, BLT_info Z
WHERE X.ID = Y.ID
 AND X.ID = Z.ID
 AND Y.ID = Z.ID
 AND X.Rule = "MeekSTV"
 AND Y.Rule = "CambridgeSTV"
 AND X.Random = 0
 AND LEFT(X.ID,1) <> 'T'
 AND X.Elected <> Y.Elected;

+------+--------+------------+-------+----------------------+----------------------+
| ID   | Votes  | Candidates | Seats | Elected by Meek      | Elected by Cambridge |
+------+--------+------------+-------+----------------------+----------------------+
| S044 |   2908 |         12 |     5 | [1,3,5,8,9]          | [1,3,5,7,9]          |
| S045 |    853 |         10 |     9 | [1,2,3,4,6,7,8,9,10] | [1,2,3,4,5,6,7,9,10] |
| R022 |    867 |         13 |     8 | [1,2,4,5,6,9,10,12]  | [1,2,4,5,6,8,10,12]  |
| R067 |    253 |          3 |     2 | [1,2]                | [1,3]                |
| R109 |   1147 |         10 |     6 | [1,4,5,6,8,9]        | [1,5,6,8,9,10]       |
| M005 |  27757 |          7 |     3 | [1,2,5]              | [1,2,4]              |
| M010 |  38410 |          9 |     4 | [1,3,4,5]            | [1,2,4,5]            |
| M012 |  28665 |          5 |     3 | [1,2,3]              | [1,2,4]              |
| M017 |  35205 |         14 |     4 | [1,2,4,9]            | [1,2,4,5]            |
| M019 |  29193 |         13 |     4 | [1,4,8,9]            | [1,5,8,9]            |
| M028 |  44454 |         13 |     5 | [1,3,6,7,8]          | [1,2,3,6,7]          |
| M030 |  28793 |          9 |     3 | [1,2,4]              | [1,3,4]              |
| M034 |  25247 |          7 |     3 | [1,2,4]              | [1,3,4]              |
| M045 |  28687 |          7 |     3 | [1,2,4]              | [1,4,5]              |
| M051 |  39991 |         10 |     4 | [1,3,4,5]            | [1,2,4,5]            |
| M059 |  35038 |         11 |     4 | [1,4,5,7]            | [1,2,4,5]            |
| M060 |  25553 |          9 |     3 | [1,4,7]              | [1,4,5]              |
| M066 |  24825 |          9 |     3 | [1,2,5]              | [1,2,4]              |
| M070 |  44914 |         13 |     5 | [1,2,6,7,8]          | [1,3,6,7,8]          |
| M073 |  36407 |          8 |     4 | [2,4,5,8]            | [1,4,5,8]            |
| M078 |  27881 |          8 |     3 | [1,3,4]              | [1,2,3]              |
| M081 |  28352 |          6 |     3 | [1,4,6]              | [1,2,4]              |
| M092 |  37438 |         16 |     4 | [1,2,3,14]           | [1,3,5,14]           |
| M181 |  36400 |         12 |     4 | [1,4,6,7]            | [1,4,7,11]           |
| M190 |  40009 |         14 |     4 | [2,6,8,14]           | [6,8,10,14]          |
| M191 |  40009 |         14 |     4 | [2,6,8,14]           | [6,8,10,14]          |
| M193 |  37438 |         16 |     4 | [1,2,3,14]           | [1,3,5,14]           |
| M197 |  59634 |         14 |     5 | [2,4,8,12,13]        | [2,4,8,11,13]        |
| M198 |  59634 |         14 |     5 | [2,4,8,12,13]        | [2,4,8,11,13]        |
| M207 |  42648 |         16 |     5 | [4,6,11,15,16]       | [4,6,13,15,16]       |
| M229 |  53670 |         13 |     5 | [4,5,7,11,13]        | [5,7,9,11,13]        |
| M230 |  53670 |         13 |     5 | [4,5,8,11,13]        | [5,8,9,11,13]        |
| M231 |  53670 |         13 |     5 | [4,5,7,11,13]        | [5,8,9,11,13]        |
| M253 |  42733 |          9 |     4 | [2,3,4,8]            | [1,2,3,8]            |
| M254 |  42733 |          9 |     4 | [2,3,4,8]            | [1,2,3,8]            |
| M266 |  30703 |         11 |     3 | [1,8,9]              | [7,8,9]              |
| M283 |  43076 |         10 |     4 | [1,2,7,10]           | [1,2,7,9]            |
| M303 |  32440 |          9 |     3 | [1,3,8]              | [3,5,8]              |
| M353 |  28808 |          8 |     3 | [3,5,6]              | [3,6,7]              |
| M386 |  44797 |         13 |     4 | [2,4,6,13]           | [2,4,6,11]           |
| M387 |  44797 |         13 |     4 | [2,4,6,13]           | [2,4,6,11]           |
| F006 |  16489 |         16 |     6 | [4,5,7,8,9,10]       | [4,5,6,7,9,10]       |
| C015 | 550000 |         16 |     4 | [1,2,3,11]           | [1,2,7,11]           |
| C019 | 750000 |         17 |     4 | [1,2,11,13]          | [1,2,7,11]           |
| C023 | 950000 |         20 |     4 | [1,2,11,13]          | [1,2,7,11]           |
+------+--------+------------+-------+----------------------+----------------------+
45 rows in set (0.61 sec)

Note that the non-logical cases are all for a relatively large number of seats. (The logically unnecessary AND Y.ID = Z.ID is added to speed up the query.)
Finally, we return to the example which we gave at the beginning. We try to find an example in which ERS97=Meek, but these two are not equal to (ERS76=QPQr), obviously in terms of the candidates elected.
SET MAX_JOIN_SIZE =4294967295;
SELECT X.ID 
 FROM Result X, Result Y, Result Z, Result U
WHERE X.ID = Y.ID
 AND X.ID = Z.ID
 AND Y.ID = Z.ID
 AND Y.ID = U.ID
 AND X.ID = U.ID
 AND U.ID = Z.ID
 AND X.Rule = "ERS97STV"
 AND Y.Rule = "MeekSTV"
 AND Z.Rule = "ERS76STV"
 AND U.Rule = "QPQr"
 AND X.Elected = Y.Elected
 AND Z.Elected = U.Elected
 AND X.Elected <> Z.Elected
 AND Y.Elected <> Z.Elected
 AND X.Elected <> U.Elected
 AND Y.Elected <> U.Elected;

Without the initial SET command one gets:
#1104 - The SELECT would examine more than MAX_JOIN_SIZE rows; check
your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if
the SELECT is okay 

With the initial SET command required in the SourceForge set-up, or without that using another MySQL system one gets:
+------+
| ID   |
+------+
| T143 |
+------+
1 row in set (0.93 sec)

We can now see what information we have about this particular test:
SELECT *
FROM BLT_info
WHERE ID="T143";

This is too wide to display in the format given by MySQL, but gives:
ID T143
Title TEST97B Substage TieBreak
Candidates 6
Seats 2
Votes 60
Invalid_Votes 0
Total_Prefs 100
Withdrawn_Candidates 0
Zero_First 0
No_Support 0
Largest_Pile 13
Smith_Set [1]
Single_Prefs 28
Source Keith Edkins, email: keith.edkins at gwydir.demon.co.uk
Comment See papers 5 and 6 in Voting matters, Issue 11, April 2000.
Extra_Doc N
SELECT *
FROM Result
WHERE ID="T143";

+------+-------------+---------+--------+--------+-------+-----------+-----------------------+
| ID   | Rule        | Elected | Stages | Random | First | Tie_Break | Program               |
+------+-------------+---------+--------+--------+-------+-----------+-----------------------+
| T143 | SNTV        | [1,2]   |      1 |      0 |     2 | S         | pSTV: version 0.9     |
| T143 | IRV         | [1,4]   |      5 |      0 |     0 | S         | pSTV: version 0.9     |
| T143 | Coombs      | [3,4]   |      5 |      0 |     0 | S         | pSTV: version 0.9     |
| T143 | Borda       | [1,3]   |      1 |      0 |     2 | S         | pSTV: version 0.9     |
| T143 | BCSTV       | [1,4]   |      6 |      0 |     1 | S         | pSTV: version 0.9     |
| T143 | ERS97STV    | [1,4]   |      7 |      0 |     1 | S         | pSTV: version 0.9     |
| T143 | NIrelandSTV | [1,4]   |      6 |      0 |     1 | S         | pSTV: version 0.9     |
| T143 | MeekSTV     | [1,4]   |      5 |      0 |     1 | S         | pSTV: version 0.9     |
| T143 | WarrenSTV   | [1,4]   |      5 |      0 |     1 | S         | pSTV: version 0.9     |
| T143 | QPQe        | [1,3]   |      5 |      0 |     1 | S         | Ada rule v0.04        |
| T143 | QPQr        | [1,3]   |      8 |      0 |     1 | S         | Ada rule v0.04        |
| T143 | XXvote      | [1,4]   |      1 |      0 |     2 | S         | Ada rule v0.04        |
| T143 | ERS76       | [1,3]   |      5 |      0 |     1 | S         | eSTV Reg. 12180,1.47a |
| T143 | CofE        | [1,3]   |      5 |      0 |     1 | S         | eSTV Reg. 12180,1.48f |
+------+-------------+---------+--------+--------+-------+-----------+-----------------------+
14 rows in set (0.02 sec)

Finally, a script has been written to compare all the elections (but omitting the T Class and those involving a random choice), so that a table can be prepared giving the result. This is as a percentage of the elections in which a different set of candidates were elected. This result of this is:
Borda Bucklin CambridgeSTV CofESTV ERS76STV ERS97STV IRV MeekSTV NIrelandSTV QPQe QPQr SNTV SuppVote WarrenSTV XXvote
BCSTV 65.30 11.67 3.21 4.56 5.10 4.97 18.82 12.23 3.37 20.56 15.06 36.35 3.45 12.97 71.98
Borda - 13.68 62.39 66.99 68.73 63.45 66.05 60.82 64.36 63.42 61.68 67.72 12.99 60.58 20.47
Bucklin - - 9.43 21.21 34.62 13.64 13.64 13.64 13.64 16.67 16.67 19.10 16.46 13.64 30.00
CambridgeSTV - - - 3.41 3.52 3.42 17.56 9.40 2.99 14.66 12.06 32.26 1.96 9.40 71.43
CofESTV - - - - 1.22 1.37 20.46 14.09 1.57 18.60 15.77 38.60 6.90 13.89 69.98
ERS76STV - - - - - 0.20 21.75 14.68 2.39 19.18 16.02 40.12 15.00 14.68 70.35
ERS97STV - - - - - - 20.07 13.23 2.59 18.53 15.60 36.80 5.00 13.23 69.79
IRV - - - - - - - 23.16 19.37 29.36 26.23 24.81 5.00 23.53 73.76
MeekSTV - - - - - - - - 12.93 15.87 7.39 40.46 5.00 1.36 67.70
NIrelandSTV - - - - - - - - - 19.20 15.86 35.91 5.00 12.76 70.84
QPQe - - - - - - - - - - 13.82 45.34 3.57 15.11 67.86
QPQr - - - - - - - - - - - 43.01 3.57 8.58 66.04
SNTV - - - - - - - - - - - - 6.49 40.71 72.50
SuppVote - - - - - - - - - - - - - 5.00 10.26
WarrenSTV - - - - - - - - - - - - - - 67.50
These results might seem surprising at first. For instance, BCSTV and SuppVote are very different, since the Supplementary Vote only applies to electing a single candidate. In fact, they are seen to be quite similar since only those elections for which results of both voting rules are available are compared - in this case, those for a single seat. In fact, 58 elections are compared and just two give a different result. The percentage difference is then 2/58=3.45%.

5  Programs used

A key program is one which computes the information for the BLT_info table. This is written in Ada 95 and is available without restriction. The other programs are those that do counts for various rules. At the moment, these are as follows:
SELECT X.Rule,  X.Program
FROM Result X
GROUP BY X.Rule;

+--------------+-----------------------+
| Rule         | Program               |
+--------------+-----------------------+
| BCSTV        | pSTV: version 0.9     |
| Borda        | pSTV: version 0.9     |
| Bucklin      | pSTV: version 0.9     |
| CambridgeSTV | pSTV: version 0.9     |
| CofE         | eSTV Reg. 12180,1.48f |
| Condorcet    | pSTV: version 0.9     |
| Coombs       | pSTV: version 0.9     |
| ERS76        | eSTV Reg. 12180,1.47a |
| ERS97STV     | pSTV: version 0.9     |
| IRV          | pSTV: version 0.9     |
| MeekSTV      | pSTV: version 0.9     |
| NIrelandSTV  | pSTV: version 0.9     |
| QPQe         | Ada rule v0.04        |
| QPQr         | Ada rule v0.04        |
| SNTV         | pSTV: version 0.9     |
| SuppVote     | pSTV: version 0.9     |
| WarrenSTV    | pSTV: version 0.9     |
| XXvote       | Ada rule v0.04        |
+--------------+-----------------------+
18 rows in set (0.08 sec)

  1. Implementations of eSTV are from Joe Otten. A demonstration version of this program is available from the ERS web site.
  2. Jeff O'Neill's program pSTV. This program produces data in a format used to load the data into the Result table.
  3. An Ada 95 program which produces result for the two versions of QPQ and XXvote.

6  Related information

The main related information are all the election data files: Xddd.BLT. These are two big to handle apart from writing a CD. Those that would like a copy for non-commercial purposes should contact Brian Wichmann.
In undertaking work to validate implementations of various STV counting rules, Brian Wichmann has used a `standard' format for conventional result sheets. This CSV format has proved very useful, but is not used here for two results: firstly, it is not really appropriate for some counting rules like Meek; secondly it is very detailed and would increase the size of the tables to store the result by more than a factor of ten and be very difficult to use.
Hence the situation of the moment is that you may use this database to discover that a specific election E gives a different result with rules X and Y. You would then need to repeat these two election counts and examine the output to discover the reason for this.

7  Likely extensions

It should be straightforward to add the results from additional counting rules. However, the work involved is much reduced if the table output is produced directly, as we have done.
It would a great advance if more full disclosure elections were available (R or F class). The number of such elections is too small for many statistical tests.
When full disclosure takes place and further information is available (F class) then this additional information should be stored. This needs to be considered at a later date.

8  Problem areas

Within the confines of the existing system, it seems that very detailed analysis of specific cases would require re-running the appropriate counting software. Hence the main purpose of the database is to collect statistical information and identify cases worthy of further study.
At the moment, there is no version control built into the system. When in doubt, use the dates on the two main files. The intention is to make the system from this point onwards upward compatible. Hence if an error is found in the BLT file, that test would be deleted and the test ID not re-used. Although this database inherits a lot of material from the previous collection of BLT files, it is not upward compatible with it.
Currently, if a counting program has a missing result, the reason for this is not recorded. Sometimes, this is a capacity issue, as with David Hill's MS-DOS system (not used here). With the Cambridge rules all candidates are excluded with fewer than 50 votes after all surplus votes have been transferred.
At the moment, results from two implementations of the same rule are not stored in the results table. If this is done, then the program name must be used to discriminate cases, which makes running queries more awkward.

9  Acknowledgments

Many thanks to those that made all of this possible. Too many people have contributed over the years to the election database to list here. Thanks to our SQL consultant, David Wichmann.
A special thanks for those who have written counting programs which have been used to compute the result for the database. Currently, this is David Hill (not actually in this edition), and Joe Otten.

References

[1]
R. A. Newland and F. S. Britton. How to conduct an election by the Single Transferable Vote. ERS 3rd Edition. 1997. See http://www.electoral-reform.org.uk/votingsystems/stvrules.htm.
[2]
D. R. Woodall. QPQ, a quota-preferential STV-like election rule. Voting matters. Issue 17, pp1-7. October 2003. See http://www.mcdougall.org.uk/VM/ISSUE17/I17P1.PDF.
[3]
C. H. E. Warren. Counting in STV elections. Voting matters. Issue 1, pp12-13. March 1994. See http://www.mcdougall.org.uk/VM/ISSUE1/P4.HTM.
[4]
I. D. Hill, B. A. Wichmann and D. R. Woodall. Algorithm 123 - Single Transferable Vote by Meek's method. Computer Journal. Vol 30, pp277-281, 1987.
[5]
M. Schulze. Voting matters, Issue 17. page 11. ( Suppose that d[X,Y] is the number of voters who strictly prefer candidate X to candidate Y. Then the Smith set is the smallest non-empty set of candidates with d[A,B] > d[B,A] for each candidate A of this set and each candidate B outside this set.) See http://www.mcdougall.org.uk/VM/ISSUE17/I17P3.PDF.

A  Installation on you own machine

This database consists of this guide and two SQL tables. The two tables must be loaded into a MySql database and are available from SourceForge.
If you are using the SourceForge Internet version of this database, then the tables will have already been set up. Please do not change any of the tables.
The two tables are enclosed in an SQL script to make importing them easy. From the command line of your computer, enter
    mysql < stvdb-1.2.sql

The SQL for each table are:
CREATE TABLE `BLT_info` (
  `ID` varchar(4) default NULL,
  `Title` varchar(50) default NULL,
  `Candidates` int(11) default NULL,
  `Seats` int(11) default NULL,
  `Votes` int(11) default NULL,
  `Invalid_Votes` int(11) default NULL,
  `Total_Prefs` int(11) default NULL,
  `Withdrawn_Candidates` int(11) default NULL,
  `Zero_First` int(11) default NULL,
  `No_Support` int(11) default NULL,
  `Largest_Pile` int(11) default NULL,
  `Smith_Set` varchar(100) default NULL,
  `Single_Prefs` int(11) default NULL,
  `Source` varchar(80) default NULL,
  `Comment` varchar(255) default NULL,
  `Extra_Doc` char(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `Result` (
  `ID` varchar(4) default NULL,
  `Rule` varchar(15) default NULL,
  `Elected` varchar(220) default NULL,
  `Stages` int(11) default NULL,
  `Random` int(11) default NULL,
  `First` int(11) default NULL,
  `Tie_Break` char(1) default NULL,
  `Program` varchar(31) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;




File translated from TEX by TTH, version 3.63.
On 29 Jun 2006, 21:52.

Voting Methods

The single transferable vote (STV) is an election method that is used to obtain proportional representation. STV is used for national elections in Ireland, Northern Ireland, Malta, Australia, and New Zealand. In addition, many organizations use STV, including the Church of England and the Green Party of the United States. However, no two of the above use precisely the same definition of STV. With the same set of ballots, the above methods could produce different winners. STV can best be described as a class of election methods and users of STV must specify precisely which version of STV is to be used. The purpose of this software is to help organizations use STV and also to specify precisely which STV rules they will use.

Below, I classify and describe a variety of methods for implementing STV. The first two methods are not STV methods, but they provide a good introduction. The methods are listed roughly in order of increasing effectiveness for providing proportional representation.

The examples below will be for a hypothetical election where 99 voters are electing four candidates from a field of eight.

I. Single Non-Transferable Vote (SNTV)

For this method, only the first-place votes are used. In reality, the voter would simply pick one candidate instead of ranking the candidates. The four candidates receiving the largest number of first-place votes are elected. SNTV provides only limited proportional representation, but it is a useful alternative if it is not possible to have ranked ballots.

II. Instant Runoff Voting (IRV)

IRV is more typically used in the context of electing one person to an office. However, it can also be used to obtain proportional representation. The procedure is the following:

  1. Count the first place votes.
  2. Eliminate the candidate with the fewest number of votes and transfer the votes to the next candidate on each ballot.
  3. Repeat step (2) until only four candidates remain.

IRV provides better proportional representation than SNTV and the method for counting the votes is still quite simple.

III. Basic Structure of STV

The basic structure of an STV method can be described as follows:

  1. Establish the winning threshold.
  2. Count the first place votes.
  3. If one or more candidates have surplus votes (votes in excess of the winning threshold), then transfer votes from the candidate with the largest surplus. Otherwise, eliminate the last place candidate and transfer those votes. The only candidates who can receive votes are those who are under the winning threshold and not eliminated. If there are no further candidates on a ballot than that vote is "exhausted" and does not count towards any candidate.
  4. If there are more than 4 candidates remaining, then go to step (3).

The above is ambiguous in that it does not define the winning threshold and does not describe precisely how votes are to be transferred. Specific implementations of STV define both of these and may also modify the basic structure.

The winning threshold is also called a quota. I avoid the term quota because it has negative connotation in the US. A commonly used threshold is defined as

                number of votes
threshold =  --------------------- + 1
              number of seats + 1

and then dropping any fraction.

This is the smallest threshold such that any candidate receiving this number of votes is guaranteed to be elected. This will be discussed in more detail below.

Methods for transferring surplus votes can be classified into two main groups: random transfer of votes and fractional transfer of votes. Methods for transferring votes from eliminated candidates do not vary greatly.

IV. Random Transfer STV

With random transfer of surplus votes, a number of ballots corresponding to the candidate's surplus are transferred to their next choices. One could choose the last ballots the candidate received, the first ballots the candidate received, or choose some other method. It is important to note is that changing the order of the ballots can change the outcome of the election. In reality, this will only happen in a close election. However, many people find this aspect disturbing.

One could choose a stack or a queue model for transferring ballots. It is useful to visualize the candidates' ballots in separate piles. With a stack model, one would take the ballots off the top of one pile and place them on the top of another pile. With a queue model, one would take the ballots off the top of one pile and place them on the bottom of another pile. With a stack model, one ballot could be transferred many times, while with the queue model, a ballot would probably transferred only once. This implementation uses the queue model.

Another consideration is whether to allow secondary surpluses. A primary surplus arises only after counting the first choices. A secondary surplus could arise after the transfer of a surplus or the transfer of votes from an eliminated candidate. This implementation allows secondary surpluses.

V. Fractional Transfer STV

Fractional transfer methods are designed so that the result of the election remains the same when the order of the ballots is changed. The basic idea is that, when transferring a candidate's surplus votes, all of the ballots are transferred but at a fractional value. The fraction is set so that the total value of all the transferred ballots equals the candidate's surplus.

With fractional transfers of votes, secondary surpluses must be allowed. Since the point of fractional transfers is to ensure that the method is independent of the order of the ballots, all the ballots transferred in a given round must be treated identically.

Since floating-point arithmetic, some implementations round all calculations to a number of decimal places. This implementation does all computations in floating point.

VI. Variations

Both random and fraction transfer STV have a number of variations.

A. The Winning Threshold

There are a variety of methods for computing the winning threshold. I prefer to define them in words rather than through formulas.

  • Droop -- The smallest number such that any candidate receiving this number of votes is guaranteed to be elected.
  • Hare -- The largest number such that all winners can receive this number of votes.

Within these two types there are two options. A threshold can be static or dynamic. A static threshold is determined once at the beginning and is the same until the end. A dynamic threshold is recomputed every round and decreases as the number of exhausted votes increases. The threshold can also be a whole number or a fraction. Thus, there eight variations for determining the threshold.

The above descriptions of the Droop and Hare thresholds is an ideal which is not always perfectly realized. How well a threshold conforms to the ideal is how "tight" the threshold is. For example, a fractional threshold is slightly tighter than a whole threshold since there is greater precision.

If voters are required to rank all the candidates, then there will be no exhausted votes and the static and dynamic thresholds will be identical. If voters are not required to rank all the candidates, then there will be exhausted votes and the dynamic threshold will be tighter than the static threshold.

The ERS97 rules implement a threshold that is a variation of the Droop threshold. For a static threshold, Droop and ERS97 are identical. For a dynamic threshold, ERS97 is tighter than Droop. For a given candidate, his surplus votes are transferred only once. Thus, when the threshold decreases, these votes that are above the new threshold do not help elect any candidate. The ERS97 threshold takes into account these nontransferable surplus votes when computing the threshold and this results in a threshold that is smaller (tighter) than the Droop threshold.

B. Delayed Transfer of Surplus

The basic algorithm above requires that all surplus votes be transferred before the last place candidate is eliminated. However, if the last place candidate can't win, even if he received all the surplus votes, then he can safely be eliminated before transferring the surplus votes. Thus, we can delay the transfer of surplus until after this losing candidate is eliminated.

There are two reasons for doing this. First, eliminating last place candidates is much simpler than transferring surplus votes. Thus, we should delay transferring surplus as long as we can. Second, it will help minimize the number of times that a given vote will be transferred. If we transfer surplus immediately, then part of it could transfer to a candidate who will be eliminated in the next round. These votes would be transferred twice. If we delay the transfer of surplus until after this candidate is eliminated, then the same vote would be transferred just once.

C. Batch Transfer of Surplus

The basic structure transfers surplus votes from only one candidate at a tie. One could instead transfer all surplus votes simultaneously.

D. Batch Elimination of Candidates

One could eliminate candidates in batches rather than one by one. There are two rationales for this. The first is practicality. If there are many candidates, each with very few votes, then it would be tedious to eliminate them one by one. The second is efficiency. If it is known that several candidates can't win, then it makes sense to eliminate them all right away.

The first method is to eliminate all candidates who have fewer votes than a flat cutoff. This would take place immediately after all surplus votes have been transferred to allow all candidates to take advantage of surplus votes to avoid being eliminated in this fashion. This will be useful when there are many candidates with very few (or even no) first place votes. With many such candidates, it would take many rounds to eliminate them one by one. The batch elimination simplifies the count by eliminating all candidates with very few votes in one round. Note that this will possibly eliminate candidates who have a chance of winning. However, this is not a problem as long as the cutoff is chosen wisely.

The second method is the same as the first, except that the cutoff is chosen as a percentage, say 0.5%, of the total number of votes cast. This method is suggested in the STV rules in Behind the Ballot Box.

The third method is to eliminate all candidates immediately who have no chance of winning. This can happen before surplus votes are transferred and at any time throughout the count. To test if a given candidate can win, it is assumed that she will receive all surplus votes and all transfers from eliminated candidates. Under this assumption, a candidate can win if it is possible that she can beat all candidates between her and the last seat. If it is known that a candidate can't win then she should be eliminated immediately. It is possible that at a given round, that several candidates can't possibly win and they should all be eliminated in a batch.

VII. Cambridge Rules

The Cambridge rules are a random transfer STV method. The Cambridge rules also use the stack model, but with a variation. Instead of taking the ballots on the top, the pile is "sliced." This means that every Nth ballot is selected starting from the top of the pile. N is chosen to go through as much of the pile as possible.

Secondary surpluses are not allowed. When transferring votes, once a candidate has reached the winning threshold, she cannot receive any more ballots. Any ballots that would go to this candidate instead go to the next choice on the ballot.

After all surplus votes have been transferred, all candidates with fewer than 50 votes are eliminated. This is related to Cambridge's requirement that one must collect 50 signatures to be put on the ballot. It is also a matter of convenience as any candidate with fewer than 50 votes at this stage has virtually no chance of winning a seat.

VIII. British Columbia STV

This is a straightforward implementation of fractional transfer STV. For a full description, see the British Columbia STV rules available in the Help menu.

IX. Scottish Rules STV

Another straightforward implementation of fractional transfer STV, similar to British Columbia STV except that it uses five rather than six digits of precision.

X. GPCA 2000 Rules STV

The Green Party of California (GPCA) adopted these rules in 2000. The rules are described in the GPCA bylaws. The rules are based on the description of STV found in Electoral System Design: The New International IDEA Handbook, except that GPCA uses a fractional threshold, and does not elect candidates that do not reach the a full (static) threshold.

Neither IDEA nor the GPCA bylaws specify a method of breaking ties. This implementation breaks all ties randomly. See Jonathan Lundell's paper Random tie-breaking in STV for the rationale.

XI. ERS97 Rules

The ERS97 rules are a combination of the principles behind random transfer and fractional transfer STV. In my opinion, the rules are excessively and unnecessarily complicated. See http://www.electoral-reform.org.uk/votingsystems/stvrules.htm for the official rules.

The ERS97 rules are independent of the order of the ballots. The first time a candidate's surplus votes are transferred, the method described in Section V is used. These transfers can lead to secondary surpluses. However, the secondary transfers of surplus votes are done differently. For secondary transfers, only the last group of ballots received will be transferred. This resembles how ballots are transferred with random transfer STV methods. Tertiary transfers are possible, but much less likely to occur.

The ERS97 rules differ from the other rules presented here in many ways. See the python code for more details.

XII. N. Ireland STV

The rules used by N. Ireland are similar to but significantly less complicated than the ERS97 rules.

XIII. Meek and Warren STV

Previous rules are all designed for hand counting. Meek and Warren STV provide the most accurate proportional representation, but the count must be done with a computer and cannot be done by hand. The basic idea is similar to Fractional Transfer STV. There are two main differences: (1) winning candidates also receive vote transfers from eliminated candidates and surplus votes from other winning candidates, and (2) when a candidate is eliminated it is as if the candidate never entered the election. These changes create a feedback loop of vote transfers which requires a computer to implement.

XIV. Recommendations

For a group that values simplicity, I recommend Scottish STV. It is by far the easiest method to understand and it provides accurate proportional representation.

For a group that desires the most accurate proportional representation, I recommend Meek STV.

XV. Other Methods

I've added several other methods--Borda, Bucklin, Condorcet, and Coombs--that use ranked ballots and one method--approval voting--not based on ranked ballots.

With the Borda count, if there eight candidates competing, then a candidate gets seven points for every first ranking, six points for every second ranking, and so on. If a candidate is not ranked on a ballot then he gets no points. When more than one candidate is to be elected, the Borda count provides some degree of proportionality, but not as well as STV methods.

With the Bucklin system, if a candidate receives a majority of first choices, then she is elected. Otherwise, if a candidate is first or second on a majority of ballots, then she is elected. This process is repeated for higher choices as necessary.

Condorcet elects the candidate who wins all pairwise competitions against the other candidates. Sometimes a cycle will occur where no Condorcet winner exists. In this instance, other techniques are necessary to break the cycle. The set of candidates in the cycle is called the Smith set. Three methods are available for choosing the winner from the cycle: Borda, IRV, and Schwartz Sequential Dropping (SSD). The SSD implementation was adapted from code written by Mike Ossipoff and Russ Paielli.

Coombs is like IRV, but with one difference. The candidate with the most last rankings is eliminated at each round. If a ballot does not rank all the candidates, then the unlisted candidates share the last ranking equally.

With approval voting, each voter may approve of one or more candidates. The candidate being approved of by the largest number of voters is elected. Each candidate ranked on a ballot counts as an approval, and thus the order of the candidates on the ballot is not relevant.

History and use of voting systems around the world

filler

Links

Organizations Advocating for STV

Other STV Software

Other Links