a = rand(100, 100);

c=3*ones(size(a));
c(a<.5)=1;
c((a>0.5)&(a<.5+1/3))=2;

f=sum((c==1), 2);

var(f/100-1/2)
