2078 6

CSC328 ยท 2078 ยท 5 marks

Explain Monte Carlo simulation method with an example?

Explain Monte Carlo simulation method with an example? [5]

Simulation and ModelingChapter 2: Simulation of Continuous and Discrete SystemProbability and Monte Carlo Simulation

Quick answer

Monte Carlo simulation is a computerized mathematical technique that generates random sample data based on some known distribution for numerical experiments. It is applied to risk quantitative analysis and decision making problems, and is used by professionals in finance, project management, energy, manufacturing, engineering, research & development, transportation, and more.

Monte Carlo Simulation Method

Definition


Key Characteristics

The three important characteristics of the Monte Carlo method are:

  1. The output must generate random samples
  2. The input distribution must be known
  3. The result must be known while performing an experiment

Flowchart for Monte Carlo Simulation

        Start
          |
          v
  Define the Problem
          |
          v
  Identify Input Variables
  and their Distributions
          |
          v
  Generate Random Numbers
          |
          v
  Simulate the Experiment
  (Repeat N times)
          |
          v
  Collect and Analyze Output
          |
          v
  Estimate the Result / Decision
          |
          v
        Stop

Example: Estimating the Value of Pi (ฯ€)

Problem: Use Monte Carlo simulation to estimate the value of ฯ€.

Concept:

  • Consider a unit square of side 1 and a quarter circle of radius 1 inscribed within it.
  • Area of the square = 1 ร— 1 = 1
  • Area of the quarter circle = ฯ€(1)ยฒ/4 = ฯ€/4

Steps:

Step 1: Generate N pairs of random numbers (x, y) where x, y โˆˆ [0, 1]

Step 2: Check if the point (x, y) falls inside the quarter circle using:

$$x^2 + y^2 \leq 1$$

Step 3: Count the number of points inside the circle (M)

Step 4: Estimate ฯ€ using:

$$\frac{\text{Points inside circle}}{\text{Total points}} = \frac{\pi/4}{1}$$

$$\pi \approx 4 \times \frac{M}{N}$$

Numerical Illustration:

Trialxyxยฒ + yยฒInside Circle?
10.30.60.09+0.36 = 0.45Yes
20.80.70.64+0.49 = 1.13No
30.20.40.04+0.16 = 0.20Yes
40.90.50.81+0.25 = 1.06No
50.10.30.01+0.09 = 0.10Yes
  • Total points N = 5
  • Points inside circle M = 3

$$\pi \approx 4 \times \frac{3}{5} = 4 \times 0.6 = \mathbf{2.4}$$

Note: As N increases (e.g., N = 10,000), the estimate converges closer to the true value of ฯ€ โ‰ˆ 3.14159.


Advantages

  • Can handle complex systems that are difficult to solve analytically
  • Applicable to a wide range of domains
  • Provides probabilistic results with confidence intervals

Summary

Monte Carlo simulation uses repeated random sampling to obtain numerical results. The larger the number of trials, the more accurate and reliable the result becomes. It is especially powerful when analytical solutions are difficult or impossible to obtain.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.