Skip to content
DeepForgeby svx
All problems
MediumGraph Algorithmsgraph-161

PERT Expected Duration

Problem

Compute PERT expected durations for a list of activities.

Each activity is [optimistic, likely, pessimistic] and its expected duration is (o + 4m + p) / 6. Return [durations, total] where durations lists every activity's expectation and total is their sum.

Hint

The beta distribution mean weights the most likely estimate four times.

Test cases

case 1
in: [[[2,4,6],[3,5,7]]]
expected: [[4,5],9]
case 2
in: [[[1,1,1],[6,6,6]]]
expected: [[1,6],7]
case 3
in: [[[2,3,10],[4,4,4]]]
expected: [[4,4],8]
Starter codePython
def pert_expected_duration(activities):
    # Your code here
    pass

3 test cases · run your code against them in the editor