CSC317 Simulation and Modeling

Simulation and ModelingTU Board 2080

Explain Monte Carlo simulation method with example.

5

Answer

Monte Carlo simulation solves problems by repeated random sampling. It builds a model with random inputs drawn from probability distributions, runs the model many times, and uses the results to estimate the answer. It is useful when a problem is too complex to solve analytically, or involves uncertainty.

Steps

  1. Define the problem and the model (inputs, outputs and relationships).
  2. Give each uncertain input a probability distribution.
  3. Generate random numbers and convert them to input values.
  4. Run the model for those inputs and record the output.
  5. Repeat many times (thousands of trials).
  6. Analyse the outputs: mean, variance, probabilities and confidence intervals.

Example 1: estimating π

Throw random points uniformly into a square of side 1 that contains a quarter circle of radius 1. The fraction of points inside the quarter circle approaches its area, π/4.

  • Generate random x, y in [0, 1].
  • Count the point as a hit if x² + y² ≤ 1.
  • π ≈ 4 × (hits / total points).

With 10,000 points, if 7,850 land inside, π ≈ 4 × 0.785 = 3.14.

Example 2: daily demand

A shop's daily demand is 10, 20 or 30 units with probabilities 0.2, 0.5 and 0.3. Assign random-number ranges 00–19 → 10, 20–69 → 20, 70–99 → 30. Draw random numbers for many days, read off the demand, and average the results to estimate expected demand and stock-outs.

Uses: risk analysis in finance, queueing systems, reliability studies, project scheduling (PERT) and numerical integration.

Discussion

Loading…

More Simulation and Modeling questions

All Simulation and Modeling old questions