Anti-Harassment Tools/SecurePoll Improvements/Test Results/5 3 2065

Comments
SecurePoll and OpenSTV agree on final results.

Election setup

 * Candidates: 5
 * Seats: 3
 * Votes: 2065

Actual
Output from SecurePoll : array(3) { ["elected"]=> array(3) { [0]=>   int(3) [1]=>   int(1) [2]=>   int(2) } ["eliminated"]=> array(2) { [0]=>   int(4) [1]=>   int(5) } ["rounds"]=> array(4) { [0]=>   array(8) { ["round"]=> int(1) ["surplus"]=> int(0) ["rankings"]=> array(5) { [1]=>       array(3) { ["votes"]=> int(0) ["earned"]=> int(515) ["total"]=> int(515) }       [2]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(510) ["total"]=> int(510) }       [3]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(520) ["total"]=> int(520) }       [4]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(260) ["total"]=> int(260) }       [5]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(260) ["total"]=> int(260) }     }      ["totalVotes"]=> int(2065) ["keepFactors"]=> array(5) { [1]=>       int(1) [2]=>       int(1) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) }     ["quota"]=> int(517) ["elected"]=> array(0) { }     ["eliminated"]=> array(0) { }   }    [1]=>    array(8) { ["round"]=> int(2) ["elected"]=> array(1) { [0]=>       int(3) }     ["eliminated"]=> array(0) { }     ["surplus"]=> int(3) ["keepFactors"]=> array(5) { [1]=>       int(1) [2]=>       int(1) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) }     ["quota"]=> int(517) ["rankings"]=> array(5) { [1]=>       array(3) { ["votes"]=> int(515) ["earned"]=> int(0) ["total"]=> int(515) }       [2]=>        array(3) { ["votes"]=> int(510) ["earned"]=> int(0) ["total"]=> int(510) }       [3]=>        array(3) { ["votes"]=> int(520) ["earned"]=> int(0) ["total"]=> int(520) }       [4]=>        array(3) { ["votes"]=> int(260) ["earned"]=> int(0) ["total"]=> int(260) }       [5]=>        array(3) { ["votes"]=> int(260) ["earned"]=> int(0) ["total"]=> int(260) }     }      ["totalVotes"]=> int(2065) }   [2]=>    array(8) { ["round"]=> int(3) ["elected"]=> array(0) { }     ["eliminated"]=> array(2) { [0]=>       int(4) [1]=>       int(5) }     ["surplus"]=> float(1) ["keepFactors"]=> array(5) { [1]=>       int(1) [2]=>       int(1) [3]=>       float(0.99423076923077) [4]=>       int(1) [5]=>       int(1) }     ["quota"]=> int(516) ["rankings"]=> array(5) { [1]=>       array(3) { ["votes"]=> int(515) ["earned"]=> int(0) ["total"]=> int(515) }       [2]=>        array(3) { ["votes"]=> int(510) ["earned"]=> int(0) ["total"]=> int(510) }       [3]=>        array(3) { ["votes"]=> int(520) ["earned"]=> float(-3) ["total"]=> float(517) }       [4]=>        array(3) { ["votes"]=> int(260) ["earned"]=> int(0) ["total"]=> int(260) }       [5]=>        array(3) { ["votes"]=> int(260) ["earned"]=> int(0) ["total"]=> int(260) }     }      ["totalVotes"]=> float(2062) }   [3]=>    array(8) { ["round"]=> int(4) ["elected"]=> array(2) { [0]=>       int(1) [1]=>       int(2) }     ["eliminated"]=> array(0) { }     ["surplus"]=> float(383) ["keepFactors"]=> array(5) { [1]=>       int(1) [2]=>       int(1) [3]=>       float(0.99230769230769) [4]=>       int(0) [5]=>       int(0) }     ["quota"]=> int(386) ["rankings"]=> array(5) { [1]=>       array(3) { ["votes"]=> int(515) ["earned"]=> int(0) ["total"]=> int(515) }       [2]=>        array(3) { ["votes"]=> int(510) ["earned"]=> int(0) ["total"]=> int(510) }       [3]=>        array(3) { ["votes"]=> float(517) ["earned"]=> float(-1) ["total"]=> float(516) }       [4]=>        array(3) { ["votes"]=> int(260) ["earned"]=> int(-260) ["total"]=> int(0) }       [5]=>        array(3) { ["votes"]=> int(260) ["earned"]=> int(-260) ["total"]=> int(0) }     }      ["totalVotes"]=> float(1541) } } }

