|
该问题也可用递归算法求得一般解(将“6人上6车空2车”逐步分解为“6人上3车空2车”):
记:A(n,m,r)为r人登上n节车厢并恰好空m节特定位置的车厢。m >= 0, n >= m+1, r >= n-m 为整数。并记:n中取m的组合数为C[n,m].于是所求概率p(2) = C[n,m]*A(n,m,r)/n^r。
其中:A(n,m,r)满足如下递归公式:
A(n+1,m,r) = <对k=1到r-n+m求和>{C[r,k]*A(n,m,r-k)}
具体到该问题:
A(6,2,6) = <对k=1到6-5+2=3求和>{C[6,k]*A(5,2,6-k)}
不难看出:A(3,2,k) = 1, 这里:k=1,2,3,4,5
于是可以求出:A(6,2,6) = 1560,p = 15*1560/46656 = 23400/46656 = 325/648 ~= 0.501
也可以求出空0,1,3,4,5节特定位置车厢的事件数:
A(6,0,6) = 720=6!
A(6,1,6) = 1800
A(6,3,6) = 540
A(6,4,6) = 62
A(6,5,6) = 1
由于:C[6,0] = 1, C[6,1] = 6, C[6,3] = 20, C[6,4] = 15, C[6,5] = 6
于是:
p(0) = 1*720/6^6 = 720/46656 ~= 0.015
p(1) = 6*1800/6^6 = 10800/46656 ~= 0.232
P(2) = 325/648 ~= 0.501
p(3) = 20*540/6^6 = 10800/46656 ~= 0.232
p(4) = 15*62/6^6 = 930/46656 ~= 0.020
p(5) = 6*1/6^6 = 6/46656 ~= 0.0001
验证:720+10800+23400+10800+930+6 = 46656 |
|