✔ 最佳答案
設第 x 個停止
P(x)
= (第x個必為1~8號球其中一個) * (前x-1個選取與排列數) / P(50,x)
= 8 * C(42,x-8) * (x-1)! / P(50,x)
= 8 * { 42! / [ (x-8)! * (50-x)! ] } * (x-1)! * [ (50-x)! / 50! ]
= 8 * 42! * (x-1)! / [ (x-8)! * 50! ]
= 8 * (x-1)(x-2)*.....*(x-7) / (50*49*.....*43)
x*P(x) = 8*x(x-1)(x-2)*.....*(x-7) / (50*49*.....*43)
所求期望值
= Σ x*P(x) , from x=8 to x=50
= Σ [ 8*x(x-1)(x-2)*.....*(x-7) / (50*49*.....*43) ] , from x=8 to x=50
Σ 的公式一般只有計算到3次方, 也就是 Σ x^3 ; 但此題為8次方,
故以下用 Excel VBA 程式計算, 程式碼如下:
-----------------------------------------------------------------
Sub my_combination()
S = 0
For x = 8 To 50
P = 1
For i = 0 To 7
P = P * (x - i) / (50 - i)
Next
S = S + 8 * P
Next
[A1] = S
End Sub
-----------------------------------------------------------------
計算結果 = 45.33333..... = 45 1/3
Ans: 45 1/3