Sub topic 2
PERT expected duration: (O + 4M + P) / 6
This chapter assumes you know basic project scheduling terms (task, duration, dependency, critical path), can work with averages and square roots, and have a rough idea of what a standard deviation measures.
A task's duration is rarely one fixed number. The PERT (Program Evaluation and Review Technique) method uses three estimates: O, the optimistic duration; M, the most likely duration; and P, the pessimistic duration. It combines them into one expected duration:
Expected duration = (O + 4M + P) / 6
The most likely value M gets four times the weight of each extreme. The result sits between O and P, closer to M when the estimates are tight.
Measuring spread: standard deviation and variance
The spread of a task is its standard deviation, approximated as (P - O) / 6. The variance is that value squared.
from math import sqrt
def pert_mean(o, m, p):
return (o + 4 * m + p) / 6
def pert_std_dev(o, p):
return (p - o) / 6
def path_estimate(tasks):
mean = sum(pert_mean(o, m, p) for o, m, p in tasks)
variance = sum(pert_std_dev(o, p) ** 2 for o, m, p in tasks)
return mean, sqrt(variance)
print(round(pert_mean(4, 6, 14), 2)) # 7.0
print(round(pert_std_dev(4, 14), 2)) # 1.67
path = [(2, 4, 8), (3, 5, 13), (1, 2, 3)]
mean, sd = path_estimate(path)
print(round(mean, 2), round(sd, 2)) # 12.33 1.97Combining tasks on a path
Along a single path of dependent tasks, expected durations add. Variances also add, but standard deviations do not. To get the path's standard deviation, sum the variances and then take the square root. This is why the code above sums the squared spreads before calling sqrt.
This method assumes the task durations are independent of each other. If the tasks share a risk, such as one contractor on both, the true spread is wider than this calculation shows.
:::callout note Standard deviations never add directly. Sum the variances, then take the square root. :::
Exercise
A task has O = 3, M = 5 and P = 11 days. What is its PERT expected duration?
Show answer
(3 + 4 × 5 + 11) / 6 = 34 / 6 ≈ 5.67 days.