• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Democracy Chronicles

Towards better democracy everywhere.

  • AMERICAN DEMOCRACY
  • WORLD DEMOCRACY
  • POLITICAL ART
  • more
    • election technology
    • money politics
    • political dissidents
    • THIRD PARTY
      • third party central
      • green party
      • justice party
      • libertarian party
    • voting methods
  • DC INFO
    • author central
    • about
    • advertise with DC
    • contact
    • privacy policy
Home | DC AUTHORS | A Computer Program For Counting ICT in Pseudocode

A Computer Program For Counting ICT in Pseudocode

September 10, 2012 by Michael Ossipoff Leave a Comment

FacebookLinkedInPinTweet

Counting ICT election

 

by Michael Ossipoff
September 10, 2012
Updated: October 15, 2012

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 andwishes 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 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)
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:Counting ICT in Pseudocode

(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

 

3. Is candidate i unbeaten?

For i = 1 to NC
…For j = 1 to NC
……If V(j,i) > V(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:)

If NBeaten > 0 AND NBeaten < NC

(Find maximum top-score:)

…Max = 0
…For i = 1 to NC
……If NTop(i) > Max AND Beaten(i) = 0 then:
………Max = NTop(i)
……Endif
…Next i

(Find who has that top-score:)

…For i = 1 to NC
……If NTop(i) = Max AND Beaten(i) = 0 then:
………Win(i) = 1
………Print Name(i), “_Wins.”
……Endif
…Next i
Stop
Endif

[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.


 

Thanks for reading “A Computer Program For Counting ICT in Pseudocode” by Michael Ossipoff.

FacebookLinkedInPinTweet

Filed Under: DC Authors Tagged With: Election Methods, Polling

Some highlighted Democracy Chronicles topics

Africa American Corruption American Local Elections American State Elections Asia Capitalism and Big Business Celebrity Politics China Democracy Charity Democracy Protests Democrats Dictatorships Education Election History Election Methods Election Security Election Transparency Europe Internet and Democracy Journalism and Free Speech Middle East Minority Voting Rights Money Politics New York City and State Elections Political Artwork Political Dissidents Political Lobbying Redistricting Republicans Russia Socialism and Labor Social Media and Democracy South America Spying and Privacy Supreme Court Third Party Voter Access Voter ID Voter Registration Voter Suppression Voter Turnout Voting Technology Women Voting Rights Worldwide Worldwide Corruption

About Michael Ossipoff

Michael Ossipoff writes for Democracy Chronicles from Miami, Florida and is one of our earliest and most prolific authors and creators. His writing covers the world of election method reform verifiable election counts and the importance of independent and third party candidates.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

democracy chronicles newsletter

democracy around the web

  • CPJ files declaration in support of detained journalist Mario Guevara 
    Source: Committee to Protect Journalists Published on: 8 months ago
  • “Musk must face lawsuit brought by voters he convinced to sign petition in $1 million-a-day election giveaway, judge says”
    Source: Election Law Blog Published on: 8 months ago
  • “Appeals court throws out massive civil fraud penalty against President Donald Trump”
    Source: Election Law Blog Published on: 8 months ago
  • “Adams Adviser Suspended From Campaign After Giving Cash to Reporter”
    Source: Election Law Blog Published on: 8 months ago
  • “Obama applauds Newsom’s California redistricting plan as ‘responsible’ as Texas GOP pushes new maps”
    Source: Election Law Blog Published on: 8 months ago