practice / data /seat-count /eval.jsonl
birgermoell's picture
Add Swedish quality audit, tests, source holdouts and per-subset language metadata
1ba413f verified
Raw History Blame Contribute Delete
48.2 kB
{"id": "seat-count-constituencies-d1-e0000", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 1, "seed": 10000, "title": "3 constituencies, 4 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency.\n\nWithin each constituency the seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `vote_share_percent`: object keyed by party: share of the national valid votes in per cent, 2 decimals.\n- `seat_share_percent`: object keyed by party: share of all seats in per cent, 2 decimals.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 26, "path": "tasks/seat-count/seat-count-constituencies-d1-e0000", "languages": ["en"], "task_meta": {"constituencies": 3, "parties": 4}}
{"id": "seat-count-highest-averages-d1-e0001", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 1, "seed": 10001, "title": "7 seats by dhondt", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the votes for each party in an election for 7 seats.\n\nThe seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...). A party takes part in the allocation only if it has at least 4% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 7 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/seat-count/seat-count-highest-averages-d1-e0001", "languages": ["en"], "task_meta": {"parties": 5, "seats": 7}}
{"id": "seat-count-largest-remainder-d1-e0002", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 1, "seed": 10002, "title": "9 seats by hare quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the votes for each party in an election for 9 seats. Every party takes part in the allocation.\n\nThe seats are allocated by the largest-remainder method with the Hare quota, Q = V / S (not rounded). S is the number of seats and V is the total vote of the parties that take part in the allocation. The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/seat-count/seat-count-largest-remainder-d1-e0002", "languages": ["en"], "task_meta": {"parties": 5, "seats": 9}}
{"id": "seat-count-constituencies-d2-e0003", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 2, "seed": 10003, "title": "5 constituencies, 6 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share. A party takes part in the allocation, in every constituency, only if it has at least 3% of the valid votes in the whole country. A party with no row in a constituency did not stand there and has no votes there.\n\nWithin each constituency the seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `turnout_percent`: all ballots cast in the country (valid, blank and invalid) as a percentage of all registered voters (`registered_voters` in `constituencies.csv`), 2 decimals.\n- `qualified`: list of the parties that reach the national threshold (any order).\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term, also those with no seats; blank and invalid ballots are not a party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/seat-count/seat-count-constituencies-d2-e0003", "languages": ["en"], "task_meta": {"constituencies": 5, "parties": 6}}
{"id": "seat-count-highest-averages-d2-e0004", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 2, "seed": 10004, "title": "17 seats by modified-sainte-lague", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the count from 4 counting districts in an election for 17 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nThe seats are allocated by the highest-averages method modified Sainte-Lague (divisors 1.2, 3, 5, 7, ...: the first divisor is 1.2 instead of 1). A party takes part in the allocation only if it has at least 5% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 17 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/seat-count/seat-count-highest-averages-d2-e0004", "languages": ["en"], "task_meta": {"parties": 7, "seats": 17}}
{"id": "seat-count-largest-remainder-d2-e0005", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 2, "seed": 10005, "title": "12 seats by droop quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the count from 4 counting districts in an election for 12 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nA party takes part in the allocation only if it has at least 4% of the valid votes.\n\nThe seats are allocated by the largest-remainder method with the Droop quota, Q = floor(V / (S + 1)) + 1. S is the number of seats and V is the total vote of the parties that take part in the allocation (votes for parties under the threshold are not part of V). The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `qualified`: list of the parties that reach the threshold (any order).\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none, including those under the threshold).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/seat-count/seat-count-largest-remainder-d2-e0005", "languages": ["en"], "task_meta": {"parties": 7, "seats": 12}}
{"id": "seat-count-constituencies-d3-e0006", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 3, "seed": 10006, "title": "7 constituencies, 7 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share. A party takes part in the allocation, in every constituency, only if it has at least 4% of the valid votes in the whole country. A party with no row in a constituency did not stand there and has no votes there.\n\nWithin each constituency the seats are allocated by the highest-averages method modified Sainte-Lague (divisors 1.4, 3, 5, 7, ...: the first divisor is 1.4 instead of 1): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nOn top of the 57 fixed constituency seats there are 4 levelling seats, 61 seats in all. They are shared out like this:\n\n1. Allocate the fixed seats in each constituency as described above.\n2. Allocate all 61 seats among the qualifying parties by their national votes, with the same method. This is each party's entitlement.\n3. If a party has won more fixed seats than its entitlement, it keeps its fixed seats and gets no levelling seats. Set every such party aside, take its fixed seats off the 61, and repeat step 2 for the remaining parties and the remaining seats. Repeat until no remaining party has more fixed seats than its entitlement.\n4. Each remaining party gets levelling seats equal to its entitlement minus its fixed seats.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `turnout_percent`: all ballots cast in the country (valid, blank and invalid) as a percentage of all registered voters (`registered_voters` in `constituencies.csv`), 2 decimals.\n- `qualified`: list of the parties that reach the national threshold (any order).\n- `fixed_seats`: object keyed by party: fixed seats summed over the constituencies, an integer for every party (0 if none).\n- `levelling_seats`: object keyed by party: levelling seats, an integer for every party (0 if none).\n- `total_seats`: object keyed by party: fixed plus levelling seats.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats (fixed plus levelling). Include every party on the ballot as its own term, also those with no seats; blank and invalid ballots are not a party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 25, "path": "tasks/seat-count/seat-count-constituencies-d3-e0006", "languages": ["en"], "task_meta": {"constituencies": 7, "parties": 7}}
{"id": "seat-count-highest-averages-d3-e0007", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 3, "seed": 10007, "title": "47 seats by dhondt", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the count from 7 counting districts in an election for 47 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nThe seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...). A party takes part in the allocation only if it has at least 3% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 47 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n- `comparison_seats`: object keyed by party: the seats each party would get if the method were Sainte-Lague (divisors 1, 3, 5, 7, ...) instead, with the same threshold.\n- `changed`: list of the parties whose seat count differs between the two methods (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 34, "path": "tasks/seat-count/seat-count-highest-averages-d3-e0007", "languages": ["en"], "task_meta": {"parties": 9, "seats": 47}}
{"id": "seat-count-largest-remainder-d3-e0008", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 3, "seed": 10008, "title": "15 seats by hare quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the count from 6 counting districts in an election for 15 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nA party takes part in the allocation only if it has at least 5% of the valid votes.\n\nThe seats are allocated by the largest-remainder method with the Hare quota, Q = V / S (not rounded). S is the number of seats and V is the total vote of the parties that take part in the allocation (votes for parties under the threshold are not part of V). The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `qualified`: list of the parties that reach the threshold (any order).\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none, including those under the threshold).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n- `comparison_quota`: the quota if the election used the Droop quota, Q = floor(V / (S + 1)) + 1 instead, 2 decimals.\n- `comparison_seats`: object keyed by party: total seats under that other quota, with the same threshold.\n- `changed`: list of the parties whose total differs between the two quotas (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 30, "path": "tasks/seat-count/seat-count-largest-remainder-d3-e0008", "languages": ["en"], "task_meta": {"parties": 8, "seats": 15}}
{"id": "seat-count-constituencies-d1-e0009", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 1, "seed": 10009, "title": "3 constituencies, 4 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency.\n\nWithin each constituency the seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `vote_share_percent`: object keyed by party: share of the national valid votes in per cent, 2 decimals.\n- `seat_share_percent`: object keyed by party: share of all seats in per cent, 2 decimals.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 26, "path": "tasks/seat-count/seat-count-constituencies-d1-e0009", "languages": ["en"], "task_meta": {"constituencies": 3, "parties": 4}}
{"id": "seat-count-highest-averages-d1-e0010", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 1, "seed": 10010, "title": "13 seats by dhondt", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the votes for each party in an election for 13 seats.\n\nThe seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...). A party takes part in the allocation only if it has at least 3% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 13 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/seat-count/seat-count-highest-averages-d1-e0010", "languages": ["en"], "task_meta": {"parties": 5, "seats": 13}}
{"id": "seat-count-largest-remainder-d1-e0011", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 1, "seed": 10011, "title": "7 seats by hare quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the votes for each party in an election for 7 seats. Every party takes part in the allocation.\n\nThe seats are allocated by the largest-remainder method with the Hare quota, Q = V / S (not rounded). S is the number of seats and V is the total vote of the parties that take part in the allocation. The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/seat-count/seat-count-largest-remainder-d1-e0011", "languages": ["en"], "task_meta": {"parties": 5, "seats": 7}}
{"id": "seat-count-constituencies-d2-e0012", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 2, "seed": 10012, "title": "5 constituencies, 6 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share. A party takes part in the allocation, in every constituency, only if it has at least 4% of the valid votes in the whole country. A party with no row in a constituency did not stand there and has no votes there.\n\nWithin each constituency the seats are allocated by the highest-averages method modified Sainte-Lague (divisors 1.2, 3, 5, 7, ...: the first divisor is 1.2 instead of 1): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `turnout_percent`: all ballots cast in the country (valid, blank and invalid) as a percentage of all registered voters (`registered_voters` in `constituencies.csv`), 2 decimals.\n- `qualified`: list of the parties that reach the national threshold (any order).\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term, also those with no seats; blank and invalid ballots are not a party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/seat-count/seat-count-constituencies-d2-e0012", "languages": ["en"], "task_meta": {"constituencies": 5, "parties": 6}}
{"id": "seat-count-highest-averages-d2-e0013", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 2, "seed": 10013, "title": "18 seats by dhondt", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the count from 4 counting districts in an election for 18 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nThe seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...). A party takes part in the allocation only if it has at least 4% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 18 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/seat-count/seat-count-highest-averages-d2-e0013", "languages": ["en"], "task_meta": {"parties": 7, "seats": 18}}
{"id": "seat-count-largest-remainder-d2-e0014", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 2, "seed": 10014, "title": "17 seats by droop quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the count from 4 counting districts in an election for 17 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nA party takes part in the allocation only if it has at least 2% of the valid votes.\n\nThe seats are allocated by the largest-remainder method with the Droop quota, Q = floor(V / (S + 1)) + 1. S is the number of seats and V is the total vote of the parties that take part in the allocation (votes for parties under the threshold are not part of V). The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `qualified`: list of the parties that reach the threshold (any order).\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none, including those under the threshold).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/seat-count/seat-count-largest-remainder-d2-e0014", "languages": ["en"], "task_meta": {"parties": 7, "seats": 17}}
{"id": "seat-count-constituencies-d3-e0015", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 3, "seed": 10015, "title": "7 constituencies, 7 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share. A party takes part in the allocation, in every constituency, only if it has at least 4% of the valid votes in the whole country. A party with no row in a constituency did not stand there and has no votes there.\n\nWithin each constituency the seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nOn top of the 51 fixed constituency seats there are 4 levelling seats, 55 seats in all. They are shared out like this:\n\n1. Allocate the fixed seats in each constituency as described above.\n2. Allocate all 55 seats among the qualifying parties by their national votes, with the same method. This is each party's entitlement.\n3. If a party has won more fixed seats than its entitlement, it keeps its fixed seats and gets no levelling seats. Set every such party aside, take its fixed seats off the 55, and repeat step 2 for the remaining parties and the remaining seats. Repeat until no remaining party has more fixed seats than its entitlement.\n4. Each remaining party gets levelling seats equal to its entitlement minus its fixed seats.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `turnout_percent`: all ballots cast in the country (valid, blank and invalid) as a percentage of all registered voters (`registered_voters` in `constituencies.csv`), 2 decimals.\n- `qualified`: list of the parties that reach the national threshold (any order).\n- `fixed_seats`: object keyed by party: fixed seats summed over the constituencies, an integer for every party (0 if none).\n- `levelling_seats`: object keyed by party: levelling seats, an integer for every party (0 if none).\n- `total_seats`: object keyed by party: fixed plus levelling seats.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats (fixed plus levelling). Include every party on the ballot as its own term, also those with no seats; blank and invalid ballots are not a party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 25, "path": "tasks/seat-count/seat-count-constituencies-d3-e0015", "languages": ["en"], "task_meta": {"constituencies": 7, "parties": 7}}
{"id": "seat-count-highest-averages-d3-e0016", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 3, "seed": 10016, "title": "32 seats by sainte-lague", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the count from 7 counting districts in an election for 32 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nThe seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...). A party takes part in the allocation only if it has at least 5% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 32 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n- `comparison_seats`: object keyed by party: the seats each party would get if the method were modified Sainte-Lague (divisors 1.2, 3, 5, 7, ...: the first divisor is 1.2 instead of 1) instead, with the same threshold.\n- `changed`: list of the parties whose seat count differs between the two methods (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 34, "path": "tasks/seat-count/seat-count-highest-averages-d3-e0016", "languages": ["en"], "task_meta": {"parties": 9, "seats": 32}}
{"id": "seat-count-largest-remainder-d3-e0017", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 3, "seed": 10017, "title": "24 seats by hare quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the count from 6 counting districts in an election for 24 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nA party takes part in the allocation only if it has at least 2% of the valid votes.\n\nThe seats are allocated by the largest-remainder method with the Hare quota, Q = V / S (not rounded). S is the number of seats and V is the total vote of the parties that take part in the allocation (votes for parties under the threshold are not part of V). The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `qualified`: list of the parties that reach the threshold (any order).\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none, including those under the threshold).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n- `comparison_quota`: the quota if the election used the Droop quota, Q = floor(V / (S + 1)) + 1 instead, 2 decimals.\n- `comparison_seats`: object keyed by party: total seats under that other quota, with the same threshold.\n- `changed`: list of the parties whose total differs between the two quotas (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 30, "path": "tasks/seat-count/seat-count-largest-remainder-d3-e0017", "languages": ["en"], "task_meta": {"parties": 8, "seats": 24}}
{"id": "seat-count-constituencies-d1-e0018", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 1, "seed": 10018, "title": "3 constituencies, 4 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency.\n\nWithin each constituency the seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `vote_share_percent`: object keyed by party: share of the national valid votes in per cent, 2 decimals.\n- `seat_share_percent`: object keyed by party: share of all seats in per cent, 2 decimals.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 26, "path": "tasks/seat-count/seat-count-constituencies-d1-e0018", "languages": ["en"], "task_meta": {"constituencies": 3, "parties": 4}}
{"id": "seat-count-highest-averages-d1-e0019", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 1, "seed": 10019, "title": "12 seats by dhondt", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the votes for each party in an election for 12 seats.\n\nThe seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...). A party takes part in the allocation only if it has at least 5% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 12 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/seat-count/seat-count-highest-averages-d1-e0019", "languages": ["en"], "task_meta": {"parties": 5, "seats": 12}}
{"id": "seat-count-largest-remainder-d1-e0020", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 1, "seed": 10020, "title": "9 seats by hare quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the votes for each party in an election for 9 seats. Every party takes part in the allocation.\n\nThe seats are allocated by the largest-remainder method with the Hare quota, Q = V / S (not rounded). S is the number of seats and V is the total vote of the parties that take part in the allocation. The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/seat-count/seat-count-largest-remainder-d1-e0020", "languages": ["en"], "task_meta": {"parties": 5, "seats": 9}}
{"id": "seat-count-constituencies-d2-e0021", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 2, "seed": 10021, "title": "5 constituencies, 6 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share. A party takes part in the allocation, in every constituency, only if it has at least 4% of the valid votes in the whole country. A party with no row in a constituency did not stand there and has no votes there.\n\nWithin each constituency the seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `turnout_percent`: all ballots cast in the country (valid, blank and invalid) as a percentage of all registered voters (`registered_voters` in `constituencies.csv`), 2 decimals.\n- `qualified`: list of the parties that reach the national threshold (any order).\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term, also those with no seats; blank and invalid ballots are not a party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/seat-count/seat-count-constituencies-d2-e0021", "languages": ["en"], "task_meta": {"constituencies": 5, "parties": 6}}
{"id": "seat-count-highest-averages-d2-e0022", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 2, "seed": 10022, "title": "15 seats by modified-sainte-lague", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the count from 4 counting districts in an election for 15 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nThe seats are allocated by the highest-averages method modified Sainte-Lague (divisors 1.2, 3, 5, 7, ...: the first divisor is 1.2 instead of 1). A party takes part in the allocation only if it has at least 4% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 15 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/seat-count/seat-count-highest-averages-d2-e0022", "languages": ["en"], "task_meta": {"parties": 7, "seats": 15}}
{"id": "seat-count-largest-remainder-d2-e0023", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 2, "seed": 10023, "title": "24 seats by droop quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the count from 4 counting districts in an election for 24 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nA party takes part in the allocation only if it has at least 3% of the valid votes.\n\nThe seats are allocated by the largest-remainder method with the Droop quota, Q = floor(V / (S + 1)) + 1. S is the number of seats and V is the total vote of the parties that take part in the allocation (votes for parties under the threshold are not part of V). The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `qualified`: list of the parties that reach the threshold (any order).\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none, including those under the threshold).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/seat-count/seat-count-largest-remainder-d2-e0023", "languages": ["en"], "task_meta": {"parties": 7, "seats": 24}}