All problems
Exponential Moments Mean Variance
Problem
The exponential distribution with rate lambda has mean 1 / lambda and variance 1 / lambda^2.
Given the rate, return [mean, variance].
Hint
Both moments are powers of the reciprocal rate.
Test cases
case 1
in: [2]
expected: [0.5,0.25]
case 2
in: [0.5]
expected: [2,4]
case 3
in: [10]
expected: [0.1,0.01]
Starter codePython
def exponential_moments_mean_variance(rate):
# Your code here
pass3 test cases · run your code against them in the editor