數學問題2: 概率的Expected value
原題為: What is the expected minimum number of coin tosses you would need to make in order to get HTT ( head, then tail, then another tail)?
在"摘公字"(coin toss)中, 要連續摘出公,字,字( 即H,T,T) 的最小期望值為多少?
- myisland8132Lv 71 decade agoFavorite Answer
For notation, call Ex the expected number of throws required to finish the game from position x. Thus E0 is the expected game length starting from scratch, Eh is the expected number of throws remaining after throwing an H, and Eht The expected number of throws after throwing an HT, and so on.
-- Regarding the HTT game --
At the beginning, we expect that E0 throws remain, and the value of E0 is what we need to find. After one throw either Eh or Et throws to remain, with a .5 chance of each possibility.
 E0 = (1+Eh)/2 + (1+Et)/2
Also  Et=E0
E0 = (1+Eh)/2 + (1+E0)/2
Now proceeding similarly, one throw after being in position H we will wind up in HH or HT. And for the HTT game, we can note that note that Ehh is the same as E0:
Eh = (1+Ehh)/2 + (1+Eht)/2
E0-2 = (1+E0-2)/2 + (1+Eht)/2
 E0 = 4 + Eht
Now proceeding as before, after HT we'll expect Ehth or Ehtt:
 Eht = (1+Ehth)/2 + (1+Ehtt)/2
And since HTT is the end of the game, and HTH puts us right back at the beginning:
 Ehtt = 0
 Ehth = Eh = E0 - 2
Hence combing , , :
 Eht = (1+E0-2)/2 + 1/2
And substituting  into :
E0 = 4 + (E0-1)/2 + 1/2
2E0 = 8 + E0 - 1 + 1
E0 = 8
Thus the HTT game requires, on average, 8 throws to complete.
2008-05-14 23:57:31 補充：
最generalSource(s): http://discuss.techinterview.org/default.asp?inter... http://www2.bc.edu/~rosen/public/CoinFlips.pdf
- Wan ChakLv 51 decade ago
total possible output
HTT is 1 of the output.
therefore, possibility of getting HTT is 1/8
thus, the expected value to get HTT is 8.
That is, we EXPECT to get at least one HTT if we toss the coin 8 times.
- 1 decade ago