Lognormal Distribution

Prob. and Stats

Difficulty: 1 | Problem written by Junaid Ahmed
Problem reported in interviews at


A lognormal distribution is the continuous probability distribution of a variable having a random state whose logarithm is normally distributed.

The equation of lognormal distribution is: 

\(f(x) = \frac{1}{2}[1+erf(\frac{\ln x - M}{S\sqrt{2}})]\)

whereas erf is the Gauss error function 

M is the mean

S is the standard deviation

x is the data points


datapoints: x

m: mean (M)

std: standard deviation (S)


A normal distribution value.

Sample Input:
<class 'int'>
x: 20
<class 'float'>
m: 1.344
<class 'float'>
std: 2.0985

Expected Output:
<class 'float'>

This is a premium problem, to view more details of this problem please sign up for MLPro Premium. MLPro premium offers access to actual machine learning and data science interview questions and coding challenges commonly asked at tech companies all over the world

MLPro Premium also allows you to access all our high quality MCQs which are not available on the free tier.

Not able to solve a problem? MLPro premium brings you access to solutions for all problems available on MLPro

Get access to Premium only exclusive educational content available to only Premium users.

Have an issue, the MLPro support team is available 24X7 to Premium users.

This is a premium feature.
To access this and other such features, click on upgrade below.

Log in to post a comment


Input Test Case

Please enter only one test case at a time
numpy has been already imported as np (import numpy as np)