[EM] number of possible ranked ballots given N candidates

rob brown rob at karmatics.com
Wed Dec 14 15:23:38 PST 2005


On 12/14/05, Paul Kislanko <kislanko at airmail.net> wrote:
>
> James Gilmour: wrote
> >
> > Maybe there are 4 million possibilities with 10 candidates,
> > but you won't have 4 million actual combinations unless you
> > have many more voters than 4 million.
>
> I was going to mention this as well. From a practical standpoint, one only
> need record the "forms" of ballots actually cast, then for each new ballot
> see if it's "form" is already stored, and if so just add 1 to the number
> of
> voters who used that "form".
>

Sure.  I was just hoping for a reasonable top-end cap.

In javascript, this is pretty easy to do due to its associative array
functionality.  For instance, to add a new ballot I could say:

var newBallotString = "A>B>C";

if (ballots[newBallotString] == null)
  ballots[newBallotString] = 1;
else
  ballots[newBallotString]++;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.electorama.com/pipermail/election-methods-electorama.com/attachments/20051214/2cec4886/attachment-0003.htm>


More information about the Election-Methods mailing list