All problems
Cantelli One Sided Bound
Problem
Cantelli's inequality bounds one tail: P(X - mu >= t) <= sigma^2 / (sigma^2 + t^2).
Given the variance and the offset t > 0, return the bound.
Hint
It is tighter than Chebyshev for a single direction.
Test cases
case 1
in: [1,1]
expected: 0.5
case 2
in: [4,2]
expected: 0.5
case 3
in: [0.25,3]
expected: 0.02702702702702703
Starter codePython
def cantelli_one_sided_bound(variance, t):
# Your code here
pass3 test cases · run your code against them in the editor