% compute nn blocking for 128x128

for I=1:60,

M=rand(128);
M=fix(M);
cch=rand(128);
livet=128*128;
while livet > 0,
 for N=1:1000,
  x=fix(128*rand)+1;
  y=fix(128*rand)+1;
  ch=M(x,y)+M(p(x),y)+M(q(x),y)+M(x,p(y))+M(x,q(y));
  if ch==0,
    M(x,y)=1;
  end
 end
 for i=1:128,
    for j=1:128,
      cch(i,j)=M(i,j)+M(p(i),j)+M(q(i),j)+M(i,p(j))+M(i,q(j));
    end
 end
 livet=128*128-length(find(rand(size(cch))));
end

r(I)=length(find(M));

end


rr=r-mean(r);
hist(rr)

