Skip to content
DeepForgeby svx
All problems
MediumProbabilitypr-207

Erlang B Blocking Probability

Problem

Erlang B blocking probability for traffic erlangs offered to servers circuits, using the recursion B(0) = 1 and:

B(k) = traffic * B(k - 1) / (k + traffic * B(k - 1)).

Return B(servers), and 0.0 for negative inputs.

Hint

Each recursion step adds one circuit; no calls wait in the Erlang B model.

Test cases

case 1
in: [1,1]
expected: 0.5
case 2
in: [1,2]
expected: 0.2
case 3
in: [2,3]
expected: 0.2105263157894737
case 4
in: [0,5]
expected: 0
case 5
in: [1,0]
expected: 1
Starter codePython
def erlang_b(traffic, servers):
    # Your code here
    pass

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