Expected
Output from OpenSTV: Loading ballots from file 5_3_2065.blt. Ballot file contains 5 candidates and 2065 ballots. No candidates have withdrawn. Ballot file contains 2065 non-empty ballots.

Counting votes for Election Title using Meek STV. 5 candidates running for 3 seats.

R|A                |B                 |C                 |D |--+--+--+-- |E                 |Exhausted         |Surplus           |Threshold

=
================================================================= 1|       515.000000|        510.000000|        520.000000|        260.000000  |        260.000000|          0.000000|          3.749999|        516.250001  |---  | Count of first choices. Candidate C has reached the threshold and is | elected.

=
================================================================= 2|       515.000000|        510.000000|        516.250280|        260.000000  |        260.000000|          3.749720|          0.937709|        515.312571  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: C, 0.992789.

=
================================================================= 3|       515.000000|        510.000000|        515.312720|        260.000000  |        260.000000|          4.687280|          0.234539|        515.078181  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: C, 0.990986.

=
================================================================= 4|       515.000000|        510.000000|        515.078200|        260.000000  |        260.000000|          4.921800|          0.058649|        515.019551  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: C, 0.990535.

=
================================================================= 5|       515.000000|        510.000000|        515.019960|        260.000000  |        260.000000|          4.980040|          0.014969|        515.004991  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: C, 0.990423.

=
================================================================= 6|       515.000000|        510.000000|        515.005400|        260.000000  |        260.000000|          4.994600|          0.004049|        515.001351  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: C, 0.990395.

=
================================================================= 7|       515.000000|        510.000000|        515.001760|        260.000000  |        260.000000|          4.998240|          0.001319|        515.000441  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: C, 0.990388.

=
================================================================= 8|       515.000000|        510.000000|        515.000720|        260.000000  |        260.000000|          4.999280|          0.000539|        515.000181  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: C, 0.990386.

=
================================================================= 9|       515.000000|        510.000000|        515.000200|        260.000000  |        260.000000|          4.999800|          0.000149|        515.000051  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: C, 0.990385.

=
================================================================= 10|       515.000000|        510.000000|        515.000200|        260.000000  |        260.000000|          4.999800|          0.000149|        515.000051  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: C, 0.990385.

=
================================================================= 11|       515.000000|        510.000000|        515.000200|        260.000000  |                  |        264.999800|        190.000047|        450.000051  |---  | Count after eliminating E and transferring votes. Candidates tied within | precision of computations. Candidates D and E were tied when choosing | candidates to eliminate. Candidate E was chosen by breaking the tie | randomly. Candidates A and B have reached the threshold and are elected.

Winners are A, B, and C.

Files
array ( 1 =>   array ( 'count' => 515, 'rank' => array (     1 => '1',    ), ), '2_1' =>   array ( 'count' => 510, 'rank' => array (     1 => '2',      2 => '1',    ), ), 3 =>   array ( 'count' => 520, 'rank' => array (     1 => '3',    ), ), 4 =>   array ( 'count' => 260, 'rank' => array (     1 => '4',    ), ), 5 =>   array ( 'count' => 260, 'rank' => array (     1 => '5',    ), ), )
 * blt: https://github.com/dominic998/SecurePoll-Test-Data/blob/main/test_data/5_3_2065.blt
 * php:

Environment

 * Where you tested: local docker using phpunit
 * Version of SecurePoll: commit 271145d5f3cae3b0a1b76d0f5dfeb609615d60b7 (patch 16 from https://gerrit.wikimedia.org/r/c/mediawiki/extensions/SecurePoll/+/704454/)