Skip to content
DeepForgeby svx
All problems
MediumProbabilitypr-367

Lognormal Variance Value

Problem

The lognormal variance is (exp(sigma^2) - 1) * exp(2 mu + sigma^2).

Given mu and sigma, return the variance.

Hint

It factors through the second moment minus the squared mean.

Test cases

case 1
in: [0,1]
expected: 4.670774270471604
case 2
in: [1,0.5]
expected: 2.694758124344947
case 3
in: [0,0]
expected: 0
Starter codePython
def lognormal_variance_value(mu, sigma):
    # Your code here
    pass

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