All problems
Chebyshev Bound Value
Problem
Chebyshev's inequality bounds P(|X - mean| >= k * sigma) by 1 / k^2. Return the bound capped at 1.0, and 1.0 for k <= 0.
Hint
The bound only depends on how many standard deviations the threshold is.
Test cases
case 1
in: [2]
expected: 0.25
case 2
in: [3]
expected: 0.1111111111111111
case 3
in: [1]
expected: 1
case 4
in: [0.5]
expected: 1
case 5
in: [10]
expected: 0.01
Starter codePython
def chebyshev_bound(k):
# Your code here
pass5 test cases · run your code against them in the editor