Sci Primer Exercise 1.10 - Gaussian

PHOTO EMBED

Fri Jan 12 2024 20:38:21 GMT+0000 (Coordinated Universal Time)

Saved by @cnygren #python

"""
Exercise 1.10: Evaluate a Gaussian Function
"""

from math import pi, exp, sqrt

m = 0
s = 2
x = 1

y = (1 / (sqrt(2 * pi) * s)*exp((-1/2) * (((x - m)/s) ** 2)))
print(y)

'''
Sample run:
    y = 0.176032663
'''
    
content_copyCOPY