Skip to content
DeepForgeby svx
All problems
EasyProbabilitypr-368

Laplace Moments Mean Variance

Problem

The Laplace distribution with location mu and scale b has mean mu and variance 2 b^2.

Given mu and b, return [mean, variance].

Hint

The scale enters the variance quadratically.

Test cases

case 1
in: [0,1]
expected: [0,2]
case 2
in: [2,0.5]
expected: [2,0.5]
case 3
in: [-1,3]
expected: [-1,18]
Starter codePython
def laplace_moments_mean_variance(mu, b):
    # Your code here
    pass

3 test cases · run your code against them in the editor