Once we have specified the INPUT and the logic, we can run the simulation to see the outcomes. The OUTPUT is the measurements of the outcomes. For example, the mean profit and its 95 percent confidence internal. Typically it involves statistic analysis. Taking together, we have
To illustrate, we consider a dart game. Kobe is to play the dart game with his friend. The board is of two by two size, with the circle of radius one. Kobe is a lousy shooter. He can make each shot on the square board, beyond that his shots are random. His friend makes a generous offer: Kobe gets free beer if he hits in the circle. So what is the probability that Kobe gets free bee?
There are several ways to solve this problem. For example, since Kobe shots uniformly on the dart board, his chance of hitting the board is one. Given that, his chance of hitting in the circle would equal the ratio between the circle area and the board area: .
This approach requires the knowledge of the circle area formula and the value of pi. If you don’t, you can still figure out through experiments, e.g., by asking Kobe to shot. For example, If Kobe shots times, and you can count the number of times he hits in the circle. Then .
When the sample size is large, it may be too costly or even infeasible to do real experiments. Instead, we can carry out on computer. We focus on a quarter of the board. First, specify the INPUT. In this case, we know there is only one random variable, the shot , and . In Excel: RAND().
Next, we figure out the logic. For each shot , we need to know whether it is a hit. That is, , where is the distance between the shot and the center . So is an indicator. In Excel: , or simply .
To generate a sample, we replicate shots. For each shot , we know whether it is a hit, or . We then do statistic analysis. The total number of hits is , and the probability .