def cauchy_arith_mean():

 """calculates 5 arithmetic means of cauchy r.v.s from
    subsequent samples of sizes ns =10^2 ... 10^7, and then
    corresponding means for a normal distribution  
 """
 import numpy as np
    
 pi=np.arccos(-1.)
 pi2=0.5*pi

 for i in range(2,8):
   ns=10**i

   for j in range(1,6): 
     dist=pi*np.random.uniform(size=ns)-pi2
     y=np.tan(dist)
     print('Cauchy with N = ',ns,' arithmetic mean = ',np.sum(y)/ns)
   print
 for i in range(2,8):
   ns=10**i

   for j in range(1,6): 
     y=np.random.normal(size=ns)
     print('Normal with N = ',ns,' arithmetic mean = ',np.sum(y)/ns)
   print
     
