1

Gaussian PDF

Unsolved
Prob. and Stats

Difficulty: 2 | Problem written by junaid
Problem reported in interviews at

Amazon
Apple
Facebook
Google
Netflix

The probability of a given value can easily be estimated with the Gaussian distribution with the mean and the standard deviation as distribution parameters.

The equation that is used to calculate the PDF of a Gaussian distribution is listed below:

\(f(x)= exp(-(\frac{(a-x)^{2}}{ (2 ^{} c^{2} )}))^{}( \frac{1} { (sqrt(2 ^{}\pi) ^{} c)})\)

Given a (input value), x (mean), and c (standard deviation), calculate the Gaussian distribution with the help of PDF.

 

Sample Input:
<class 'list'>
a: 1
x: 2
c: 3

Expected Output:
<class 'float'>
0.12579440923099774

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Ut excepturi dolorum aspernatur voluptas iste ipsa blanditiis, ratione distinctio mollitia, illo tenetur cum, aut atque doloremque accusantium asperiores. Explicabo impedit odio eligendi omnis nisi aspernatur debitis quos quae minus officiis, aspernatur labore corporis dicta natus deserunt provident odio recusandae? Dolores sit recusandae nostrum tempore eum quasi libero quas dolor, voluptatum aliquam illo deserunt, animi architecto sit ducimus, praesentium assumenda sequi nemo voluptas expedita, porro distinctio perspiciatis voluptatibus earum voluptatem voluptates ipsum accusamus atque ut.

Laudantium ipsum animi fuga repellendus harum porro sint, at voluptas illo libero laudantium non beatae modi ratione, totam quis deserunt est accusantium inventore veritatis? Omnis id vero? Ea autem ab voluptatum, sed ut repellendus? Sapiente distinctio labore eveniet quod ex, quas aut ipsum delectus veniam assumenda repellat veritatis quisquam modi alias, fuga eius neque excepturi, ex provident veniam, excepturi sequi molestias quod odit corrupti?

Quo at vel eligendi dolor beatae odio dolores, autem atque optio maiores excepturi amet beatae incidunt quas officiis eos, corporis dolor error eum quibusdam unde doloribus.

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

Ready.

Input Test Case

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