Article: 863 of cornell.class.cs100m From: tyan@twinkie.cs.cornell.edu (Thomas Yan) Newsgroups: cornell.class.cs100m Subject: some sample data for P5.2 Date: 31 Mar 2001 01:23:17 GMT Message-ID: <9a3bi5$8i4$1@news01.cit.cornell.edu> election1 = [ 'A>D>E>C>B' 'C=B=E>D=A' 'A>E>C=D=B' 'A>B=E=D=C' 'D>C>E>B>A' 'D=A=C>B=E' 'A>C>E>B=D' 'A>D=C>E>B' 'A=C>E>B=D' 'B=C>E=D>A']; % $tallies(election1)$ should be equal to $pwm1$ pwm1 = [ 0 7 5 6 7 3 0 0 2 1 3 6 0 4 6 2 4 2 0 4 3 6 2 4 0 ]; % Plain Condorcet winner of $election1$ is $'A'$ election2 = [ 'B>C=A>E>D' 'A>E>C=B=D' 'D>E>B=C=A' 'C=E=A>B>D' 'A>B=D>C=E' 'D=C=B=A>E' 'A=D=C>B>E' 'A>B=C=D=E' 'B=A=D=E>C' 'C>A>E=D=B' 'E>C>B=A>D' 'D=E=A=C>B' 'C=A>E=D=B' 'C>B>D=E=A' 'B=A>E>C>D' 'D>E=B>A>C' 'D>B>A=C>E' 'A=D>C=B>E' 'D=C>E>B=A' 'C>D>A=B>E']; % $tallies(election2)$ should be equal to $pwm2$ pwm2 = [ 0 9 7 9 12 4 0 6 5 9 5 9 0 8 10 5 8 6 0 9 4 6 6 5 0 ]; % Plain Condorcet winner for $election2$ is again $'A'$ election3 = [ 0 47 52 58 60 37 0 77 37 33 57 39 0 30 60 42 67 65 0 57 75 52 47 35 0]; % $tallies(election3)$ should just return $election3$ -- $ischar$ is helpful! % Plain Condorcet winner for $election3$ is $'D'$ % more details of examples above and additional examples to follow... Article: 864 of cornell.class.cs100m From: tyan@twinkie.cs.cornell.edu (Thomas Yan) Newsgroups: cornell.class.cs100m Subject: Re: some sample data for P5.2 Date: 31 Mar 2001 01:48:34 GMT Message-ID: <9a3d1i$97m$1@news01.cit.cornell.edu> [below, letters are shown since they are easier to think about and because that is what $condorcet$ should return.] pairwise matrix for election1: A B C D E A 0 7 5 6 7 B 3 0 0 2 1 C 3 6 0 4 6 D 2 4 2 0 4 E 3 6 2 4 0 $alldefeats$ should return: D C A C E A C A A i: 4 3 1 3 5 1 3 1 1 B D C B B D E B E j: 2 4 3 2 2 4 5 2 5 v: 4 4 5 6 6 6 6 7 7 since A is never defeated, it is the winner. pairwise matrix for election2: A B C D E A 0 9 7 9 12 B 4 0 6 5 9 C 5 9 0 8 10 D 5 8 6 0 9 E 4 6 6 5 0 $alldefeats$ should return: A D C A C A B D C A i: 1 4 3 1 3 1 2 4 3 1 C B D B B D E E E E j: 3 2 4 2 2 4 5 5 5 5 v: 7 8 8 9 9 9 9 9 10 12 again, since A is never defeated, it is the winner. pairwise matrix for election3: A B C D E A 0 47 52 58 60 B 37 0 77 37 33 C 57 39 0 30 60 D 42 67 65 0 57 E 75 52 47 35 0 $alldefeats$ should return: A E C D A C D D E B i: 1 5 3 4 1 3 4 4 5 2 B B A E D E C B A C j: 2 2 1 5 4 5 3 2 1 3 v: 47 52 57 57 58 60 65 67 75 77 since every candidate is defeated, Plain Condorcet must drop defeats in ascending order of magnitude until there is an unbeaten candidate. this happens after A/B (47), E/B (52), C/A (57), D/E (57), A/D (58) are dropped: $D$ is no longer defeated by anyone, so $D$ is the winner.