<![CDATA[Estimation of PI using a Monte Carlo method]]> false false false false false false false true true false ]]> ./CalculoPI/CalculatePI_WCthumb.png ./01authorlookang50x50.png;; DESCRIPTION_EDITOR About true false _default_ About false Estimation of PI using a Monte Carlo method:

Monte Carlo methods are often useful for solving problems in physics and mathematics, which cannot be solved by analytical means.
The goal of this virtual-lab is to obtain an approximated value of PI, using a Monte Carlo method. Next, we describe briefly how this method is used to estimate PI.
Imagine that we are throwing a dart over a square surface of side 1 m. There is a circle of radius 1 m. inscribed in the square. Assuming that the probability is uniformly distributed, the probability of hitting inside the circle is equal to PI/4. Dividing the number of hits by the number of throws, it is obtained an estimation of PI. We will obtain a better approximation by increasing the number of throws.
This virtual-lab allows the user to select the number of throws, with a maximum of 10000 throws. ]]>
DESCRIPTION_EDITOR Author true false _default_ Author false Carla Martín
Dpto. de Informática y Automática
E.T.S. de Ingeniería Informática, UNED
Juan del Rosal 16, 28040 Madrid, Spain ]]>
20 1 true VARIABLE_EDITOR Variables true false VARIABLE_EDITOR VariableWC true false VARIABLE_EDITOR Variables2 true false CODE_EDITOR Init Page true false LIBRARY_EDITOR Actions true false maxPoints) { nTotal = maxPoints; } pointX[i] = Math.random(); pointY[i] = Math.random(); if (Math.sqrt(pointX[i]*pointX[i]+pointY[i]*pointY[i])<1) { nHits++; } } PI = 4.0*(nHits/nTotal); valuePI = "PI = "+PI; } ]]> HTML_VIEW_EDITOR SImulation View true false 0 0 0 800 600 true true Elements.Panel Elements.Label Elements.ParsedField Elements.Label Elements.Button Elements.Button true Elements.Panel true Elements.PlottingPanel Elements.Polygon2D Elements.Polygon2D Elements.Polygon2D Elements.ShapeSet2D Elements.Panel The goal of this virtual-lab is to obtain an approximated value of PI, using a Monte Carlo method.
Next, we describe briefly how this method is used to estimate PI.
Imagine that we are throwing a dart over a square surface of side 1 m.
There is a circle of radius 1 m. inscribed in the square.
Assuming that the probability is uniformly distributed, the probability of hitting inside the circle is equal to PI/4.
Dividing the number of hits by the number of throws, it is obtained an estimation of PI.
We will obtain a better approximation by increasing the number of throws.
This virtual-lab allows the user to select the number of throws, with a maximum of 10000 throws. ]]>