From 8e89de9a0e45ee04957ceb8e1e976de803f6d50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Wed, 30 Aug 2017 01:38:21 +0200 Subject: [PATCH] Create gaussian1.py --- misc/challenges/gaussian1.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 misc/challenges/gaussian1.py diff --git a/misc/challenges/gaussian1.py b/misc/challenges/gaussian1.py new file mode 100644 index 0000000..72ffc59 --- /dev/null +++ b/misc/challenges/gaussian1.py @@ -0,0 +1,8 @@ +import math + +def f(m, s, x): + fraction = 1/(math.sqrt(2*math.pi)*s) + brackets = -(1.0/2.0)*((x-m)/s)**2 + return fraction*math.exp(brackets) + +print f(0.0, 2.0, 1.0)