% define GrpSize outside of program % define YesInGrp outside of program % define NRep (number of simulations of the survey) outside of program PrRealQ=0.5; % probability that dime lands Heads PrYesDecoy=0.5; % probability that penny lands Heads p=YesInGrp/GrpSize; % actual fraction of yes in group %Each column in the matrices of this section represents one person in the group. %We may assume that the first YesInGrp columns are the yes people. TrueYes=[ones(NRep,YesInGrp) zeros(NRep,GrpSize-YesInGrp)]; RealQ=(rand(NRep,GrpSize)