For a detailed description of Frege's voting method as well as the modified Frege method, see the research paper by Harrenstein, Lackner, and Lackner [1].
For a fixed electorate:
from frege import frege, modfrege
profile = [1, 1, 1, 1, 1, 5]
k = 10
frege(profile, k, verbose=True)
modfrege(profile, k, verbose=True)
For a variable electorate:
from frege import frege, modfrege
profiles = [[3, 2, 1], [3, 1, 1], [1, 2, 2]]
frege(profiles, verbose=True)
modfrege(profiles, verbose=True)
Further examples can be found in examples.py, all of which are described in [1].
- Requires Python 2.7 or 3.6+. The module gmpy2 is optional. If gmpy2 is not available, the much slower Python module fractions is used to compute fractions.
- The file bias.py contains the code for the experiments in "A Mathematical Analysis of an Election System Proposed by Gottlob Frege" [1], Section 5.3.
[1] Paul Harrenstein, Marie-Louise Lackner, and Martin Lackner. A Mathematical Analysis of an Election System Proposed by Gottlob Frege. To appear in Erkenntnis. 2020. Preprint: https://arxiv.org/abs/1907.03643