Anti-Harassment Tools/SecurePoll Improvements/Test Results/20 6 5000 751478367

Comments
Case: All but one seat filled, two hopeful candidates.

Output of OpenSTV and SecurePoll agree.

Election setup

 * Candidates: 20
 * Seats: 6
 * Votes: 5000

Actual
Output from SecurePoll : array(3) { ["elected"]=> array(6) { [0]=>   int(2) [1]=>   int(4) [2]=>   int(6) [3]=>   int(8) [4]=>   int(19) [5]=>   int(17) } ["eliminated"]=> array(0) { } ["rounds"]=> array(3) { [0]=>   array(8) { ["round"]=> int(1) ["surplus"]=> int(0) ["rankings"]=> array(20) { [1]=>       array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [2]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(857) ["total"]=> int(857) }       [3]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [4]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(857) ["total"]=> int(857) }       [5]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [6]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(858) ["total"]=> int(858) }       [7]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [8]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(857) ["total"]=> int(857) }       [9]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [10]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [11]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [12]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(314) ["total"]=> int(314) }       [13]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [14]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [15]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [16]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [17]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(400) ["total"]=> int(400) }       [18]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [19]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(857) ["total"]=> int(857) }       [20]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }     }      ["totalVotes"]=> int(5000) ["keepFactors"]=> array(20) { [1]=>       int(1) [2]=>       int(1) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) [8]=>       int(1) [9]=>       int(1) [10]=>       int(1) [11]=>       int(1) [12]=>       int(1) [13]=>       int(1) [14]=>       int(1) [15]=>       int(1) [16]=>       int(1) [17]=>       int(1) [18]=>       int(1) [19]=>       int(1) [20]=>       int(1) }     ["quota"]=> int(715) ["elected"]=> array(0) { }     ["eliminated"]=> array(0) { }   }    [1]=>    array(8) { ["round"]=> int(2) ["elected"]=> array(5) { [0]=>       int(2) [1]=>       int(4) [2]=>       int(6) [3]=>       int(8) [4]=>       int(19) }     ["eliminated"]=> array(0) { }     ["surplus"]=> int(711) ["keepFactors"]=> array(20) { [1]=>       int(1) [2]=>       int(1) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) [8]=>       int(1) [9]=>       int(1) [10]=>       int(1) [11]=>       int(1) [12]=>       int(1) [13]=>       int(1) [14]=>       int(1) [15]=>       int(1) [16]=>       int(1) [17]=>       int(1) [18]=>       int(1) [19]=>       int(1) [20]=>       int(1) }     ["quota"]=> int(715) ["rankings"]=> array(20) { [1]=>       array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [2]=>        array(3) { ["votes"]=> int(857) ["earned"]=> int(0) ["total"]=> int(857) }       [3]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [4]=>        array(3) { ["votes"]=> int(857) ["earned"]=> int(0) ["total"]=> int(857) }       [5]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [6]=>        array(3) { ["votes"]=> int(858) ["earned"]=> int(0) ["total"]=> int(858) }       [7]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [8]=>        array(3) { ["votes"]=> int(857) ["earned"]=> int(0) ["total"]=> int(857) }       [9]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [10]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [11]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [12]=>        array(3) { ["votes"]=> int(314) ["earned"]=> int(0) ["total"]=> int(314) }       [13]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [14]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [15]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [16]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [17]=>        array(3) { ["votes"]=> int(400) ["earned"]=> int(0) ["total"]=> int(400) }       [18]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [19]=>        array(3) { ["votes"]=> int(857) ["earned"]=> int(0) ["total"]=> int(857) }       [20]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }     }      ["totalVotes"]=> int(5000) }   [2]=>    array(8) { ["round"]=> int(3) ["elected"]=> array(1) { [4]=>       int(17) }     ["eliminated"]=> array(0) { }     ["surplus"]=> float(335) ["keepFactors"]=> array(20) { [1]=>       int(1) [2]=>       float(0.8343057176196) [3]=>       int(1) [4]=>       float(0.8343057176196) [5]=>       int(1) [6]=>       float(0.83333333333333) [7]=>       int(1) [8]=>       float(0.8343057176196) [9]=>       int(1) [10]=>       int(1) [11]=>       int(1) [12]=>       int(1) [13]=>       int(1) [14]=>       int(1) [15]=>       int(1) [16]=>       int(1) [17]=>       int(1) [18]=>       int(1) [19]=>       float(0.8343057176196) [20]=>       int(1) }     ["quota"]=> int(654) ["rankings"]=> array(20) { [1]=>       array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [2]=>        array(3) { ["votes"]=> int(857) ["earned"]=> float(-142) ["total"]=> float(715) }       [3]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [4]=>        array(3) { ["votes"]=> int(857) ["earned"]=> float(-142) ["total"]=> float(715) }       [5]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [6]=>        array(3) { ["votes"]=> int(858) ["earned"]=> float(-143) ["total"]=> float(715) }       [7]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [8]=>        array(3) { ["votes"]=> int(857) ["earned"]=> float(-142) ["total"]=> float(715) }       [9]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [10]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [11]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [12]=>        array(3) { ["votes"]=> int(314) ["earned"]=> int(0) ["total"]=> int(314) }       [13]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [14]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [15]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [16]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [17]=>        array(3) { ["votes"]=> int(400) ["earned"]=> float(284) ["total"]=> float(684) }       [18]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [19]=>        array(3) { ["votes"]=> int(857) ["earned"]=> float(-142) ["total"]=> float(715) }       [20]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }     }      ["totalVotes"]=> float(4573) } } }

