/* $Id: Figure1.c,v 1.7 2008-01-16 14:44:36 vhahn Exp $ */ /* Author: Volker Hahn Type: C source code Objective: This creates the data for Figure 1 in the paper "Committees, Sequential Voting and Transparency", 2008. Forthcoming in "Mathematical Social Sciences". Compiler: compiled by gcc, version 4.1.2, available from gcc.gnu.org, command "gcc -lm Figure1.c -o Figure1" */ #include #include #include /* declare functions */ long double OptimalBehavior3T(); long double computeUtilPrincSeq(); long double computeUtilPrincSim(); /* global variables */ long double pH=0.8, pL=0.51; int main() { pH=.8; /* compute the principal's utility in the first period under sequential voting and simultaneous voting for all admissibile values of pL */ for (pL=.5;pL<=pH+0.00001;pL+=0.005) printf("%Lf %Lf %Lf\n", pL, computeUtilPrincSeq(),computeUtilPrincSim()); return(0); } /* Function: computeUtilPrincSeq Objective: returns the probability of a correct decision being reached in the first period, i.e. the utility of the principal in the first period, under sequential voting */ long double computeUtilPrincSeq() { /* assume w.l.o.g d^* = +1 */ /* v[0] vote of member 1, v[1] vote of member 2, v[2] vote of member 3 */ char v[3]; /* probability of member 2 following his signal s=+1 if less efficient and v=(-1) */ long double followSignalIfUnsure2; /* probability of member 3 following his signal s=+1 if less efficient and v=(-1,+1) */ long double followSignalIfUnsure3; /* the result is stored in this variable */ long double result=0; long double Prob=0; /* parameters describing the optimal behavior of less effficient members 2 and 3, compare Proposition 2 of the paper */ followSignalIfUnsure2 = (1.-pH)/(1.-pL); followSignalIfUnsure3 = OptimalBehavior3T(); /* loop over all possible patterns of votes */ for (v[0]=-1;v[0]<=+1;v[0]+=2) for (v[1]=-1;v[1]<=+1;v[1]+=2) for (v[2]=-1;v[2]<=+1;v[2]+=2) { /* Prob will give the probability of a particular pattern of votes (v_1,v_2,v_3) It will be computed step by step: the probablity of (v_1,v_2,v_3) = the probability of v_1 times the probability of v_2, given v_1, times the probability of v_3, given v_1 and v_2 */ /* First step: Prob = probability of 1 voting for v[0] */ if (v[0]==-1) Prob=1-.5*(pH+pL); else Prob=.5*(pH+pL); /* Second step: Prob is multiplied by the probability of 2 voting for v[1], given that 1 has chosen v[0] */ if (v[0]==-1 && v[1]==-1) Prob*=(.5*(1-pH)+.5*(1-pL)+.5*pL*(1-followSignalIfUnsure2)); else if (v[0]==-1 && v[1]==+1) Prob*=(.5*pH + .5*pL*followSignalIfUnsure2); else if (v[0]==+1 && v[1]==-1) Prob*=(.5*(1-pH) + .5*(1-pL)*followSignalIfUnsure2); else if (v[0]==+1 && v[1]==+1) Prob*=(.5*pH+.5*pL+.5*(1-pL)*(1-followSignalIfUnsure2)); /* Third step: Prob is multiplied by the probability of 3 voting for v[2], given that 1 has chosen v[0] and 2 has chosen v[1] */ if (v[0]==-1 && v[1]==-1 && v[2]==-1) Prob*=(.5*(1-pH)+.5*(1-pL)+.5*pL*(1-followSignalIfUnsure2)); else if (v[0]==-1 && v[1]==-1 && v[2]==+1) Prob*=(.5*pH+.5*pL*followSignalIfUnsure2); else if (v[0]==-1 && v[1]==+1 && v[2]==-1) Prob*=(.5*(1-pH)+.5*(1-pL)*followSignalIfUnsure3); else if (v[0]==-1 && v[1]==+1 && v[2]==+1) Prob*=(.5*pH+.5*pL+.5*(1-pL)*(1-followSignalIfUnsure3)); else if (v[0]==+1 && v[1]==-1 && v[2]==-1) Prob*=(.5*(1-pH)+.5*pL*(1-followSignalIfUnsure3)+.5*(1-pL)); else if (v[0]==+1 && v[1]==-1 && v[2]==+1) Prob*=(.5*pH+.5*pL*followSignalIfUnsure3); else if (v[0]==+1 && v[1]==+1 && v[2]==-1) Prob*=(.5*(1-pH)+.5*(1-pL)*followSignalIfUnsure2); else if (v[0]==+1 && v[1]==+1 && v[2]==+1) Prob*=(.5*pH+.5*pL+.5*(1-pL)*(1-followSignalIfUnsure2)); /* Check if there is a majority of votes in favor of the correct decision. If this is the case, increase "result" by Prob */ if (v[0]+v[1]+v[2]>0) result+=Prob; } return(result); } /* Function: computeUtilPrincSim Objective: returns the probability of a correct decision being reached in the first period, i.e. the utility of the principal in the first period, under simultaneous voting */ long double computeUtilPrincSim() { /* the result is stored in this variable */ long double result=0; long double Prob=1; int i=0; /* v: vector of the members' votes for example v[0] is member 1's vote */ char v[3]; /* Note: the analysis is comparably simple, because the probabilities of individual members voting correctly are independent under simultaneous voting */ for (v[0]=-1;v[0]<=+1;v[0]+=2) for (v[1]=-1;v[1]<=+1;v[1]+=2) for (v[2]=-1;v[2]<=+1;v[2]+=2) { Prob=1; for(i=0;i<=2;i++) if (v[i]==-1) Prob*=1-.5*(pH+pL); /* 1-.5*(pH+pL) is the probability of a member choosing a wrong vote */ else Prob*=.5*(pH+pL); /* .5*(pH+pL) is the probability of a member choosing a correct vote */ /* Check if there is a majority of votes in favor of the correct decision. If this is the case, increase "result" by Prob */ if (v[0]+v[1]+v[2]>0) result+=Prob; } return(result); } /* ----------------------------------------------- Function: OptimalBehavior3T Objective: compute the probability of member 3 choosing v=+1, given s=+1, v_1=-1, and v_2=+1 (compare Proposition 2 in the paper) ----------------------------------------------- */ long double OptimalBehavior3T() { long double followSignalIfUnsure3; long double zmp=0; /* compute z_(-1,+1) and compare to pL */ zmp = (1./(1.+ (1.-pL)*(1.-pH)*(.5*(pH+pL))/(1.- .5*(pH+pL)) / (.5*(pH*(1.-pL)+pL*(1.-pH))))); if (pL>zmp) /* private signal superior to information from pattern of previous votes */ followSignalIfUnsure3 = 1.; else followSignalIfUnsure3 =(1-pH)/(1-pL); return(followSignalIfUnsure3); }