Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

qstn4

January 24, 2018

In [1]: import numpy as np

In [6]: x=np.array([0.8920,0.881,0.8913,0.9837,0.8958])
sigma=np.array([0.00044,0.009,0.00032,0.00048,0.00045])

In [7]: sigma2=sigma**2

In [8]: sigma2

Out[8]: array([ 1.93600000e-07, 8.10000000e-05, 1.02400000e-07,


2.30400000e-07, 2.02500000e-07])

In [11]: c=0
for i in range(len(x)-1):
c+=x[i]/sigma2[i]
c

Out[11]: 17591947.3722388

In [12]: d=0
for i in range(len(x)-1):
d+=1/sigma2[i]
d

Out[12]: 19283537.712988466

In [13]: xmean=c/d
xmean

Out[13]: 0.91227800801248771

In [14]: e=0
for i in range(len(x)-1):
e+=(x[i]-xmean)**2
s=np.sqrt(e/(len(x)-1))

In [15]: s

1
Out[15]: 0.041625380340064258

In [16]: print(s)

0.0416253803401

In [21]: uMean=s/np.sqrt(len(x))
print('the weighted mean lifetime is',xmean, 'and uncertainty of the mean is ',uMean)

the weighted mean lifetime is 0.912278008012 and uncertainty of the mean is 0.0186154360059

You might also like