Skip to content
DeepForgeby svx
All problems
MediumProbabilitypr-208

Erlang C Waiting Probability

Problem

Erlang C probability that an arriving customer must wait when traffic erlangs are offered to servers, computed from the Erlang B value:

C = B / (1 - rho * (1 - B)) with rho = traffic / servers.

Return 0.0 when traffic or servers is not positive, and 1.0 when rho >= 1.

Hint

Erlang C equals Erlang B divided by one minus the carried-load correction.

Test cases

case 1
in: [1,2]
expected: 0.33333333333333337
case 2
in: [2,3]
expected: 0.4444444444444445
case 3
in: [1,1]
expected: 1
case 4
in: [0.5,2]
expected: 0.10000000000000002
case 5
in: [0,2]
expected: 0
Starter codePython
def erlang_c(traffic, servers):
    # Your code here
    pass

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