Irish 1990 presidential elections

A simple example of a transferable vote system: evaluating the result of the 1990 presidential elections in Ireland. We choose it because the transferable vote system variant is quite simple, as is described below, and the result differs from the one obtainable by simple plurality evaluation. (We will not go into what-if scenarios here; the change of a voting system usually means a change in voter behavior due to strategic voting.)

[1]:
import sys
import os

sys.path.append(os.path.join('..', '..'))
import votelib.candidate
import votelib.evaluate.sequential

Evaluator construction

First, we construct the evaluator.

All of Ireland forms a single constituency for presidential elections so the votes may be summed over the whole country and there is a single evaluation taking place.

Ireland uses the Single Transferable Vote system with the Hare (stochastic) variant of vote transfer and the Droop quota for election. There are no further thresholds or conditions in the evaluation.

[2]:
evaluator = votelib.evaluate.sequential.TransferableVoteSelector(
    quota_function='droop',
    transferer='Hare'
)

Vote construction

We use the vote counts from the official result. Full preference lists and their counts are not published; however, the vote transfer records allow us to infer enough to reconstruct the result.

Transferable voting uses ranked votes, so we use tuples of candidate names to encode voter preferences.

[3]:
votes = {
    ('Mary Robinson',): 612265,
    ('Brian Lenihan',): 694484,
    ('Austin Currie', 'Brian Lenihan'): 36789,
    ('Austin Currie', 'Mary Robinson'): 205565,
    ('Austin Currie',): 25548,
}

Performing the evaluation

When the evaluator is set up correctly, obtaining the result is simple. If we do not specify the number of seats explicitly, most evaluators will provide 1 as the default value.

[4]:
print(evaluator.evaluate(votes))
['Mary Robinson']