{VERSION 4 0 "APPLE_PPC_MAC" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Headi ng 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 } } {SECT 0 {EXCHG {PARA 3 "" 0 "" {TEXT -1 81 "Procedures to draw the Pro cedure Line and Approval Voting Region for 3 Candidates" }}{PARA 19 " " 0 "" {TEXT -1 46 "Tommy Ratliff, Wheaton College, March 27, 2002" }} {PARA 19 "" 0 "" {TEXT -1 27 "tratliff@wheatoncollege.edu" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 10 "Directions" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 101 "You will need to execute the commands in the next secti on in order to have the functions available. " }}{PARA 0 "" 0 "" {TEXT -1 62 "It may take a little while for Maple to process the funct ions." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 37 " The most important syntax to know is:" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 111 " plotprofile(a,b,c,d,e,f) will p lot the procedure line and the approval voting region for the profile \+ where" }}{PARA 0 "" 0 "" {TEXT -1 451 " a voters have preferenc e A>B>C\n b voters have preference A>C>B\n c voters have preference C>A>B\n d voters have preference C>B>A\n e v oters have preference B>C>A\n f voters have preference B>A>C\n \n plur(a,b,c,d,e,f) calculates the coordinates in the representatio n triangle using the plurality method\n aplur(a,b,c,d,e,f) calculate s the coordinates in the representation triangle using the antiplurali ty method" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 24 "Definition of Functions " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "restart:with(plots):wit h(geometry):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "plur:= (a,b,c,d,e,f ) -> [ (a+b)/(a+b+c+d+e+f), (e+f)/(a+b+c+d+e+f), (c+d)/(a+b+c+d+e+f)]: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 114 "aplur:= (a,b,c,d,e,f) -> [ (a+ b+c+f)/(2*(a+b+c+d+e+f)), (e+f+a+d)/(2*(a+b+c+d+e+f)), (c+d+b+e)/(2*(a +b+c+d+e+f))]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 81 "prdown := (a,b,c) -> [ -a/sqrt(2) + b/sqrt(2), -a/sqrt(6)-b/sqrt(6)+sqrt(2/3)*c]:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 104 "prup := (x,y) -> [-1/2*sqrt(2)*x-1 /6*sqrt(6)*y+1/3, 1/2*sqrt(2)*x-1/6*sqrt(6)*y+1/3, 1/3+1/3*sqrt(6)*y]: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 158 "tri:=spacecurve(\{[ [1,0,0],[0,1,0],[0,0,1],[1,0,0]], [ [1,0, 0],[0,1/2,1/2]], [ [0,1,0],[1/2,0,1/2]], [ [0,0,1],[1/2,1/2,0]]\},colo r=black,scaling=constrained):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 128 "p rocline:=(a,b,c,d,e,f) -> spacecurve(\{[ plur(a,b,c,d,e,f), aplur(a,b, c,d,e,f)]\}, color=blue,thickness=2, axes=none,style=line):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 150 "procpoints:=(a,b,c,d,e,f) -> spacecurve( \{[ plur(a,b,c,d,e,f), aplur(a,b,c,d,e,f)]\}, color=green, axes=none,s tyle=point, symbolsize=15, symbol=CIRCLE):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 115 "normalize := pnt -> ( pnt[1]/(pnt[1]+pnt[2]+pnt[3]), pnt[2]/(pnt[1]+pnt[2]+pnt[3]), pnt[3]/(pnt[1]+pnt[2]+pnt[3])):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 860 "apvertices := proc(a,b,c,d,e,f) lo cal A,B,C,D,E,F,G,H, prof, i, po, apo,CH,L;\n prof:=(a,b,c,d,e,f); \n po:= [a+b, e+f, c+d];\n apo:= [a+b+c+f, e+f+a+d, c+d+b+e];\n \n point(A, prdown(normalize([po[1],po[2],po[3]]) ));\n point(B , prdown(normalize([po[1],po[2],apo[3]]) ));\n point(C, prdown(norm alize([po[1],apo[2],po[3]]) ));\n point(D, prdown(normalize([po[1], apo[2],apo[3]]) ));\n point(E, prdown(normalize([apo[1],po[2],po[3] ]) ));\n point(F, prdown(normalize([apo[1],po[2],apo[3]]) ));\n \+ point(G, prdown(normalize([apo[1],apo[2],po[3]]) ));\n point(H, prd own(normalize([apo[1],apo[2],apo[3]]) ));\n \n CH:=convexhull(\{ A,B,C,D,E,F,G,H\});\n L:=[]: \n for i from 1 to nops(CH) do \n \+ L:=[op(L), prup(op(coordinates(CH[i])))]:\n od: \n L :=[op(L),L[1]]:\n \n return(spacecurve(L,color=red,axes=none)); \nend proc:\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 119 "plotprofile := (a,b,c,d,e,f) -> display(tri, proc line(a,b,c,d,e,f), procpoints(a,b,c,d,e,f), apvertices(a,b,c,d,e,f) ): " }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "plotprofile(10,0,6,6,3 ,6);" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "plur (10,0,6,6,3,6);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "aplur(10 ,0,6,6,3,6);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "6 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }