当前位置:   article > 正文

二项分布期望和方差的推导及推广_二项分布的期望和方差推导

二项分布的期望和方差推导

一、二项分布基础内容

如果不想看复杂的推导过程,请点这里

众所周知,两点分布的分布列为:

X10
Pp1-p

而二项分布可以看为将 n n n 次两点分布的结果累加起来,其分布列为 P ( X = k ) = C n k p k ( 1 − p ) n − k P\left(X=k\right)=C_n^kp^k\left(1-p\right)^{n-k} P(X=k)=Cnkpk(1p)nk.

1、期望

E ( X ) = ∑ k = 0 n k C n k p k ( 1 − p ) n − k E\left(X\right)=\sum\limits_{k=0}^n kC_n^kp^k\left(1-p\right)^{n-k} E(X)=k=0nkCnkpk(1p)nk
累加的式子中存在 k C n k kC_n^k kCnk,考虑把 k k k 变为常数进行运算。
k C n k = k n ! k ! ( n − k ) ! = n ( n − 1 ) ! ( k − 1 ) ! ( n − k ) ! = n C n − 1 k − 1 kC_n^k=k\frac{n!}{k!\left(n-k\right)!}=n\frac{\left(n-1\right)!}{\left(k-1\right)!\left(n-k\right)!}=nC_{n-1}^{k-1} kCnk=kk!(nk)!n!=n(k1)!(nk)!(n1)!=nCn1k1
这时我们还要考虑 C n − 1 k − 1 C_{n-1}^{k-1} Cn1k1 k = 0 k=0 k=0 时无意义的情况,因此累加时要从 k = 1 k=1 k=1 开始,并加上 k = 0 k=0 k=0 时的第一项 0 0 0.
E ( X ) = ∑ k = 1 n n C n − 1 k − 1 p k ( 1 − p ) n − k E\left(X\right)=\sum\limits_{k=1}^n nC_{n-1}^{k-1} p^k\left(1-p\right)^{n-k} E(X)=k=1nnCn1k1pk(1p)nk
使用二项式定理合并:
E ( X ) = n p ∑ k = 1 n C n − 1 k − 1 p k − 1 ( 1 − p ) n − k E\left(X\right)=np\sum\limits_{k=1}^nC_{n-1}^{k-1}p^{k-1}\left(1-p\right)^{n-k} E(X)=npk=1nCn1k1pk1(1p)nk E ( X ) = n p ∑ k = 0 n − 1 C n − 1 k p k ( 1 − p ) n − 1 − k E\left(X\right)=np\sum\limits_{k=0}^{n-1}C_{n-1}^kp^k\left(1-p\right)^{n-1-k} E(X)=npk=0n1Cn1kpk(1p)n1k E ( X ) = n p ( p + 1 − p ) n − 1 E\left(X\right)=np\left(p+1-p\right)^{n-1} E(X)=np(p+1p)n1 E ( X ) = n p E\left(X\right)=np E(X)=np

2、方差

