Skip to content

Weber vote-for-or-against-k: IC-coupled ballots (default) + optional uniform types#57

Draft
endolith wants to merge 10 commits into
masterfrom
cursor/weber-voa-extremal-strategy-c297
Draft

Weber vote-for-or-against-k: IC-coupled ballots (default) + optional uniform types#57
endolith wants to merge 10 commits into
masterfrom
cursor/weber-voa-extremal-strategy-c297

Conversation

@endolith
Copy link
Copy Markdown
Owner

@endolith endolith commented May 12, 2026

Summary

  • vote_for_or_against_k: fair coin: +1 on best k or −1 on worst k (not both).
  • Docs / tests: example module states solid vs dashed may differ for VOA-k; Hypothesis + large-sample tests on ballot shape and ~50/50 coin.
  • examples/weber_voa_k_ballot_variants_benchmark.py: CLI benchmark comparing Monte Carlo SUE to eff_vote_for_or_against_k for several ballot interpretations (repo rule, simultaneous ±, same-top XOR, uniform subset, vote-for-k baseline).

Running the benchmark

From repo root: PYTHONPATH=. python3 examples/weber_voa_k_ballot_variants_benchmark.py
Options: --n-voters, --n-elections, --seed.

Testing

pytest -q --no-cov (221 passed).

Open in Web Open in Cursor 

cursoragent and others added 4 commits May 11, 2026 16:00
…ess table

- Maximize eff_vote_for_or_against_k over integer k in 1..floor(m/2) instead
  of rounding alpha*m (differs e.g. at m=91).
- effectiveness_table: add Best Vote-for-or-against-k from closed form;
  document that Merrill-style Monte Carlo does not apply to that column.
- Fix weber_1977_expressions __main__ table construction and infinity row.

Co-authored-by: endolith <endolith@gmail.com>
Implement vote_for_or_against_k as +1 on each voter's k best utilities and
-1 on their k worst (disjoint when k <= n//2), matching Monte Carlo SUE to
Weber's effectiveness integrals. Wire weber_1977_effectiveness_table to
combined_approval with best k; add regression checks in test_cases and
test_strategies.

Co-authored-by: endolith <endolith@gmail.com>
Implement literal type draw (uniform k-subset, then +1 on S or -1 on S),
independent of utilities; remove incorrect simultaneous top/bottom rule and
MC-vs-theory asserts. Document possible gap vs dashed eff_* in effectiveness
table.

Co-authored-by: endolith <endolith@gmail.com>
Default vote_for_or_against_k uses utility top-k (+1) and bottom-k (-1),
which matches Cowles DP 498 effectiveness in Merrill-style Monte Carlo.
Add strategy='uniform_types' for the utility-independent literal type draw.
Update Weber example docs and add Monte Carlo regression test.

Co-authored-by: endolith <endolith@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.44%. Comparing base (8a7213f) to head (953507f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
+ Coverage   96.31%   96.44%   +0.13%     
==========================================
  Files          19       19              
  Lines         489      507      +18     
==========================================
+ Hits          471      489      +18     
  Misses         18       18              
Flag Coverage Δ
no-numba 95.66% <100.00%> (+0.15%) ⬆️
numba 89.54% <100.00%> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cursoragent and others added 6 commits May 12, 2026 04:48
…nst-k

Co-authored-by: endolith <endolith@gmail.com>
vote_for_or_against_k is utility-ranked only; vote_for_or_against_k_uniform_types
is the finite-type draw. Remove strategy keyword. Update Weber example docs and
tests to match repo conventions.

Co-authored-by: endolith <endolith@gmail.com>
Single utility-ranked implementation remains; drop redundant export and tests.

Co-authored-by: endolith <endolith@gmail.com>
Weber's for/against types are one k-set per ballot; vote against targets
least-liked candidates, not favorites. Remove MC-vs-closed-form regression test;
docstrings no longer claim Table 19 match for finite simulation.

Co-authored-by: endolith <endolith@gmail.com>
…ple vs closed form

Hypothesis checks k approvals XOR k rejections per voter and ~50% split
with large n; deterministic large-sample coin check. Example doc states
solid curves are not asserted to match Weber dashed formulas for VOA-k.

Co-authored-by: endolith <endolith@gmail.com>
Monte Carlo SUE vs closed form for repo strategy, simultaneous +/-,
same-top XOR, uniform subset, and vote-for-k baseline; CLI n_voters/n_elections.

Co-authored-by: endolith <endolith@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants