exercise:636f7b1aab: Difference between revisions

From Stochiki
(Created page with "<div class="d-none"><math> \newcommand{\NA}{{\rm NA}} \newcommand{\mat}[1]{{\bf#1}} \newcommand{\exref}[1]{\ref{##1}} \newcommand{\secstoprocess}{\all} \newcommand{\NA}{{\rm NA}} \newcommand{\mathds}{\mathbb}</math></div> Alter the program ''' MonteCarlo''' to estimate the area of the circle of radius 1/2 with center at <math>(1/2,1/2)</math> inside the unit square by choosing 1000 points at random. Compare your results with the true value of <math>\pi/4</math>....")
 
No edit summary
 
Line 1: Line 1:
<div class="d-none"><math>
Alter the program ''' MonteCarlo''' to estimate the area of the circle of radius 1/2 with center at <math>(1/2,1/2)</math> inside the unit square by
\newcommand{\NA}{{\rm NA}}
\newcommand{\mat}[1]{{\bf#1}}
\newcommand{\exref}[1]{\ref{##1}}
\newcommand{\secstoprocess}{\all}
\newcommand{\NA}{{\rm NA}}
\newcommand{\mathds}{\mathbb}</math></div> Alter the program ''' MonteCarlo''' to estimate the area of the
circle of radius 1/2 with center at <math>(1/2,1/2)</math> inside the unit square by
choosing 1000 points at random.  Compare your results with the true value of
choosing 1000 points at random.  Compare your results with the true value of
<math>\pi/4</math>.  Use your results to estimate the value of <math>\pi</math>.  How accurate is
<math>\pi/4</math>.  Use your results to estimate the value of <math>\pi</math>.  How accurate is
your estimate?
your estimate?

Latest revision as of 22:22, 12 June 2024

Alter the program MonteCarlo to estimate the area of the circle of radius 1/2 with center at [math](1/2,1/2)[/math] inside the unit square by choosing 1000 points at random. Compare your results with the true value of [math]\pi/4[/math]. Use your results to estimate the value of [math]\pi[/math]. How accurate is your estimate?