All problems
Pareto Tail Probability
Problem
Pareto tail probability with minimum xm and shape alpha:
P(X > x) = (xm / x)^alpha for x >= xm, and 1 otherwise.
Return 0.0 for nonpositive xm or alpha.
Hint
The tail decays like a power law; at x = xm the probability is 1.
Test cases
case 1
in: [1,2,2]
expected: 0.25
case 2
in: [1,2,1]
expected: 1
case 3
in: [2,3,4]
expected: 0.125
case 4
in: [1,1,10]
expected: 0.1
Starter codePython
def pareto_tail_probability(xm, alpha, x):
# Your code here
pass4 test cases · run your code against them in the editor