Interpreting Instant Runoff ˆ la San Francisco
Simulate an election following the
San Francisco Charter Section 13.102. In these comments and in comments
in the JavaScript code, subsections will
be refered to with their letter designators such as '(a)'.
Use your browser's "View Source" menu to see the code.
There are 7 candidates and 100 ballots. Each ballot has 3 choices.
The choices on one ballot are represented here by a string of 3 characters.
The candidates are represented by letters 'A', 'B',...
The minus sign, '-' designates that the ballot has no value for a choice.
The ballots are generated with a random function.
Assume that before this processing occurs, write-in votes are encoded.
Ballots in which more than one candidate is marked for a given rank have
been recorded as having no vote for the rank.
When the same candidate is marked at different ranks on a ballot, it will have
no effect on the outcome. The charter does not disqualify this kind of
ballot.
The charter language is a little vague. I assume that a tie occurs
when all the candididates have the same number of votes in the continuing
ballots.
Results of the simulation follow.