'); wincool.document.writeln('
RESULTS

'); wincool.document.writeln(''); wincool.document.writeln(''); for (var o=1; o<=10; o++) { var i=0; var j=0; var p=2/Math.acos(-1); for (var k=1; k<=number; k++) { if (Math.random()<=p) { i=i+1; //No.of hits } else { j=j+1; //No.of misses } } var pi=(2*number)/(i); var pidy=pidy+pi; var percentage=(i/number)*100; wincool.document.writeln(''); wincool.document.writeln(''); wincool.document.writeln(''); } wincool.document.writeln('
NO.OF TRIESVALUE OF PINUMBER OF MISSESNUMBER OF HITS% OF HITS
',o,'',pi,'',j,'',i,'',percentage,'


'); wincool.document.writeln(''); wincool.document.writeln(''); wincool.document.writeln(''); wincool.document.writeln(''); wincool.document.writeln(''); wincool.document.writeln(''); wincool.document.writeln(''); wincool.document.writeln('
THE AVERAGE VALUE OF PI AFTER 10 TRIES
',pidy/10,'

'); wincool.document.writeln('
'); wincool.document.writeln('
Hosted by www.Geocities.ws

'); wincool.document.close(); self.controlwin=wincool; } function closeup() { self.controlwin.close(); }
VALUE OF PI...CALCULATED FROM THE THEORIES OF PROBABILITY

THIS PROGRAM IS WRITTEN BY MR.GEEKY...DEDICATED TO ALL THE MATH LOVERS




PLEASE ENTER THE NUMBER OF DROPS OF THE CHALKS








A mathematicican like a painter or a poet, is a maker of patterns. If his patterns are more permanent than theirs, it is becuase they are made with ideas.




Hosted by www.Geocities.ws

1