% % Written by: % -- % John L. Weatherwax 2006-12-31 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- clc; close all; the_prod=1.0; for n=1:50, num = 365-(n-1); den = 365.; the_prod = the_prod * (num/den); if( the_prod < 0.5 ) n break; end end