In: Statistics and Probability
a) Using the programming tool of your choice generate 10 random numbers from a flat distribution between -0.5 and 0.5, and find the mean of these 10 numbers. Consider this mean to be the ‘result’ of this procedure.
b) Repeat this 10 times and calculate the mean and variance of your 10 results. Is the distance of the mean from 0 about what you would expect? Why?
c) Now repeat it 100 times and calculate the mean and variance. Is the distance of the mean from 0 still about what you would expect? Did the variance change in a way you would expect? Why? d) Make a histogram of the 100 results. What probability distribution does this distribution approximately represent? In answering this, write down a PDF (probability density function) that has all the correct numbers inserted into the parameters.
> x=runif(10,-0.5,0.5)
> x
[1] -0.490363404 0.348068496 0.138656771 -0.328779807
0.006488728
[6] -0.126597469 -0.498241027 -0.152921783 0.084165724
0.288930616
> m1=mean(x)
> m1
[1] -0.07305932
> var1= var(x)
> var1
[1] 0.09042402
B>
x1
[1] -0.1866809 0.1909184 -0.4338118 0.3761250 -0.1826577
-0.4497432
[7] 0.1390563 0.2080083 -0.1675341 -0.4834929
> m1
[1] -0.09898124
> v1
[1] 0.09589549
> x2
[1] 0.33187778 0.01624715 -0.26635480 0.30001052 0.48500887
-0.04403795
[7] 0.13173652 0.32457166 0.44200486 0.34026667
> m2
[1] 0.2061331
> v2
[1] 0.05749703
> x3
[1] -0.1347885104 -0.1209973751 0.3781851032 -0.4664954683
0.2395965965
[6] 0.3668149994 0.0005511267 -0.1764050331 0.2646192391
0.3953221578
> m3
[1] 0.07464028
> v
[1] 0.08745782
> x4
[1] -0.40790985 -0.25225884 0.13365665 -0.42369367 -0.08633562
0.04643698
[7] 0.31059287 -0.26709281 0.05628031 0.43955262
> m4
[1] -0.04507714
> v4
[1] 0.08676407
> x5
[1] 0.28984900 -0.06435549 -0.08638952 -0.28594995 0.17374148
-0.23930045
[7] -0.27873491 0.47308740 -0.16950281 0.32333410
> m5
[1] 0.01357789
> v5
[1] 0.07753031
> x6
[1] -0.13932789 0.11176314 -0.17592212 -0.28039434 0.37191329
-0.33711409
[7] -0.33538941 0.05103609 -0.27123732 0.47480370
> m6
[1] -0.0529869
> v6
[1] 0.08660679
> x7
[1] -0.19440053 -0.22844037 0.23449696 -0.33408029 -0.01023239
-0.25766791
[7] -0.31922620 0.02548788 0.22777304 -0.20365264
> m7
[1] -0.1059942
> v7
[1] 0.04518163
> x8
[1] 0.10571914 -0.02717949 -0.24198434 -0.37904164 -0.19682458
0.34945250
[7] -0.06329240 -0.43510142 0.15806861 -0.15669135
> m8
[1] -0.0886875
> v8
[1] 0.0599115
> x9
[1] -0.1986665 0.4309229 0.2837357 -0.4246659 0.2827813
-0.4981147
[7] -0.1948803 -0.2608932 0.2481013 0.1114803
> m9
[1] -0.02201991
> v9
[1] 0.1099189
> x10
[1] -0.39255855 0.41162712 0.39555828 -0.23002292 0.18571689
-0.15123000
[7] 0.12816754 -0.08395029 0.10653130 0.02241632
> m10
[1] 0.03922557
> v10
[1] 0.06780187
The histogram for the means of the above 10 random samples is as shown below
This follows a Normal distribution as per CLT.
with mean =0
variance=0.077456541 |
End of answer!!