Anti-Harassment Tools/SecurePoll Improvements/Test Results/7 6 566 1185838663

Comments
SecurePoll and OpenSTV agree on final results.

Election setup

 * Candidates: 7
 * Seats: 6
 * Votes: 566

Actual
Output from SecurePoll: array(3) { ["elected"]=> array(6) { [0]=>   int(1) [1]=>   int(2) [2]=>   int(4) [3]=>   int(5) [4]=>   int(6) [5]=>   int(7) } ["eliminated"]=> array(1) { [0]=>   int(3) } ["rounds"]=> array(7) { [0]=>   array(8) { ["round"]=> int(1) ["surplus"]=> int(0) ["rankings"]=> array(7) { [1]=>       array(3) { ["votes"]=> int(0) ["earned"]=> int(102) ["total"]=> int(102) }       [2]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(101) ["total"]=> int(101) }       [3]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(72) ["total"]=> int(72) }       [4]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(73) ["total"]=> int(73) }       [5]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(72) ["total"]=> int(72) }       [6]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(73) ["total"]=> int(73) }       [7]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(73) ["total"]=> int(73) }     }      ["totalVotes"]=> int(566) ["keepFactors"]=> array(7) { [1]=>       int(1) [2]=>       int(1) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) }     ["quota"]=> int(81) ["elected"]=> array(0) { }     ["eliminated"]=> array(0) { }   }    [1]=>    array(8) { ["round"]=> int(2) ["elected"]=> array(2) { [0]=>       int(1) [1]=>       int(2) }     ["eliminated"]=> array(0) { }     ["surplus"]=> int(41) ["keepFactors"]=> array(7) { [1]=>       int(1) [2]=>       int(1) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) }     ["quota"]=> int(81) ["rankings"]=> array(7) { [1]=>       array(3) { ["votes"]=> int(102) ["earned"]=> int(0) ["total"]=> int(102) }       [2]=>        array(3) { ["votes"]=> int(101) ["earned"]=> int(0) ["total"]=> int(101) }       [3]=>        array(3) { ["votes"]=> int(72) ["earned"]=> int(0) ["total"]=> int(72) }       [4]=>        array(3) { ["votes"]=> int(73) ["earned"]=> int(0) ["total"]=> int(73) }       [5]=>        array(3) { ["votes"]=> int(72) ["earned"]=> int(0) ["total"]=> int(72) }       [6]=>        array(3) { ["votes"]=> int(73) ["earned"]=> int(0) ["total"]=> int(73) }       [7]=>        array(3) { ["votes"]=> int(73) ["earned"]=> int(0) ["total"]=> int(73) }     }      ["totalVotes"]=> int(566) }   [2]=>    array(8) { ["round"]=> int(3) ["elected"]=> array(0) { }     ["eliminated"]=> array(0) { }     ["surplus"]=> float(13.452824694234) ["keepFactors"]=> array(7) { [1]=>       float(0.79411764705882) [2]=>       float(0.8019801980198) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) }     ["quota"]=> int(81) ["rankings"]=> array(7) { [1]=>       array(3) { ["votes"]=> int(102) ["earned"]=> float(-15.967967384974) ["total"]=> float(86.032032615026) }       [2]=>        array(3) { ["votes"]=> int(101) ["earned"]=> float(-11.579207920792) ["total"]=> float(89.420792079208) }       [3]=>        array(3) { ["votes"]=> int(72) ["earned"]=> float(4.4231217239371) ["total"]=> float(76.423121723937) }       [4]=>        array(3) { ["votes"]=> int(73) ["earned"]=> float(5.9321490972626) ["total"]=> float(78.932149097263) }       [5]=>        array(3) { ["votes"]=> int(72) ["earned"]=> float(5.5960978450786) ["total"]=> float(77.596097845079) }       [6]=>        array(3) { ["votes"]=> int(73) ["earned"]=> float(4.8270238788584) ["total"]=> float(77.827023878858) }       [7]=>        array(3) { ["votes"]=> int(73) ["earned"]=> float(4.563191613279) ["total"]=> float(77.563191613279) }     }      ["totalVotes"]=> float(563.79440885265) }   [3]=>    array(8) { ["round"]=> int(4) ["elected"]=> array(0) { }     ["eliminated"]=> array(0) { }     ["surplus"]=> float(3.5277865434787) ["keepFactors"]=> array(7) { [1]=>       float(0.74766953025041) [2]=>       float(0.72645739910314) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) }     ["quota"]=> int(81) ["rankings"]=> array(7) { [1]=>       array(3) { ["votes"]=> float(86.032032615026) ["earned"]=> float(-3.2251175561715) ["total"]=> float(82.806915058855) }       [2]=>        array(3) { ["votes"]=> float(89.420792079208) ["earned"]=> float(-6.6999205945842) ["total"]=> float(82.720871484624) }       [3]=>        array(3) { ["votes"]=> float(76.423121723937) ["earned"]=> float(1.5894767057776) ["total"]=> float(78.012598429715) }       [4]=>        array(3) { ["votes"]=> float(78.932149097263) ["earned"]=> float(1.9344479538007) ["total"]=> float(80.866597051063) }       [5]=>        array(3) { ["votes"]=> float(77.596097845079) ["earned"]=> float(1.83231146844) ["total"]=> float(79.428409313519) }       [6]=>        array(3) { ["votes"]=> float(77.827023878858) ["earned"]=> float(1.7114476215026) ["total"]=> float(79.538471500361) }       [7]=>        array(3) { ["votes"]=> float(77.563191613279) ["earned"]=> float(1.5212667579291) ["total"]=> float(79.084458371208) }     }      ["totalVotes"]=> float(562.45832120934) }   [4]=>    array(8) { ["round"]=> int(5) ["elected"]=> array(1) { [2]=>       int(4) }     ["eliminated"]=> array(0) { }     ["surplus"]=> float(1.3106049527112) ["keepFactors"]=> array(7) { [1]=>       float(0.73135476556806) [2]=>       float(0.71134464943702) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) }     ["quota"]=> int(81) ["rankings"]=> array(7) { [1]=>       array(3) { ["votes"]=> float(82.806915058855) ["earned"]=> float(-1.453226051202) ["total"]=> float(81.353689007653) }       [2]=>        array(3) { ["votes"]=> float(82.720871484624) ["earned"]=> float(-1.1289950358799) ["total"]=> float(81.591876448744) }       [3]=>        array(3) { ["votes"]=> float(78.012598429715) ["earned"]=> float(0.39589661184799) ["total"]=> float(78.408495041563) }       [4]=>        array(3) { ["votes"]=> float(80.866597051063) ["earned"]=> float(0.49844244525074) ["total"]=> float(81.365039496314) }       [5]=>        array(3) { ["votes"]=> float(79.428409313519) ["earned"]=> float(0.45535741152858) ["total"]=> float(79.883766725047) }       [6]=>        array(3) { ["votes"]=> float(79.538471500361) ["earned"]=> float(0.42732412619649) ["total"]=> float(79.965795626558) }       [7]=>        array(3) { ["votes"]=> float(79.084458371208) ["earned"]=> float(0.39756990388039) ["total"]=> float(79.482028275088) }     }      ["totalVotes"]=> float(562.05069062097) }   [5]=>    array(8) { ["round"]=> int(6) ["elected"]=> array(0) { }     ["eliminated"]=> array(1) { [0]=>       int(3) }     ["surplus"]=> float(0.46862373961443) ["keepFactors"]=> array(7) { [1]=>       float(0.72817516616168) [2]=>       float(0.70618447708571) [3]=>       int(1) [4]=>       float(0.9955135584205) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) }     ["quota"]=> int(81) ["rankings"]=> array(7) { [1]=>       array(3) { ["votes"]=> float(81.353689007653) ["earned"]=> float(-0.173111795131) ["total"]=> float(81.180577212522) }       [2]=>        array(3) { ["votes"]=> float(81.591876448744) ["earned"]=> float(-0.43820501589461) ["total"]=> float(81.153671432849) }       [3]=>        array(3) { ["votes"]=> float(78.408495041563) ["earned"]=> float(0.17888387242287) ["total"]=> float(78.587378913986) }       [4]=>        array(3) { ["votes"]=> float(81.365039496314) ["earned"]=> float(-0.23066440207102) ["total"]=> float(81.134375094243) }       [5]=>        array(3) { ["votes"]=> float(79.883766725047) ["earned"]=> float(0.18933304855283) ["total"]=> float(80.0730997736) }       [6]=>        array(3) { ["votes"]=> float(79.965795626558) ["earned"]=> float(0.18920136162895) ["total"]=> float(80.154996988187) }       [7]=>        array(3) { ["votes"]=> float(79.482028275088) ["earned"]=> float(0.1761029912555) ["total"]=> float(79.658131266344) }     }      ["totalVotes"]=> float(561.94223068173) }   [6]=>    array(8) { ["round"]=> int(7) ["elected"]=> array(3) { [3]=>       int(5) [4]=>       int(6) [5]=>       int(7) }     ["eliminated"]=> array(0) { }     ["surplus"]=> float(75.901962461747) ["keepFactors"]=> array(7) { [1]=>       float(0.72655542106687) [2]=>       float(0.70484725624858) [3]=>       int(0) [4]=>       float(0.99386478466612) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) }     ["quota"]=> int(81) ["rankings"]=> array(7) { [1]=>       array(3) { ["votes"]=> float(81.180577212522) ["earned"]=> float(8.0356083540056) ["total"]=> float(89.216185566528) }       [2]=>        array(3) { ["votes"]=> float(81.153671432849) ["earned"]=> float(6.8746053209914) ["total"]=> float(88.028276753841) }       [3]=>        array(3) { ["votes"]=> float(78.587378913986) ["earned"]=> float(-78.587378913986) ["total"]=> float(0) }       [4]=>        array(3) { ["votes"]=> float(81.134375094243) ["earned"]=> float(19.389330238447) ["total"]=> float(100.52370533269) }       [5]=>        array(3) { ["votes"]=> float(80.0730997736) ["earned"]=> float(14.889948016427) ["total"]=> float(94.963047790027) }       [6]=>        array(3) { ["votes"]=> float(80.154996988187) ["earned"]=> float(13.110418664536) ["total"]=> float(93.265415652722) }       [7]=>        array(3) { ["votes"]=> float(79.658131266344) ["earned"]=> float(16.247200099595) ["total"]=> float(95.905331365939) }     }      ["totalVotes"]=> float(561.90196246175) } } }

