✔ 最佳答案
for n => 3, the required event occurs iff the last 3 trials are SFF and the first n-3 trials have no consecutive F.
Let g_n be the probability that the first n trials have no consective F. Then for n => 3, we have
f_n = pq^2 g_(n-3).
Next we develop a recurrence relation for g_n. For convenience, we exclude the trivial case p=0. Note that
P(no consecutive F in n trials AND n-th trial=S)
= P(no consecutive F in n-1 trials AND n-th trial = S)
= p g_(n-1)
also
P(no consecutive F in n trials AND n-th trial=F)
= P(no consecutive F in n-2 trials AND (n-1)-th trial=S AND n-th trial = F)
= pq g_(n-2)
Hence,
g_n = p g_(n-1) + pq g_(n-2).
Solve this linear recurrence relation, we get
g_n = Aα^n + Bβ^n,
where α= (p+√(p^2+4pq))/2, β= (p-√(p^2+4pq))/2.
Put g_0 = g_1 = 1, we get
A= (1-β)/(α-β), B=(α-1)/(α-β). (Note that α≠β if p≠0)
Hence for n => 3, f_n = pq^2 (Aα^(n-3) + Bβ^(n-3))
where A,B,α,βare given as above.
E(n) = 2q^2 + Σ(n=3 to ∞) pq^2 (Aα^(n-3) + Bβ^(n-3))n
= 2q^2 + pq^2 AΣ(n=3 to ∞) nα^(n-3) + pq^2 BΣ(n=3 to ∞) nβ^(n-3)
= 2q^2 + pq^2 (A(3 - 2α)/(1-α)^2 + B(3 - 2β)/(1-β)^2)
if α<1, (note that we always have -1<β=<0)
and E(n) = ∞ if α=> 1.
Var(n) = E(n^2) - E(n)^2
E(n^2) = 4q^2 + Σ(n=3 to ∞) pq^2 (Aα^(n-3) + Bβ^(n-3))n^2
= 4q^2+pq^2(A(9-13- 4α^2))/(1-α)^3+B(9-13β-4β^2))/(1-β)^3),
and E(n) is given above. Plug in and you get the answer.