先推导一个计算方差的公式: D ( X ) = E ( X 2 ) − E 2 ( X ) D\left(X\right)=E\left(X^2\right)-E^2\left(X\right) D(X)=E(X2)E2(X).
D ( X ) = ∑ i = 1 n [ x i − E ( X ) ] 2 p i D\left(X\right)=\sum\limits_{i=1}^n \left[x_i-E\left(X\right)\right]^2p_i D(X)=i=1n[xiE(X)]2pi D ( X ) = ∑ i = 1 n [ x i 2 − 2 x i E ( X ) + E 2 ( X ) ] p i D\left(X\right)=\sum\limits_{i=1}^n \left[x_i^2-2x_iE\left(X\right)+E^2\left(X\right)\right]p_i D(X)=i=1n[xi22xiE(X)+E2(X)]pi D ( X ) = ∑ i = 1 n [ x i 2 p i − 2 x i p i E ( X ) + p i E 2 ( X ) ] D\left(X\right)=\sum\limits_{i=1}^n \left[x_i^2p_i-2x_ip_iE\left(X\right)+p_iE^2\left(X\right)\right] D(X)=i=1n[xi2pi2xipiE(X)+piE2(X)] D ( X ) = ∑ i = 1 n x i 2 p i − 2 E ( X ) ∑ i = 1 n x i p i + E 2 ( X ) ∑ i = 1 n p i D\left(X\right)=\sum\limits_{i=1}^n x_i^2p_i -2E\left(X\right)\sum\limits _{i=1}^n x_ip_i +E^2\left(X\right)\sum\limits_{i=1}^n p_i D(X)=i=1nxi2pi2E(X)i=1nxipi+E2(X)i=1npi D ( X ) = E ( X 2 ) − 2 E 2 ( X ) + E 2 ( X ) D\left(X\right)=E\left(X^2\right)-2E^2\left(X\right)+E^2\left(X\right) D(X)=E(X2)2E2(X)+E2(X) D ( X ) = E ( X 2 ) − E 2 ( X ) D\left(X\right)=E\left(X^2\right)-E^2\left(X\right) D(X)=E(X2)E2(X)
由于 D ( X ) = E { [ X − E ( X ) ] 2 } D\left(X\right)=E\left\{\left[X-E\left(X\right)\right]^2\right\} D(X)=E{[XE(X)]2},也可以这样推导:
D ( X ) = E [ X 2 − 2 X E ( X ) + E 2 ( X ) ] D\left(X\right)=E\left[X^2-2XE\left(X\right)+E^2\left(X\right)\right] D(X)=E[X22XE(X)+E2(X)] D ( X ) = E ( X 2 ) − 2 E ( X ) E ( X ) + E 2 ( X ) D\left(X\right)=E\left(X^2\right)-2E\left(X\right)E\left(X\right)+E^2\left(X\right) D(X)=E(X2)2E(X)E(X)+E2(X) D ( X ) = E ( X 2 ) − E 2 ( X ) D\left(X\right)=E\left(X^2\right)-E^2\left(X\right) D(X)=E(X2)E2(X)
利用这个公式,我们可以先求出 E ( X 2 ) E\left(X^2\right) E(X2),再算出 D ( X ) D\left(X\right) D(X).
E ( X 2 ) = ∑ k = 0 n k 2 C n k p k ( 1 − p ) n − k E\left(X^2\right)=\sum\limits_{k=0}^n k^2C_n^kp^k\left(1-p\right)^{n-k} E(X2)=k=0nk2Cnkpk(1p)nk
跟前面一样,我们要把 k 2 k^2 k2 代换掉。
k 2 C n k = k n C n − 1 k − 1 = n ( k − 1 ) C n − 1 k − 1 + n C n − 1 k − 1 = n ( n − 1 ) C n − 2 k − 2 + n C n − 1 k − 1 k^2C_n^k=knC_{n-1}^{k-1}=n\left(k-1\right)C_{n-1}^{k-1}+nC_{n-1}^{k-1}=n\left(n-1\right)C_{n-2}^{k-2}+nC_{n-1}^{k-1} k2Cnk=knCn1k1=n(k1)Cn1k1+nCn1k1=n(n1)Cn2k2+nCn1k1
同样考虑到 C n − 2 k − 2 C_{n-2}^{k-2} Cn2k2 k = 0 k=0 k=0 k = 1 k=1 k=1 时无意义,我们可以把第一、二项单独拿出来计算。
E ( X 2 ) = C n 1 p ( 1 − p ) n − 1 + ∑ k = 2 n n ( n − 1 ) C n − 2 k − 2 p k ( 1 − p ) n − k + ∑ k = 2 n n C n − 1 k − 1 p k ( 1 − p ) n − k E\left(X^2\right)=C_n^1p\left(1-p\right)^{n-1}+\sum\limits_{k=2}^n n\left(n-1\right)C_{n-2}^{k-2}p^k\left(1-p\right)^{n-k} +\sum\limits_{k=2}^n nC_{n-1}^{k-1}p^k\left(1-p\right)^{n-k} E(X2)=Cn1p(1p)n1+k=2nn(n1)Cn2k2pk(1p)nk+k=2nnCn1k1pk(1p)nk
为了使用二项式定理合并,我们还需要继续拆项。
E ( X 2 ) = n p ( 1 − p ) n − 1 + n ( n − 1 ) p 2 ∑ k = 2 n C n − 2 k − 2 p k − 2 ( 1 − p ) n − k + ∑ k = 1 n n C n − 1 k − 1 p k ( 1 − p ) n − k − n C n 0 p ( 1 − p ) n − 1 E\left(X^2\right)=np\left(1-p\right)^{n-1}+n\left(n-1\right)p^2\sum\limits_{k=2}^n C_{n-2}^{k-2}p^{k-2}\left(1-p\right)^{n-k}+\sum\limits_{k=1}^n nC_{n-1}^{k-1}p^k\left(1-p\right)^{n-k}-nC_n^0p\left(1-p\right)^{n-1} E(X2)=np(1p)n1+n(n1)p2k=2nCn2k2pk2(1p)nk+k=1nnCn1k1pk(1p)nknCn0p(1p)n1 E ( X 2 ) = n p ( 1 − p ) n − 1 + n ( n − 1 ) p 2 ∑ k = 0 n − 2 C n − 2 k p k ( 1 − p ) n − 2 − k + ∑ k = 1 n n C n − 1 k − 1 p k ( 1 − p ) n − k − n p ( 1 − p ) n − 1 E\left(X^2\right)=np\left(1-p\right)^{n-1}+n\left(n-1\right)p^2\sum\limits_{k=0}^{n-2} C_{n-2}^kp^k\left(1-p\right)^{n-2-k}+\sum\limits_{k=1}^n nC_{n-1}^{k-1}p^k\left(1-p\right)^{n-k}-np\left(1-p\right)^{n-1} E(X2)=np(1p)n1+n(n1)p2k=0n2Cn2kpk(1p)n2k+k=1nnCn1k1pk(1p)nknp(1p)n1 E ( X 2 ) = n ( n − 1 ) p 2 ( p + 1 − p ) n − 2 + n p ( p + 1 − p ) n − 1 E\left(X^2\right)=n\left(n-1\right)p^2\left(p+1-p\right)^{n-2}+np\left(p+1-p\right)^{n-1} E(X2)=n(n1)p2(p+1p)n2+np(p+1p)n1 E ( X 2 ) = n ( n − 1 ) p 2 + n p E\left(X^2\right)=n\left(n-1\right)p^2+np E(X2)=n(n1)p2+np
带入开头的公式中即可得到方差:
D ( X ) = n 2 p 2 − n p 2 + n p − n 2 p 2 D\left(X\right)=n^2p^2-np^2+np-n^2p^2 D(X)=n2p2np2+npn2p2 D ( X ) = n p ( 1 − p ) D\left(X\right)=np\left(1-p\right) D(X)=np(1p)

