Skip to content

Code for generating and running ballot-level comparison audits for IRV elections.

License

Notifications You must be signed in to change notification settings

michelleblom/audit-irv-cp

Repository files navigation

--------------------------------------------------------------------------------------
!!NOTE!! If you are looking for RAIRE, you want to check out the branch: raire-branch
!!NOTE!! If you are looking for our work on auditing primaries, you want to check out the branch: primary_viability
--------------------------------------------------------------------------------------

Find audit specification with the following command (taking NSW 2015 election as an example) to generate an audit specification given a 5% risk limit and a 1% chance of an error being injected into each ballot. You can find some data files for use with this code in NSW2015.tar.gz (also available on github). 

We have adapted Philip Stark's comparison audits (for first past the post elections) to IRV. As we poll a single ballot at a time, we set the lambda parameter to 0. See Stark's paper "Super-Simple Simultaneous Single-Ballot Risk-Limiting Audits" for a description of how risk limiting comparison audits work and how to set the lambda parameter.

./irvaudit -act_ballots Data_NA_Albury.txt_ballots.txt -rep_ballots Data_NA_Albury.txt_ballots.txt -r 0.05 -gamma 1.1 -lambda 0 -agap 0 -dive -s 39284575696785 -eseed 9284896769459 -eprob 0.01

You should get the following output:

440 errors added.
============================================
AUDITS REQUIRED
EO,Winner,3,Loser,0,Eliminated,1,2,4
EO,Winner,0,Loser,1,Eliminated,2,3,4
EO,Winner,0,Loser,4,Eliminated,1,2,3
EO,Winner,0,Loser,2,Eliminated,1,3,4
WO,Winner,3,Loser,4,Eliminated
WO,Winner,3,Loser,2,Eliminated
EO,Winner,3,Loser,4,Eliminated,0,1,2
WO,Winner,3,Loser,1,Eliminated
EO,Winner,3,Loser,2,Eliminated,0,1,4
EO,Winner,3,Loser,1,Eliminated,0,2,4
MAX ASN(%) 0.0582713
============================================
TIME,0.117114,Nodes Expanded,0,MAX ASN(%),0.0582713


This means that the algorithm found a series of facts (one per line) to audit, requiring an estimated 0.06% of total ballots cast to be polled.

Let's now take the above audit specification and run it! With the above output in a file called audit.txt, we do this with the command:

./irvaudit -act_ballots Data_NA_Albury.txt_ballots.txt -rep_ballots Data_NA_Albury.txt_ballots.txt -r 0.05 -run audit.txt -gamma 1.1 -lambda 0 -s 39284575696785 -eseed 9284896769459 -eprob 0.01

NOTE that you might beed to replace a line of code in model.cpp (line 65) with a version of python you have (if you don't have python3.6. Yes, I know -- this could have been done better). 

You should see a lot of text logging changes in the statistics being maintained by the audit, with the following at the bottom:

TOTAL BALLOTS POLLED = 25 (0.0539549%)
SUCCESSFUL AUDITS = 10/10


About

Code for generating and running ballot-level comparison audits for IRV elections.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published