[EM] Symmetrical ICT program, with errors fixed
Michael Ossipoff
email9648742 at gmail.com
Fri Aug 24 07:56:00 PDT 2012
I've printed the program out, and now I feel that I've probably found
and corrected all of its errors.
This pseudocode is for counting Symmetrical ICT, a rank-count which, I
claim, avoids the strategy problems otherwise distort voters sincere
expression of preferences--does so better than any other rank-count.
It meets FBC; is defection-resistant (maning that it avoids the
Chicken Dilemma); meets the Condorcet Criterion, if equal-top-ranking
and equal-bottom-ranking are counted consistent with the intent and
wishes of people voting in that way; and meets LNHe.
The program will be divided into numbered and named sections. There
may be comments here and there. If so, they'll be in parentheses,
sometimes on their own line (in which case they refer to what's below
them if they end in a colon--otherwise they refer to what's above
them). Maybe sometimes they'll be at the end of a line, referring to
that line.
The Symmetrical ICT count pseudocode:
(I have an initialization section that initializes a number of global
variables. I usually also initialize them at the appropriate place in
the program too. No harm in doing it twice.)
NC is the number of candidates. NB is the number of ballots.
R(k,i) is the array for the rank at which candidate i is ranked on ballot k.
1. Initialization:
NBeaten = 0 (No one initially beaten)
(Initialize everyone unbeaten:)
For i = 1 to NC
...Beaten(i) = 0
...Win(i) = 0
...NTop(i) = 0
Next i
(Initialize everyone at bottom on every ballot:)
For k = 1 to NB
...For i = 1 to NC
......Bottom(k,i) = 1
...Next i
Next k
(Initialize all the pairwise totals to zero:)
For i = 1 to NC
...For j = 1 to NC
...V(i,j) = 0 (votes for i over j)
...ET(i,j) = 0 (ballots with i and j top ranked)
...EB(i,j) = 0 (ballots with i and j at bottom)
Next j
Next i
(at bottom means not ranked over anyone on that ballot)
(Below, some of the indentation isn't correct, because it was
necessary to fix an error)
2. Pairwise totals:
(i's top-count, i-j pairwise vote totals and equal-top:)
For k = 1 to NB
...For i = 1 to NC
......If R(k,i) = 1 then:
......Top(k,i) = 1
.......NTop(i) = NTop(i) + 1
......Endif
......For j = 1 to NC
.........If R(k,i) < R(k,j) then
............V(i,j) = V(i,j) + 1
.........Endif
.........If R(k,i) = 1 AND R(k,j) = 1 AND i<>j then
............ET(i,j) = ET(i,j) + 1
.........Endif
......Next j
...Next i
(Is i at bottom on ballot k?:)
For i = 1 to NC
...For j = 1 to NC
......If R(k,i) < R(k,j) then
.........Bottom(k,i) = 0 (i is not at bottom)
......Endif
...Next j
Next i
(Increment i-j equal bottom count?:)
For i = 1 to NC
...For j = 1 to NC
......If Bottom(k,i) = 1 AND Bottom(k,j) = 1 AND i<>j then
.........EB(i,j) = EB(i,j) +1
......Endif
...Next j
Next i
Next k
3. Is candidate i unbeaten?
For i = 1 to NC
...For j = 1 to NC
......If V(j,i) + EB(i,j) > V(i,j) + ET(i,j) then
.........Beaten(i) = 1
......Endif
...Next j
...If Beaten(i) = 1 then
......NBeaten = NBeaten + 1
...Endif
Next i
4. Find winners:
(If exactly 1 candidate is unbeaten:)
If Nbeaten = NC - 1 then:
...For i = 1 to NC
......If Beaten(i) = 0 then
.........Win(i) = 1
.........Print Name(i), "_Wins."
......Endif
...Next i
Stop
Endif
(If all or no candidates are unbeaten:)
(Find maximum top-score:)
If NBeaten = 0 OR NBeaten = NC
...Max = 0
...For i = 1 to NC
......If NTop(i) > Max then:
.........Max = NTop(i)
......Endif
...Next i
(Find who has that top-score:)
...For i = 1 to NC
......If NTop(i) = Max then:
.........Win(i) = 1
.........Print Name(i), "_Wins."
......Endif
...Next i
Stop
Endif
(If some but not all candidates are unbeaten:)
Same as (If all or no candidates are unbeaten), except that:
If NTop(i) > Max becomes:
If NTop(i) > Max AND Beaten(i) = 0
And:
If NTop(i) = Max becomes:
If Top(i) = Max AND Beaten(i) = 0
[End of program]
Here is rudimentary code to manually enter rankings into the program:
For k = 1 to NB
...For i = 1 to NC
......Print Name(i)
......Input "Rank", R(k,i)
...Next i
Next k
[end of manual ranking-entry program]
As I said, if that manual ranking-entry program is used, then it
should be appended to the beginning of the main program described
above.
More information about the Election-Methods
mailing list