3、较为简洁的推导方法

在推导方差的公式时,我们可以利用期望和方差的性质,十分简洁地把公式推出来。

  1. 期望的乘法:当 X i X_i Xi 两两相互独立时,若 X = ∏ i = 1 n X i X=\prod\limits_{i=1}^n X_i X=i=1nXi,则 E ( X ) = ∏ i = 1 n E ( X i ) E\left(X\right)=\prod\limits_{i=1}^n E\left(X_i\right) E(X)=i=1nE(Xi).
  2. 方差的加法:当 X i X_i Xi 两两相互独立时,若 X = ∑ i = 1 n X i X=\sum\limits_{i=1}^n X_i X=i=1nXi,则 D ( X ) = ∑ i = 1 n D ( X i ) D\left(X\right)=\sum\limits_{i=1}^n D\left(X_i\right) D(X)=i=1nD(Xi).

由于在二项分布的大前提下, X i X_i Xi 两两相互独立,所以 D ( X ) = n D ( X i ) = n p ( 1 − p ) D\left(X\right)=nD\left(X_i\right)=np\left(1-p\right) D(X)=nD(Xi)=np(1p).

下面是对两个性质的证明:

证明1

由于通式的证明不太好写,这里我使用数学归纳法来证明,不过道理都是一样的。

