Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Monte Carlo method
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Overview == Monte Carlo methods vary, but tend to follow a particular pattern: # Define a domain of possible inputs. # Generate inputs randomly from a [[probability distribution]] over the domain. # Perform a [[Deterministic algorithm|deterministic]] computation of the outputs. # Aggregate the results. [[File:Pi monte carlo all.gif|thumb|upright=1.3| Monte Carlo method applied to approximating the value of {{pi}}]] For example, consider a [[circular sector#Quadrant|quadrant (circular sector)]] inscribed in a [[unit square]]. Given that the ratio of their areas is {{sfrac|{{pi}}|4}}, the value of [[pi|{{pi}}]] can be approximated using the Monte Carlo method:{{sfn|Kalos|Whitlock|2008}} # Draw a square, then [[inscribed figure|inscribe]] a quadrant within it. # [[uniform distribution (continuous)|Uniformly]] scatter a given number of points over the square. # Count the number of points inside the quadrant, i.e. having a distance from the origin of less than 1. # The ratio of the inside-count and the total-sample-count is an estimate of the ratio of the two areas, {{sfrac|{{pi}}|4}}. Multiply the result by 4 to estimate {{pi}}. In this procedure, the domain of inputs is the square that circumscribes the quadrant. One can generate random inputs by scattering grains over the square, then performing a computation on each input to test whether it falls within the quadrant. Aggregating the results yields our final result, the approximation of {{pi}}. There are two important considerations: # If the points are not uniformly distributed, the approximation will be poor. # The approximation improves as more points are randomly placed in the whole square. Uses of Monte Carlo methods require large amounts of random numbers, and their use benefitted greatly from [[pseudorandom number generators]], which are far quicker to use than the tables of random numbers that had been previously employed.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)