Write a function to
f(x)=(1/(sqrt(2*π))*exp[-1/2*((x-m)/8)^2]
for arbitrary mean value m and standard deviation s as parameters.
- Name it as you like such that you can use it in the following:
Write a function 'myerror_function()' which
- takes four numbers as input in the order: lower integration limit, higher integration limit, mean value and standard deviation.
- Integrate the Gaussian function with the given parameters, something that can't be done analytically.
- Return the calculated integral value (including its error), noting that a manual return value using math.erf() or similar will be moderated to zero marks.
This integral represents a special mathematical function, the Error function which you can look up and researchfor instance starting with the existing error function in the Python math module, math.erf()
Write a function to
f(x)=(1/(sqrt(2*π))*exp[-1/2*((x-m)/8)^2]
for arbitrary mean value m and standard deviation s as parameters.
- Name it as you like such that you can use it in the following:
Write a function 'myerror_function()' which
- takes four numbers as input in the order: lower integration limit, higher integration limit, mean value and standard deviation.
- Integrate the Gaussian function with the given parameters, something that can't be done analytically.
- Return the calculated integral value (including its error), noting that a manual return value using math.erf() or similar will be moderated to zero marks.
This integral represents a special mathematical function, the Error function which you can look up and researchfor instance starting with the existing error function in the Python math module, math
the answer expected 0.6....
the following error to be avoided
Lower limit: ***Error*** Traceback (most recent call last): File "__tester__.python3", line 13, in print(myerror_function()) File "__tester__.python3", line 5, in myerror_function ll = float(input("Lower limit:")) EOFError: EOF when reading a line