先证明 E ( X 1 X 2 ) = E ( X 1 ) E ( X 2 ) E\left(X_1X_2\right)=E\left(X_1\right)E\left(X_2\right) E(X1X2)=E(X1)E(X2)
E ( X 1 X 2 ) = ∑ i = 1 n 1 ∑ j = 1 n 2 x 1 i x 2 j p 1 i p 2 j . . . . . . . . . ① E\left(X_1X_2\right)=\sum\limits _{i=1}^{n_1} \sum\limits_{j=1}^{n_2} x_{1_i}x_{2_j}p_{1_i}p_{2_j}.........① E(X1X2)=i=1n1j=1n2x1ix2jp1ip2j.........① E ( X 1 ) E ( X 2 ) = ∑ i = 1 n 1 x 1 i p 1 i ∑ i = 1 n 2 x 2 i p 2 i . . . ② E\left(X_1\right)E\left(X_2\right)=\sum\limits_{i=1}^{n_1} x_{1_i}p_{1_i}\sum\limits_{i=1}^{n_2}x_{2_i}p_{2_i}...② E(X1)E(X2)=i=1n1x1ip1ii=1n2x2ip2i...②
①式与②式的右半边是相等的,因此得证。然后再由此进行迭乘,可归纳出原公式。

证明2

D ( X ) = E ( X 2 ) − E 2 ( X ) D\left(X\right)=E\left(X^2\right)-E^2\left(X\right) D(X)=E(X2)E2(X) D ( X ) = E [ ( ∑ i = 1 n X i ) 2 ] − [ ∑ i = 1 n E ( X i ) ] 2 D\left(X\right)=E\left[\left(\sum\limits_{i=1}^n X_i\right)^2\right]-\left[\sum\limits_{i=1}^n E\left(X_i\right)\right]^2 D(X)=E (i=1nXi)2 [i=1nE(Xi)]2 D ( X ) = E ( ∑ i = 1 n ∑ j = 1 n X i X j ) − ∑ i = 1 n ∑ j = 1 n E ( X i ) E ( X j ) D\left(X\right)=E\left(\sum\limits_{i=1}^n \sum\limits_{j=1}^n X_iX_j\right)-\sum\limits_{i=1}^n \sum\limits_{j=1}^n E\left(X_i\right)E\left(X_j\right) D(X)=E(i=1nj=1nXiXj)i=1nj=1nE(Xi)E(Xj) D ( X ) = ∑ i = 1 n ∑ j = 1 n E ( X i X j ) − ∑ i = 1 n ∑ j = 1 n E ( X i ) E ( X j ) D\left(X\right)=\sum\limits_{i=1}^n \sum\limits_{j=1}^n E\left(X_iX_j\right)-\sum\limits_{i=1}^n \sum\limits_{j=1}^n E\left(X_i\right)E\left(X_j\right) D(X)=i=1nj=1nE(XiXj)i=1nj=1nE(Xi)E(Xj) D ( X ) = ∑ i = 1 n ∑ j = 1 n [ E ( X i X j ) − E ( X i ) E ( X j ) ] D\left(X\right)=\sum\limits_{i=1}^n \sum\limits_{j=1}^n \left[E\left(X_iX_j\right)-E\left(X_i\right)E\left(X_j\right)\right] D(X)=i=1nj=1n[E(XiXj)E(Xi)E(Xj)]
对于 i = j i=j i=j 的项,我们不能使用期望的乘法公式,而其余情况均可以使用乘法公式将两项合并为 0 0 0 得:
D ( X ) = ∑ i = 1 n [ E ( X i 2 ) − E 2 ( X i ) ] D\left(X\right)=\sum\limits_{i=1}^n \left[E\left(X_i^2\right)-E^2\left(X_i\right)\right] D(X)=i=1n[E(Xi2)E2(Xi)] D ( X ) = ∑ i = 1 n D ( X i ) D\left(X\right)=\sum\limits_{i=1}^n D\left(X_i\right) D(X)=i=1nD(Xi)

二、二项分布的推广

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/一键难忘520/article/detail/748969
推荐阅读
相关标签
  

闽ICP备14008679号