Elected
Election for 6 seats with 20 candidates. Total 5,000 votes.


 * 1) "2"
 * 2) "4"
 * 3) "6"
 * 4) "8"
 * 5) "19"
 * 6) "17"

Eliminated/Not elected

 * "12"
 * "10"
 * "15"
 * "5"
 * "1"
 * "3"
 * "7"
 * "9"
 * "11"
 * "13"
 * "14"
 * "16"
 * "18"
 * "20"

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 14:25, 31 August 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 20_6_5000_751478367.blt. Ballot file contains 20 candidates and 5000 ballots. No candidates have withdrawn. Ballot file contains 5000 non-empty ballots.

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

R|1         |2          |3          |4          |5          |6 |---+---+---+---+---+--- |7          |8          |9          |10         |11         |12           |---+---+---+---+---+---  |13         |14         |15         |16         |17         |18           |---+---+---+---+---+---  |19         |20         |Exhausted  |Surplus    |Threshold

=
============================================================= 1|  0.000000| 857.000000|   0.000000| 857.000000|   0.000000| 858.000000  |   0.000000| 857.000000|   0.000000|   0.000000|   0.000000| 314.000000  |   0.000000|   0.000000|   0.000000|   0.000000| 400.000000|   0.000000  | 857.000000|   0.000000|   0.000000| 714.571425| 714.285715  |---  | Count of first choices. Candidates 2, 4, 6, 8, and 19 have reached the | threshold and are elected.

=
============================================================= 2|          | 714.286361|           | 714.286361|           | 714.285858  |           | 714.286361|           |           |           | 314.000000  |           |           |           |           | 685.427278|             | 714.286361|           | 429.141420| 338.979792| 652.979798  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: 2, 0.833473; 4, 0.833473; 6, 0.832501; 8, | 0.833473; and 19, 0.833473. Candidate 17 has reached the threshold and | is elected.

Winners are 2, 4, 6, 8, 17, and 19.

Files
array ( 12 =>   array ( 'count' => 314, 'rank' => array (     1 => 12,    ), ), 17 =>   array ( 'count' => 400, 'rank' => array (     1 => 17,    ), ), '2_17' =>   array ( 'count' => 857, 'rank' => array (     1 => 2,      2 => 17,    ), ), 19 =>   array ( 'count' => 857, 'rank' => array (     1 => 19,    ), ), '4_17' =>   array ( 'count' => 857, 'rank' => array (     1 => 4,      2 => 17,    ), ), 8 =>   array ( 'count' => 857, 'rank' => array (     1 => 8,    ), ), 6 =>   array ( 'count' => 858, 'rank' => array (     1 => 6,    ), ), )
 * blt: https://github.com/dominic998/SecurePoll-Test-Data/blob/main/test_data/20_6_5000_751478367.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/)