« Will Some Ohio Polling Places Be Inadvertantly Shut Down on Election Day? | Quick one-liner to export from a DB to CSV » |
Dice Binning Calculator
elections, reform, hacks, open source, berkeley, friends, research, policy, usabilityThis is probably most interesting to the election officials out there. (although I point out a few points of academic interest at the end)
n a quick calculator based on the Cordero, Wagner and Dill paper (the 10-sided dice paper) that election officials can use to produce "bins" of random numbers for manual tally spreadsheets. That is, say you have to choose one of 13 precincts, but if you use 2 dice and just read the numbers off as corresponding to the precinct number, you might be rolling for a while. This calculator will produce ranges (or "bins") to help you optimize your dice rolling. To use it, you enter the number of dice you'll be using and the number of precincts (or units, whatever) that you have to select. The program will output bins so that you don't have to roll the dice as much. It also has a mode that allows for easy copying and pasting into a column of a spreadsheet.
Comments, patches, etc. welcome.
Why did I do this? Can't you just roll dice without binning? Well, to give you some perspective, it took us 30-45 minutes in November of last year to select 20 precincts for San Mateo County's manual tally. We did a lot of re-rolling. In fact, we got so frustrated at having to reroll so much that we started to make up rules (one die would be even-odd, one would be divide-by-3, etc.). I realized that this frustration was actually dangerous for the random selection as it injects a good deal of ad-hockery into a security-relevant process. I can imagine that it might also be useful as we start to do larger selections in more rigorous manual tallies.
A few interesting comments:
The tool defaults to 2 dice and 13 precincts. This is an interesting case because 1) you would normally have to reroll 87% of the time and 2) with a number of precincts that is a prime, it's difficult to calculate these bins in one's head (it is for me).
If you input 3 dice and 501 precincts, you see that you'll have to reroll roughly 50% of the time:
you add one more die (for 4 die total), it drops the number of rerolls by a factor of 10 to roughly 5%. To do this in practice, you'd want a forth die along with the recommended red-white-blue set of three... I suggest a clear die.
Here's what LA would have to do with 4 die and 4766 precincts and it gets them a ~5% reroll rate (with no bins, 4 dice would have a ~52% reroll rate for LA):