Condorcet freeware

Mike Ossipoff dfb at bbs.cruzio.com
Thu Jun 6 02:51:53 PDT 1996


Mike Ossipoff writes:

I've just sent a copy of this, but I got one of the addresses wrong,
and I got a message saying that nothing was sent, so I'm re-sending.

Sorry about his message having 2 headers, and an unnecessary amount
of text before the program. That's because I don't have a way to
delete lines or blocs of text.

After the 2 headers, and after some text, is a computer program,
in BASIC, to do a Condorcet's method count. Condorcet's method
is the single-winner method that I've been advocating.

The program is "freeware". It can be copied &/or distributed without
limit, and the only things that shouldn't be done with are selling
or licensing.

The progam is set for a maximum of 10 alternatives. To change
that maximum to a different value, change the value of ncand
from 10 to another number in the line that says "ncand=10".
And change the 10s in parentheses to that other number also,
in the 1st few lines of the program. Note: Don't change the
line numbers, just ncand & the 10s in partenthes.

The program prompts a voter for his 1st choice. The voter enters
the "candidate number" of his 1st choice (all the candidates or
alternatives have had a number written next to them--their
candidate numbers, which the voter uses rather than having to
write the candidate's names.

After the voter enters his 1st choice, the program prompts him
for his 2nd choice...etc. When he's ranked as many alternatives
as he wishes to, he enters 0. (zero). Or that could be done
by the next voter instead. The zero isn't used after the last
ranking.

The voter can enter 9999 to indicate that he wants to change
his most recent entry. He can enter 8888 to indicate that he
wants to start over & re-write his ranking. Or he can enter
1111 to indicate that he wants to vote another candidate at
the same rank position as the previous one.

When everyone has voted, the person conducting the election enters
7777, and the program completes the count & displays the results.

***

As I said, after the 2 headers, and some text, the program
is in this message. It's just in the form of text, regular
e-mail, rather than being an executable file. So it's
necessary to copy it into a computer, as a BASIC program,
to use it. That won't be difficult though, due to its short
length. It's only about a page long when printed out.

***

Now, the headers, the unnecessary text, and then the program:

> From dfb Sun Apr  7 20:04:13 1996
> Subject: The Condorcet Program (fwd)
> To: 72477.260 at compuserve.com
> Date: Sun, 7 Apr 96 20:04:12 PDT
> From: Mike Ossipoff <dfb at bbs.cruzio.com>
> Cc: dfb at cruzio.com, dfb at bbs.cruzio.com
> X-Mailer: ELM [version 2.3 PL0]
> Message-ID:  <9604072004.aa14648 at bbs.cruzio.com>
> Sender: dfb
> 
> Mike Ossipoff writes:
> > From dfb Sun Mar 17 16:29:05 1996
> > Subject: The Condorcet Program
> > 
> > Date: Sun, 17 Mar 96 16:29:04 PST
> > From: Mike Ossipoff <dfb at bbs.cruzio.com>
> > Cc: dfb at bbs.cruzio.com
> > X-Mailer: ELM [version 2.3 PL0]
> > Message-ID:  <9603171629.aa27264 at bbs.cruzio.com>
> > 
> > The program is in this letter, but 1st I should add that, after
> > the last voter has entered his ranking, and then entered "O" (zero),
> > to indicate that he's done with the ranking (as every voter must do),
> > you then press 7777, and then <enter>, which tells the program that
> > all the rankings are in.
> > 
> Since this was written, the program has been tested under
> a variety of conditions, and passed every test, working perfectly.
> The following paragraph was written before testing was complete.
> 
> > I tested the program on a simple example in which there was
> > a Condorcet winner. I expect it to work with any set of rankings,
> > but right after I send this letter, containing the program,
> > I'll change the example to create a circular tie. Then I'll
> > test the features for voters to correct their errors, and for
> > voting more than 1 candidate at the same rank-position. Then
> > I'll write a more complex example & use the program on that.
> 
> As I said, those tests have now been done, & the program passed
> the tests.
> 
> > 
> > But, as I said, I expect the program to work for any set
> > of rankings. If I'd made all those tests before sending it,
> > that would have delayed it further, and I was already late
> > enough in sending it.
> > 
> > Also, I'll begin writing it in deluxe versions, like the
> > one I mentioned with the fancier ways for voters to indicate
> > a completed ranking, errors in their ranking, or the desire
> > to rank more than 1 at the same rank position. But the program
> > is perfectly good as-is.
> > 
> > Also, I'll start trying to find out how to send ftp-mail,
> > &/or how to use ftp, &/or how to use mime & uu coding. Someone
> > told me that mime or uu could enable me to send ftp-mail, to
> > send non-ASCII things. And I'll ask someone if a BASIC program
> > can be used right from an e-letter, after removing the rest of
> > the letter (header, etc), or whether it needs ftp-mail, etc.
> > 
> > Oh, one other thing I forgot to add: As I said, the program
> > can be used with any number of voters--no limit. It's currently
> > set for a maximum of 10 candidates. Any more than that would
> > be inconvenient for a demonstration anyway, so you'll probably
> > not have any reason to want to change that setting. But if you
> > did want to change it, you'd merely replace the 10s in the 1st
> > 3 lines with whatever other maximum you want to use. As it is now,
> > the program will work with any number of candidates up to 10.
> > 
> > Returning to the subject of sending ftp vs just typing the program
> > into your computer:
> > 
> > But I assure you that you can type the program into your computer
> > long before I find out how to send non-ASCII things, like computer
> > programs, by e-mail, or ftp.
> > 
> > An explanation of the program will follow immediately, in an
> > immediately subsequent e-letter.
> > 
> > Anyway, here's the program:
> > 
> > 10 dim score(10), r(10), w(10)
> > 20 dim p(10,10)
> > 25 ncand = 10
> > 30 for i=1 to ncand
> > 40 score(i)=0: r(i)=1000000: w(i)=0
> > 50    for j=1 to ncand
> > 55    if j=i go to 70
> > 60    p(i,j)=0
> > 70    next j
> > 80 next i
> > 90 k=1
> > 100 print "choice ";k;":";
> > 110 input z
> > 120 if z=0 go to 220
> > 130 if z=9999 then r(q)=1000000: k=k-1: go to 100
> > 140 if z = 8888 then gosub 180: go to 90
> > 150 if z=1111 then k=k-1: go to 100
> > 155 if z=7777 go to 300
> > 160 r(z)=k: q=z
> > 165 k=k+1: go to 100
> > 170 go to 220
> > 180 for x=1 to ncand
> > 190 r(x)=1000000
> > 200 next x
> > 210 return
> > 220 for i=1 to ncand
> > 230    for j=1 to ncand
> > 240    if j=i go to 260
> > 250    if r(i) > r(j) then p(j,i)=p(j,i)+1
> > 260    next j
> > 270 next i
> > 280 gosub 180
> > 290 go to 90
> > 300 big=0: least=1000000: nwin=0
> > 310 for i=1 to ncand
>   311 big=0
> 
> > 315 cond=1
> > 320    for j=1 to ncand
> > 330    if j=i go to 350
> > 340    if p(j,i) > p(i,j) and p(j,i) > big then big=p(j,i)
> > 345    if p(j,i) >=p(i,j) then cond=0
> > 350    next j
> > 355 if cond=1 then print i;" is Condorcet winner.":stop
> > 
> > 360 score(i)=big
> > 370 if big < least then least=big
> > 380 next i
> > 390 for i=1 to ncand
> > 400 if score(i)=least then nwin=nwin+1: w(nwin)=i
> > 410 next i
> > 420 if nwin=1 then print w(1);" wins.":stop
> > 430 print "Tie. The winners are: "
> > 440 for i=1 to nwin
> > 450 print w(i);" ";
> > 460 next i
> > 470 stop
> > 480 end
> > 
> > 
> > 
> > 
> > -- 
> > .-
> > 
> 
> 
> -- 
> .-
> 


-- 



More information about the Election-Methods mailing list