Jump to content

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

From mediawiki.org

Comments

[edit]

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

Output of OpenSTV and SecurePoll agree.

Election setup

[edit]
  • Candidates: 20
  • Seats: 6
  • Votes: 5000

Actual

[edit]

Output from SecurePoll (var_dump( $this->tallier->resultsLog );):

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

Actual tally: SP 3.0.0 (58bf4c8)

[edit]

Elected

[edit]

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

[edit]
  • "12"
  • "10"
  • "15"
  • "5"
  • "1"
  • "3"
  • "7"
  • "9"
  • "11"
  • "13"
  • "14"
  • "16"
  • "18"
  • "20"

Rounds table

[edit]

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.

Round Number Tally Result
1
  1. "2": 800
  2. "19": 800
  3. "4": 800
  4. "6": 800
  5. "8": 800
  6. "1": 67
  7. "18": 67
  8. "16": 67
  9. "14": 67
  10. "13": 67
  11. "11": 67
  12. "9": 67
  13. "7": 67
  14. "3": 67
  15. "20": 67
  16. "12": 66
  17. "10": 66
  18. "15": 66
  19. "17": 66
  20. "5": 66
Quota: 714.285715
2
  1. "2": 800
  2. "19": 800
  3. "4": 800
  4. "6": 800
  5. "8": 800
  6. "1": 67
  7. "18": 67
  8. "16": 67
  9. "14": 67
  10. "13": 67
  11. "11": 67
  12. "9": 67
  13. "7": 67
  14. "3": 67
  15. "20": 67
  16. "12": 66
  17. "10": 66
  18. "15": 66
  19. "17": 66
  20. "5": 66
Quota: 714.285715

Elected: "2", "4", "6", "8", "19"

3
  1. "19": 800 - 85.714285 = 714.285715 (keep factor: 0.892857)
  2. "4": 800 - 85.714285 = 714.285715 (keep factor: 0.892857)
  3. "6": 800 - 85.714285 = 714.285715 (keep factor: 0.892857)
  4. "8": 800 - 85.714285 = 714.285715 (keep factor: 0.892857)
  5. "2": 800 - 85.714285 = 714.285715 (keep factor: 0.892857)
  6. "17": 66 + 428.571424 = 494.571424
  7. "1": 67
  8. "13": 67
  9. "18": 67
  10. "16": 67
  11. "14": 67
  12. "11": 67
  13. "9": 67
  14. "7": 67
  15. "3": 67
  16. "20": 67
  17. "12": 66
  18. "10": 66
  19. "15": 66
  20. "5": 66
Quota: 714.285715

Eliminated: "12", "10", "15", "5" Transferring votes

4
  1. "17": 494.571424 + 264.000000 = 758.571424
  2. "19": 714.285715 (keep factor: 0.892857)
  3. "4": 714.285715 (keep factor: 0.892857)
  4. "6": 714.285715 (keep factor: 0.892857)
  5. "8": 714.285715 (keep factor: 0.892857)
  6. "2": 714.285715 (keep factor: 0.892857)
  7. "1": 67
  8. "13": 67
  9. "18": 67
  10. "16": 67
  11. "14": 67
  12. "11": 67
  13. "9": 67
  14. "7": 67
  15. "3": 67
  16. "20": 67
Quota: 714.285715

Elected: "17" Transferring votes

(Results from 14:25, 31 August 2021)

[edit]
  • Admin
  • Talk
  • Preferences
  • Watchlist
  • Contributions
  • Log out
  • Special page

Tools

[edit]
  • Special pages
  • Printable version



Expected

[edit]

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

[edit]
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,
    ),
  ),
)

Environment

[edit]