clear all N=25 % size of a group aa=365:-1:(365-N+1); % bb=0:1:(N-1); cc=1-bb./aa; 1-prod(cc)