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

QUESTION 4

January 24, 2018

In [1]: import numpy as np

In [2]: lt=np.array([0.8920,0.881,0.8913,0.9837,0.8958])

In [3]: sigma=np.array([0.00044,0.009,0.00032,0.00048,0.00045])

In [4]: sigmasq=sigma**2

In [5]: sigmasq

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


2.30400000e-07, 2.02500000e-07])

In [9]: num=0
for i in range(len(lt)-1):
num+=lt[i]/sigmasq[i]

In [10]: num

Out[10]: 17591947.3722388

In [11]: den=0
for i in range(len(lt)-1):
den+=1/sigmasq[i]

In [12]: den

Out[12]: 19283537.712988466

In [13]: ltmean=num/den

In [14]: ltmean

Out[14]: 0.91227800801248771

In [15]: E=0
for i in range(len(lt)-1):
E+=(lt[i]-ltmean)**2
s=np.sqrt(E/(len(lt)-1))

1
In [16]: s

Out[16]: 0.041625380340064258

In [17]: unctymean=s/np.sqrt(len(lt))

In [18]: unctymean

Out[18]: 0.018615436005933399

In [19]: print('The weighted mean lifetime of K Meson is',ltmean, 'and uncertainty of the mean

The weighted mean lifetime of K Meson is 0.912278008012 and uncertainty of the mean is 0.01861

You might also like