# 數學問題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) 的最小期望值為多少?

謝謝解答。

### 3 Answers

- 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.

[0] E0 = (1+Eh)/2 + (1+Et)/2

Also [1] Et=E0

E0 = (1+Eh)/2 + (1+E0)/2

2E0=1+Eh+1+E0

E0=2+Eh

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:

[2] Ehh=Eh

Eh = (1+Ehh)/2 + (1+Eht)/2

E0-2 = (1+E0-2)/2 + (1+Eht)/2

2E0-4=E0-1+1+Eht

E0=4+Eht

[3] E0 = 4 + Eht

Now proceeding as before, after HT we'll expect Ehth or Ehtt:

[4] 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:

[5] Ehtt = 0

[6] Ehth = Eh = E0 - 2

Hence combing [4], [5], [6]:

[7] Eht = (1+E0-2)/2 + 1/2

And substituting [7] into [4]:

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 補充：

http://www2.bc.edu/~rosen/public/CoinFlips.pdf

最general

Source(s): http://discuss.techinterview.org/default.asp?inter... http://www2.bc.edu/~rosen/public/CoinFlips.pdf - Wan ChakLv 51 decade ago
total possible output

= 2x2x2

= 8

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.