# Chapter1 - Standards, Units & Dimensions¶

## Exa 1.17 page 46¶

In [1]:
from __future__ import division
Y=90
X=89
Error_absolute=Y-X
print 'Absolute Error =',round(Error_absolute,2)
Error_relative=(Y-X)*100/Y
print 'Relative Error = %0.2f %%'%Error_relative
Accuracy_relative=1-Error_relative
print 'Accuracy relative =',round(Accuracy_relative,2)
Accuracy_percentage=100*Accuracy_relative
print 'Accuracy = %0.2f %%'%Accuracy_percentage

Absolute Error = 1.0
Relative Error = 1.11 %
Accuracy relative = -0.11
Accuracy = -11.11 %


## Exa 1.18 page 46¶

In [2]:
S=98+100+102+98+100+100+104+104+105+97
n=10
Avg=S/n
P=1-abs((104-Avg)/Avg)
print "Precision for the 8th reading=%.2f"%(P)

Precision for the 8th reading=0.97


## Exa 1.19 page 47¶

In [3]:
V=10
I=20*10**-3
RI=50
R=(V/I)-RI
print "The value of Resistance=%.0f ohm"%(R)
dV=0.2
dI=1*10**-3
dRI=5
dR=(dV/I)+(V*dI/I**2)+(dRI)
print "Limiting error of resistance=%.0f ohm"%(dR)

The value of Resistance=450 ohm
Limiting error of resistance=40 ohm


## Exa 1.20 page 47¶

In [4]:
R0=5
a=0.004
T=30
R=R0*(1+a*(T-20))
print "Resistance of the wire=%.1f ohm"%(R)
#Let (dR/dR0) =b   (dR/da)=c   (dR/dT)=d
b=(1+a*(T-20))
c=R0*(T-20)
d=R0*a
ur0=5*0.003
ua=0.004*0.01
ut=1
uR=(b**2*ur0**2+c**2*ua**2+d**2*ut**2)**0.5
print "Uncertanity in resistance=%.2f ohm"%(uR)

Resistance of the wire=5.2 ohm
Uncertanity in resistance=0.03 ohm


## Exa 1.21 page 47¶

In [8]:
X_mean=(15+20+25+30+35+45)/6
print "The sample mean of the temperature=%.2f degree C"%(X_mean)
Y_mean=(1.9+1.93+1.97+2+2.01+2.01+1.94+1.95+1.97+2.02+2.02+2.04)/12*10**-6
print "The sample mean of the faliure=%.6f failures/hour"%(Y_mean)
print 'from these values we get'
a=1.80*10**-6
b=0.00226
print 'Y=1.80+0.00226x is the required least square line'

The sample mean of the temperature=28.33 degree C
The sample mean of the faliure=0.000002 failures/hour
from these values we get
Y=1.80+0.00226x is the required least square line


## Exa 1.22 page 48¶

In [6]:
n=2
k=1
dof=n-k
chi_square=(3-5)**2/5+(7-5)**2/5
print 'Chi square value =',chi_square
print 'From the dof and chi square value we find P=0.22'
print 'Hence there are 22% chance that the distribution is just the result of random fluctuations and the coin may be unweighted'

Chi square value = 1.6
From the dof and chi square value we find P=0.22
Hence there are 22% chance that the distribution is just the result of random fluctuations and the coin may be unweighted


## Exa 1.23 page 48¶

In [7]:
X_mean=501*1/5
print "Assigned Value=%.1f V"%(X_mean)
sigma=((1/(5-1))*((100.2-X_mean)**2+(100.3-X_mean)**2+(100.2-X_mean)**2+(100.2-X_mean)**2+(100.1-X_mean)**2))**0.5
#print 'For 95% confidance level student factor t is 2.78'
t=2.78
n=5
Ur=t*sigma/(n**0.5)
print "Uncertanity=%.3f V"%(Ur)

Assigned Value=100.2 V
Uncertanity=0.088 V