5 随机变量及其分布
1.par(mar=c(4,4,2,1)+0.2,cex=0.8)
2.n=20;p=0.5
3.x=1:5
4.P=choo(n,x)*p^x*(1-p)^(n-x)
5.plot(x,P,'h')
6.
7.n=10;p=0.5
8.x=0:10
9.dbinom(x,n,p)
12.
13.N=100;M=5;n=10
14.x=1:5
15.P=choo(M,x)*choo(N-M,n-x)/choo(N,n)
16.plot(x,P,'h')
17.
18.lamda=6
19.x=0:5
20.P=lamda^x*exp(-lamda)/factorial(x)
21.plot(x,P,'h')
22.
23.x=0:1;y=c(1,1)
24.plot(x,y,ylim=c(0,1.5),type='l')
25.
26.x=q(-4,4,0.1)
27.y=1/sqrt(2*pi)*exp(-x^2/2)
28.plot(x,y,type='l')
29.
30.a=qnorm(0.95);a
31.
动物园的英文32.x0=4
33.z=q(-2,2,0.1)
34.x=q(-x0,x0,0.1)
35.plot(x,dnorm(x),xlim=c(-x0,x0),ylim=c(0,0.5),type="l",xlab="x",ylab="p(x)")
36.abline(h=0,lty=3)
情感漫画
37.
38.a=160
39.Za=(a-mean(UG$height))/sd(UG$height);Za新闻报道英文
竹粉多少钱一吨40.Pa=pnorm(Za);Pa
41.b=180
42.Zb=(mean(b-UG$height))/sd(UG$height);Zb
43.Pb=1-pnorm(Zb);Pb
44.P=1-Pa-Pb;P
45.
46.x=0:50
47.y=0.3*exp(-0.3*x)
48.plot(x,y,type='l')
肾功能检查哪些项目49.
<(10)
51.y0=dnorm(0);y0 #y=1/sqrt(2*pi)*exp(0)
52.dnorm(1)== exp(-1/2)/sqrt(2*pi)
53.y1=dnorm(1);y1 #y1=1/sqrt(2*pi*exp(1))
54.p1=pnorm(-1.96);p1
肠粉是怎么做的
55.p2=pnorm(1.96);p2
56.q1=qnorm(0.05);q1
57.q2=qnorm(0.95);q2
58.
59.rbinom(10,1,0.5)
60.rbinom(10,5,0.35)
61.
62.par(mfrow=c(1,3))
63. p=0.25
64.for(n in c(10,20,50)){
65. x=rbinom(100,n,p)
锥体体积公式
66. hist(x,prob=T,main=paste("n =",n))
什么是节气67. xn=0:n
68. points(xn,dbinom(xn,n,p),type="h",lwd=3)
69.}
70.par(mfrow=c(1,1))
71.
72.rhyper(15,10,5,3)
73.
74.m=10; n=7; k=8
<=rhyper(15,m,n,k);rx
76.x=0:(k+1)
77.px=phyper(x,m,n,k)
78.dx=dhyper(x,m,n,k)
79.cbind(px,dx)
80.
81.par(mfrow=c(1,3))
82. m=10;n=5;k=3