All problems
Steady-State Availability
Problem
Steady-state availability of a repairable system with mean time between failures mtbf and mean time to repair mttr:
A = mtbf / (mtbf + mttr).
Return 0.0 when both are 0 or inputs are negative.
Hint
The system is up during the MTBF portion of each cycle.
Test cases
case 1
in: [100,10]
expected: 0.9090909090909091
case 2
in: [50,50]
expected: 0.5
case 3
in: [10,0]
expected: 1
case 4
in: [0,0]
expected: 0
Starter codePython
def steady_state_availability(mtbf, mttr):
# Your code here
pass4 test cases · run your code against them in the editor