Vous êtes sur la page 1sur 18

Math 1131 Solution of Assignment 3

Question 6.18 (3pts)

Question 6.20 (3pts)

Question 6.24 (3pts)


Question 6.33 (3pts)

Question 6.36 (3pts)

Question 6.44 (3pts)


Question 6.49 (3pts)

Question 6.55 (3pts)

Question 6.62 (3pts)


Question 6.63 (3pts)

Question 6.80 (5pts)

(a). R code and corresponding output.

(b).
(c). R code and the corresponding output

Question 6.90 (3pts)


Question 6.94 (3pts)

Question 6.104 (3pts)

Question 7.21 (3pts)


Question 7.22 (3pts)
Question 7.34 (3pts)
Question 7.50 (3pts)

Question 7.52 (3pts)


Question 7.74 (3pts)

Question 7.75 (3pts)


Question 8.26 (3pts)

Question 8.30 (3pts)

Question 8.38 (3pts)

Question 8.39 (3pts)


Question 8.49 (3pts)

Question 8.78 (3pts)


Question 8.81 (3pts)

Question 8.102 (3pts)


Question (8pts):
Use R programming to demonstrate Central limit theorem. Generate n random sample of Poisson distribution,
and compare the distribution of original Poisson and the sample mean. What do you observe? Vary n from 1,
to 3, 5, 10 and 20. Compare the distribution curve of the sample means at different sample size. (For sample
code, refer to course website.)
Answer:
For n=1,

x<-rpois(1000, 3) ####x is a vector of 1000 r.v from exponential distribution with lambda (=3)
hist(x) #### unsymmetrical, nothing like normal.

Histogram of x
200
150
Frequency

100
50
0

0 2 4 6 8 10

it is not like normal.


For n=3,

x1<-rpois(1000, 3)
x2<-rpois(1000,3)
x3<-rpois(1000,3)
y<-(x1+x2+x3)/3
hist(y,breaks=15) ### what happened to the distribution of y?

1
Histogram of y
250
200
150
Frequency

100
50
0

0 2 4 6 8

it is better, but is not perfect.


For n=5,

x1<-rpois(1000, 3)
x2<-rpois(1000,3)
x3<-rpois(1000,3)
x4<-rpois(1000,3)
x5<-rpois(1000,3)
y<-(x1+x2+x3+x4+x5)/5
hist(y,breaks=15) ## does the curve become more bell shaped?

2
Histogram of y
300
200
Frequency

50 100
0

1 2 3 4 5 6

it is not lika normal distribution.


For n=10,

x1<-rpois(1000, 3)
x2<-rpois(1000,3)
x3<-rpois(1000,3)
x4<-rpois(1000,3)
x5<-rpois(1000,3)
x6<-rpois(1000, 3)
x7<-rpois(1000,3)
x8<-rpois(1000,3)
x9<-rpois(1000,3)
x10<-rpois(1000,3)
y<-(x1+x2+x3+x4+x5+x6+x7+x8+x9+x10)/10
hist(y,breaks=15)

3
Histogram of y
150
100
Frequency

50
0

2 3 4 5

the histogram becomes more close to normal.


For n=10,

x1<-rpois(1000, 3)
x2<-rpois(1000,3)
x3<-rpois(1000,3)
x4<-rpois(1000,3)
x5<-rpois(1000,3)
x6<-rpois(1000, 3)
x7<-rpois(1000,3)
x8<-rpois(1000,3)
x9<-rpois(1000,3)
x10<-rpois(1000,3)
x11<-rpois(1000, 3)
x12<-rpois(1000,3)
x13<-rpois(1000,3)
x14<-rpois(1000,3)
x15<-rpois(1000,3)
x16<-rpois(1000,3)
x17<-rpois(1000,3)
x18<-rpois(1000,3)
x19<-rpois(1000,3)
x20<-rpois(1000,3)
y<-(x1+x2+x3+x4+x5+x6+x7+x8+x9+x10+x11+x12+x13+x14+x15+x16+x17+x18+x19+x20)/20
hist(y,breaks=15)

4
Histogram of y
150
Frequency

100
50
0

1.5 2.0 2.5 3.0 3.5 4.0 4.5

It looks much better as bell shaped.

Vous aimerez peut-être aussi