11.3 What Is a Simulation?
Earlier, we used a “dartboard” simulation to calculate an approximation for the value of pi. That simulation used a random number generator to place darts on a dartboard as if the darts were being thrown by a player. Although the locations of the darts changed each time we ran the simulation, we were able to consistently use the relative dart locations in calculating a value for pi.
A computer simulation is a computer program that is designed to model some specific aspects of a real situation or system. Computer simulations will often utilize random numbers as a way of introducing some realistic variability into the underlying model. The results can then be used to gain information about the way a real system behaves. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access