Skip to content
Tutorials Center
My learning

Topics

Lesson 35 of 38 ยท Projects and Practice

Project: Scheduling Under Uncertainty

Simulate a project network with uncertain task durations, estimate finish-time percentiles, find critical tasks and choose a realistic deadline.

Project managers hear the same question again and again: "When will it be done?" The honest answer is a distribution, not a date. Each task has an uncertain duration, tasks depend on one another, and delays on the critical path push back the whole project. Monte Carlo simulation is the standard tool for turning task estimates into a realistic finish-time distribution.

In this project you will build a small simulator from scratch, then use it to answer three questions: what deadline gives an 80% chance of success, which tasks drive the risk, and why adding up "most likely" durations misleads.

The project

Five tasks with durations in days. Each has an optimistic, most likely and pessimistic estimate, modeled with a triangular distribution Triangular(min, mode, max), whose mean is (min + mode + max)/3.

Task min mode max Needs
A Design 2 4 8 nothing
B Build backend 3 5 10 A
C Build frontend 4 6 9 A
D Integrate 2 3 6 B and C
E Release 1 2 4 D
flowchart LR
  A["A Design"] --> B["B Backend"]
  A --> C["C Frontend"]
  B --> D["D Integrate"]
  C --> D
  D --> E["E Release"]

B and C run in parallel; D waits for the slower one.

The finish time is the longest path through the network:

Text
T = A + max(B, C) + D + E

The max is the key. When two parallel tasks both finish late or early by chance, the project follows the slower one, so the average of max(B, C) is larger than the larger of the two averages.

Step 1: simulate the finish time

Python Finish-time distribution and a realistic 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.

You will see that adding the most likely durations gives a date that is hit well under half the time. The reasons: the task distributions are skewed to the right (the pessimistic end is farther from the mode than the optimistic end), and the max over parallel branches adds extra delay. A plan built from most likely values is systematically optimistic.

Step 2: which tasks matter?

Two simple measures tell you where to spend management attention:

  • Criticality index: the fraction of runs in which a task lies on the longest path. Here D, A and E are always critical (everything passes through them); B is critical when B > C, otherwise C is.
  • Sensitivity: the correlation between a task's duration and the total duration. A task with a high correlation explains much of the project's variability.
Python Criticality and sensitivity

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.

Notice that task B has a wider range than A, yet a much lower sensitivity: it is on the critical path only part of the time, while every unit of delay in A goes straight into the total.

Step 3: decide

Two decisions come straight from the simulation:

  1. Deadline. Commit to a date at the percentile that matches your risk appetite: the 80th or 90th percentile gives a buffer. Report both the date and the probability, for example "85% chance of finishing by day X".
  2. Where to act. Shrinking the uncertainty of high-sensitivity tasks (more investigation, extra staff, an earlier prototype) cuts the spread most. Rerun the simulation with narrower ranges for those tasks and compare percentiles.

Extensions to try

  • Add a risk event: with probability 0.2 task C suffers a rework that adds a random 2 to 5 days.
  • Replace the triangular distribution with a PERT-beta or lognormal, which handles long right tails.
  • Add cost per day and ask for the distribution of total cost.
  • Add a resource constraint: only one person can work on B or C at a time, so they cannot run in parallel.

Show stakeholders the histogram and a few percentiles, not just the mean. A mean implies a 50% chance of lateness, which few clients accept.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is the sum of 'most likely' durations usually an optimistic project estimate?

    Right-skewed durations have means above their modes, and the max over parallel tasks adds more delay.
  2. 2. The mean of a Triangular(2, 4, 8) variable is:

    (2 + 4 + 8) / 3 = 14/3, about 4.67, which is larger than the mode 4.
  3. 3. A task's criticality index measures:

    It is the fraction of simulation runs in which the task is critical.
  4. 4. Which statement is the best way to report a deadline?

    A date with a probability communicates uncertainty and supports risk-based decisions.

Summary

  • Model each task duration as a distribution; compute finish time as the longest path through the network.
  • The max of parallel tasks and right-skewed durations make deterministic plans optimistic.
  • Use percentiles for deadlines, and criticality and sensitivity to find tasks worth attention.
  • Extend with risk events, costs and resource limits using the same simulation loop.

Next: Project: The Ising Model