%histogramy generatorow
N=10;
X=10000;
%figure(1)
C=zeros(X-1-N,1);

r1=rand(X,1);
for i=1:X-1-N
dumm1=r1(i:i+N);
dumm1=dumm1-mean(dumm1);
dumm2=r1(i+1:i+1+N);
dumm2=dumm2-mean(dumm2);
C(i)=(dumm1'*dumm2)/(norm(dumm1)*norm(dumm2));
end
disp('rand')
mean(C)
C=zeros(X-1-N,1);
r2=gen1(1,X);
for i=1:X-1-N
dumm1=r2(i:i+N);
dumm1=dumm1-mean(dumm1);
dumm2=r2(i+1:i+1+N);
dumm2=dumm2-mean(dumm2);
C(i)=(dumm1'*dumm2)/(norm(dumm1)*norm(dumm2));
%dumm1=r2(i:i+N)-mean(r2(i:i+N));
%dumm2=r2(i+1:i+1+N)-mean(r2(i:i+N));
%C(i)=(dumm1'*dumm2)/(norm(dumm1)*norm(dumm2));
%C(i)=dumm1*dumm2/(sqrt(dumm1*dumm1*dumm2*dumm2));
end
disp('gen1')
mean(C)
C=zeros(X-1-N,1);
r3=gen2(1,X);
for i=1:X-1-N
dumm1=r3(i:i+N);
dumm1=dumm1-mean(dumm1);
dumm2=r3(i+1:i+1+N);
dumm2=dumm2-mean(dumm2);
C(i)=(dumm1'*dumm2)/(norm(dumm1)*norm(dumm2));
%end
%dumm1=r3(i:i+N)-mean(r3(i:i+N));
%dumm2=r3(i+1:i+1+N)-mean(r3(i:i+N));
%C(i)=dumm1*dumm2/(sqrt(dumm1*dumm1*dumm2*dumm2));
%C(i)=(dumm1'*dumm2)/(norm(dumm1)*norm(dumm2));
end
disp('gen2')
mean(C)
C=zeros(X-1-N,1);
r4=gen3(1,X);
for i=1:X-1-N
dumm1=r4(i:i+N);
dumm1=dumm1-mean(dumm1);
dumm2=r4(i+1:i+1+N);
dumm2=dumm2-mean(dumm2);
C(i)=(dumm1'*dumm2)/(norm(dumm1)*norm(dumm2));
end
%dumm1=r4(i:i+N)-mean(r4(i:i+N));
%dumm2=r4(i+1:i+1+N)-mean(r4(i:i+N));
%C(i)=(dumm1'*dumm2)/(norm(dumm1)*norm(dumm2));
%C(i)=dumm1*dumm2/(sqrt(dumm1*dumm1*dumm2*dumm2));
%end
disp('gen3')
mean(C)
C=zeros(X-1-N,1);
r5=gen4(1,X);
for i=1:X-1-N
dumm1=r5(i:i+N);
dumm1=dumm1-mean(dumm1);
dumm2=r5(i+1:i+1+N);
dumm2=dumm2-mean(dumm2);
C(i)=(dumm1'*dumm2)/(norm(dumm1)*norm(dumm2));
end
    %dumm1=r5(i:i+N)-mean(r5(i:i+N));
%dumm2=r5(i+1:i+1+N)-mean(r5(i:i+N));
%C(i)=(dumm1.*dumm2)/(norm(dumm1)*norm(dumm2));
%C(i)=dumm1*dumm2/(sqrt(dumm1*dumm1*dumm2*dumm2));
%end
disp('gen4')
mean(C)
C=zeros(X-1-N,1);
r6=gen5(1,X);
for i=1:X-1-N
dumm1=r6(i:i+N);
dumm1=dumm1-mean(dumm1);
dumm2=r6(i+1:i+1+N);
dumm2=dumm2-mean(dumm2);
C(i)=(dumm1'*dumm2)/(norm(dumm1)*norm(dumm2));
end
    %dumm1=r6(i:i+N)-mean(r6(i:i+N));
%dumm2=r6(i+1:i+1+N)-mean(r6(i:i+N));
%C(i)=(dumm1.*dumm2)/(norm(dumm1)*norm(dumm2));
%C(i)=dumm1*dumm2/(sqrt(dumm1*dumm1*dumm2*dumm2));
%end
disp('gen5')
mean(C)
