[maemo-community] STV voting strategy
From: Benson Mitchell benson.mitchell at gmail.comDate: Fri Mar 20 16:22:32 EET 2009
- Previous message: STV voting strategy
- Next message: STV voting strategy
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Mar 20, 2009 at 1:47 PM, Dave Neary <dneary at maemo.org> wrote: >> Algorithm in sh, grep, wc, and dc: >> $ for i in 1 2 3 4 5 6 7 8 9; do for j in 1 2 3 4 5 6 7 8 9; do grep >> $i.\*$j.\*0$ ./election.blt|wc -l; done; echo ++++++++p;done|dc > > Interesting indeed. What it doesn't measure is the number of times $i > appeared on the ballot and $j didn't appear at all, which would also be > a pairwise win for $i. You also give a big advantage to 1, since all of > the voting lines start with 1 :) Ah, you're right. I misunderstood the format. No wonder Jaffa was doing so well in my "results"... > > $ for i in 1 2 3 4 5 6 7 8 9; do for j in 1 2 3 4 5 6 7 8 9; do > grep "^1.*"$i".*"$j".*0$" ./election.blt|wc -l; > grep "^1[^"$j"]*"$i"[^"$j"]*0$" ./election.blt|wc -l; > done; echo +++++++++++++++++p;done|dc > > That gives me results which differ both from the official results *and* > from your results in the last 2 positions. True, although it makes the same accuracy as my summing before; 4/5 right, just a different 4. BTW, this is simpler, and still fixes those issues :P $ for i in 1 2 3 4 5 6 7 8 9; do for j in 1 2 3 4 5 6 7 8 9; do grep "^1[^"$j"]*"$i".*0$" ./election.blt|wc -l; done; echo +++++++++p;done|dc (But something tells me a Perl guru could come along and implement that in 1/2 the characters and making 1/20 the sense...) Benson
- Previous message: STV voting strategy
- Next message: STV voting strategy
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]