# L-7.0 MCS 260 30 June 2014 : a function
"""
Evaluate the probability density function
of a normal distribution.
"""

def npdf ( arg, mean = 0, sigma = 1 ):
    "normal probability density function"
    import math
    result = math.exp(-(arg - mean)**2/(2*sigma**2))
    result = result/(sigma*math.sqrt(2*math.pi))
    return result

ARGRAW = raw_input('give x : ')
ARG = float(ARGRAW)
print 'f(', ARG , ') = ' , npdf(ARG)
MEANRAW = raw_input('give mean : ')
MEAN = float(MEANRAW)
SIGMARAW = raw_input('give standard deviation : ')
SIGMA = float(SIGMARAW)
print 'for mu = ', MEAN, 'and sigma = ', SIGMA
print 'f(', ARG , ') = ' , npdf(mean=MEAN, sigma=SIGMA, arg=ARG)

