10 Lois usuelles
1.
2.
3.
4.
1.
Code:
vect<-seq(-5,5,by=0.01)
plot(vect,dnorm(vect,0,1),type='l')
lines(vect,dnorm(vect,1,1),type='l',col='red')
lines(vect,dnorm(vect,-0.4,1),type='l',col='green')
2.
Code:
x11()
plot(vect,dnorm(vect,0,1),type='l')
lines(vect,dnorm(vect,0,1.4),type='l',col='red')
lines(vect,dnorm(vect,0,0.8 ),type='l',col='green')
3.
Code:
x<-seq(0,10,by=0.01)
plot(x,dchisq(x,2),type='l')
lines(x,dchisq(x,3),type='l',col='red')
lines(x,dchisq(x,4),type='l',col='green')
4.
Code:
k<-seq(0,20)
prob=dbinom(k,20,0.8 )
plot(k,prob)
Code:
rbinom(20,1,0.55)
[1] 0 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 1 1 0 1
b=rbinom(20,1,0.55)
mean(b)
[1] 0.75
b1=rbinom(200,1,0.55)
mean(b1)
[1] 0.545
X=runif(50, min=0, max=1)
Y=runif(50, min=0, max=1)
Z=X^2+Y^2
Z[Z<1]=1
Z[Z>1]=0
Z
mean(Z)*4
[1] 3.44