Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 41 ยท Risk, Quality and Communication

Monte Carlo Schedule Risk

Use PERT three-point estimates and Monte Carlo simulation to see how likely your project is to finish on time, with runnable Python examples and confidence levels.

A single-point schedule says "the project takes 40 days". That number hides the fact that every task could run short or long. Monte Carlo simulation replaces each fixed duration with a range, rolls the dice thousands of times, and reports how often the project finishes by a given date. Instead of a promise you get a probability: "there is a 70 percent chance we finish within 46 days".

This lesson builds the technique from three-point estimates, in plain Python, so you can see exactly what spreadsheet and scheduling tools do for you.

Three-point estimates and PERT

For each task, ask for three numbers:

  • O, optimistic: everything goes well.
  • M, most likely: the usual case.
  • P, pessimistic: things go wrong but not catastrophically.

The classic PERT (Program Evaluation and Review Technique) formulas give an expected duration and a spread:

TEXT
expected = (O + 4M + P) / 6
std dev  = (P - O) / 6

The mean is pulled toward the pessimistic side whenever the range is skewed, which matches real work: tasks rarely finish much earlier than the best case, but can run far later than the worst case you imagined.

Python PERT expected duration and standard deviation

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Adding the means of tasks on one path gives the path mean; variances (not standard deviations) add, which is why the square root appears at the end. This analytic shortcut works for a single chain but breaks down with parallel paths, which is where simulation wins.

Why parallel paths hurt

Suppose two tasks run in parallel and the project waits for both. Each has a 50 percent chance of finishing by day 10. The chance that both do is only 25 percent. This is called merge bias: the more paths join, the later the average finish, even if every individual estimate is unbiased. Plain critical path arithmetic (see the scheduling chapter) misses this entirely.

flowchart LR
  S["Start"] --> A["Task A<br/>4 to 10 days"]
  S --> B["Task B<br/>5 to 9 days"]
  A --> E["Integration"]
  B --> E
  E --> F["Finish"]

Integration cannot start until both A and B finish, so the finish date is the maximum of two uncertain numbers.

A Monte Carlo simulation

The recipe:

  1. For each task, draw a random duration from a triangular (or beta-PERT) distribution defined by O, M, P.
  2. Compute the project duration for that one draw using the network logic.
  3. Repeat 10,000 times.
  4. Sort the results and read off percentiles.

Fixing the random seed makes the output reproducible.

Python Simulate a project with parallel paths

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Compare the last two lines. The "most likely" plan gives 14 days, but the median (P50) is noticeably higher, and the P80 is higher still. The plan that uses only the most likely values is optimistic because of merge bias and the skew of the distributions.

Reading the S-curve

Plot the share of runs that finished by each day and you get the cumulative S-curve. Reading it is the point of the whole exercise:

  • A date with a 50 percent chance is a coin flip, and a bad commitment.
  • Many organizations commit to the P80 or P85 date and hold the gap between the plan and that date as schedule reserve.
  • The slope tells you about risk: a steep curve means a narrow spread; a long flat tail means one more bad draw could blow the date.
Python Text S-curve and probability of hitting a deadline

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Sensitivity: which task drives the risk?

Simulation can also tell you which task to worry about. Compute the correlation between each task's duration and the total: tasks with high correlation drive the finish date, so a risk response there pays most. This is the "tornado chart" in commercial tools.

Python Which task drives the finish date?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The task with the highest correlation is where to add people, tighten scope or run a spike.

Practical advice

  • Get honest ranges. If the pessimistic value is only 10 percent above the likely one, people are anchoring. Ask "what is the worst that happens one time in ten?"
  • Include risk events. Beyond duration spread, add discrete events (a 20 percent chance of a 10-day delay) to the model.
  • Model dependencies. If two tasks share a risky supplier, their delays are correlated; independent draws understate the spread.
  • Do not trust false precision. Ten thousand runs of poor inputs give a precise wrong answer. The value is in the conversation about the ranges.
  • Re-run as you learn. Each finished task removes uncertainty and narrows the curve.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A task has O=4, M=6, P=14. What is its PERT expected duration?

    (4 + 4*6 + 14) / 6 = 42 / 6 = 7.0.
  2. 2. What does merge bias mean?

    The finish of a merge is the maximum of several uncertain finishes, so the expected finish moves later.
  3. 3. Your simulation shows P50 = 40 days and P85 = 47 days. Which statement is the best advice?

    A median commitment is missed half the time. A higher percentile plus an explicit confidence level is honest and usable.
  4. 4. When adding task variances along a single path, you add:

    Independent variances add; the path SD is the square root of the sum.

Summary

  • Three-point estimates (O, M, P) capture uncertainty; PERT mean is (O + 4M + P) / 6 and SD is (P - O) / 6.
  • Merge bias means deterministic plans are usually optimistic.
  • Monte Carlo simulation draws durations repeatedly and reports percentiles of the finish date.
  • Commit to a confidence level (for example P80), not to the median.
  • Sensitivity shows which tasks drive the risk.

Next: Quality Management