crflynn / voting

Diversity / (dis)proportionality measures, election quotas, and apportionment methods in pure Python.
https://voting.readthedocs.io/en/latest/
MIT License
15 stars 2 forks source link

Huntington Hill Method assigns a 0 for allocation #18

Open ebrewer1 opened 3 years ago

ebrewer1 commented 3 years ago

Hi, I was trying to apportion US Senate seats using the Huntington-Hill Method using Census Estimates, and for some reason, my dataset produced a 0 for Connecticut. Interestingly, in some years CT did get a seat, but in others it didn't. I calculated the percentage population of CT of the whole US for each year, and it seems that after 2010, which is the first row in the attached data frame, the Connecticut value goes to 0, even though it isn't the smallest state by population. Is there a reason why this is happening? Screen Shot 2020-12-16 at 2 44 56 PM

This second image is of the 2011 population data, and the senate seat estimates. Connecticut is at 0 strangely Screen Shot 2020-12-16 at 2 48 10 PM

crflynn commented 3 years ago

It could be a bug. Could you provide example code so I can try to debug?

wtchen commented 2 years ago

@crflynn See apportionment.huntington_hill([5609968,2873709,83801,16295,10107,6467], 17)

The results seem counter-intuitive. Either every party should receive one seat (ideal, since this is how the US does it), or only parties which receive votes over a certain threshold (e.g. Hare quota) should receive seats.