Elected
Election for 6 seats with 7 candidates. Total 566 votes.


 * 1) "1"
 * 2) "2"
 * 3) "4"
 * 4) "6"
 * 5) "5"
 * 6) "7"

Eliminated/Not elected

 * "3"

Rounds table
The following table describes the calculations that happened in order to achieve the result above. In each round of calculation, the candidate(s) who achieved more votes than the quota are declared elected. Their surplus votes above the quota are redistributed to the remaining candidates. If nobody achieves the quota, the lowest ranking candidate is eliminated and their votes are redistributed to the remaining candidates. To understand this better, please refer to this link. (Results from 03:30, 1 September 2021)

Navigation menu

 * Admin
 * Talk
 * Preferences
 * Watchlist
 * Contributions
 * Log out


 * Special page


 * Main page
 * Recent changes
 * Random page
 * Help about MediaWiki

Tools

 * Special pages
 * Printable version

Expected
Output from OpenSTV: Loading ballots from file 7_6_566_1185838663.blt. Ballot file contains 7 candidates and 566 ballots. No candidates have withdrawn. Ballot file contains 566 non-empty ballots.

Counting votes for ElectionTitle using Meek STV. 7 candidates running for 6 seats.

R|1            |2             |3             |4             |5 |--+--+--+--+-- |6             |7             |Exhausted     |Surplus       |Threshold

=
================================================================ 1|   102.000000|    101.000000|     72.000000|     73.000000|     72.000000  |     73.000000|     73.000000|      0.000000|     41.285714|     80.857143  |--  | Count of first choices. Candidates 1 and 2 have reached the threshold and | are elected.

=
================================================================ 2|    85.916273|     89.320255|     76.457006|     78.975549|     77.636402  |     77.863722|     77.597306|      2.233487|     14.160380|     80.538074  |--  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: 1, 0.792718 and 2, 0.800566.

=
================================================================ 3|    82.409869|     82.364946|     78.128809|     81.012156|     79.562124  |     79.663860|     79.200313|      3.657923|      4.783222|     80.334583  |--  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: 1, 0.743096 and 2, 0.721853. Candidate 4 has | reached the threshold and is elected.

=
================================================================ 4|    80.859000|     81.079419|     78.716280|     80.910733|     80.209923  |     80.291424|     79.792984|      4.140237|      2.077852|     80.265681  |--  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: 1, 0.724383; 2, 0.704059; and 4, 0.991637. | Candidate 6 has reached the threshold and is elected.

=
================================================================ 5|    80.537646|     80.525122|     79.004749|     80.466566|     80.512529  |     80.564631|     80.081220|      4.307537|      1.397589|     80.241781  |--  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: 1, 0.719068; 2, 0.696993; 4, 0.983732; and | 6, 0.999680. Candidate 5 has reached the threshold and is elected.

=
================================================================ 6|    80.417720|     80.426781|     79.220540|     80.408265|     80.420684  |     80.414630|     80.310382|      4.380998|      1.010740|     80.231287  |--  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: 1, 0.716427; 2, 0.694541; 4, 0.980984; 5, | 0.996638; and 6, 0.995674. Candidate 7 has reached the threshold and is | elected.

Winners are 1, 2, 4, 5, 6, and 7.

Files

 * blt: https://github.com/dominic998/SecurePoll-Test-Data/blob/main/test_data/7_6_566_1185838663.blt
 * php: https://phabricator.wikimedia.org/P16856

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/)