Académique Documents
Professionnel Documents
Culture Documents
(b).
(c). R code and the corresponding output
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
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
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
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
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