返回题库

硬币配对 V

Coin Pair V

专题
Probability / 概率
难度
L4

题目详情

你先抛 4 枚公平硬币并观察结果(注意:这次初始抛掷不计入动作次数)。

之后每一步你要选定任意两枚硬币:

  • 其中一枚你可以直接翻面(正变反、反变正),
  • 另一枚必须“再抛一次”(随机变正/反)。

即每步会发生 2 次硬币动作(一次翻面、一次重掷)。即使你已经有 3 个正面,也必须继续执行上述两动作。

你会一直做下去直到 4 枚全为正面为止。问:所需硬币动作次数的期望是多少?

You flip 44 fair coins and observe the outcomes. After seeing the outcomes, you select any pair of coins to reconsider. From the pair, one coin can be turned over while the other must be flipped again. If you already have 33 heads, you still must perform both actions. You iterate this process until you end up with all 44 coins being heads. A movement of a coin is when you either turn over or flip it. Find the expected number of coin movements needed to obtain 44 heads.

Note: the initial flip of the 44 coins doesn't count to coin movements.

解析

eie_i 为当前有 ii 个正面时,到达 4 个正面还需要的期望动作次数(每次操作算 2 个动作)。

e4=0e_4=0

  • i=3i=3:选 1 个反面 + 1 个正面。翻反面使其变正,重掷另一枚正面:以 1/21/2 回到 3 个正面,以 1/21/2 到 4 个正面。
e3=2+12e3+12e4e3=4.e_3=2+\frac12 e_3+\frac12 e_4\Rightarrow e_3=4.
  • i=2i=2:选两枚反面。翻其中一枚变正,重掷另一枚反面:以 1/21/2 到 4 个正面、以 1/21/2 到 3 个正面。
e2=2+12e4+12e3=4.e_2=2+\frac12 e_4+\frac12 e_3=4.
  • i=1i=1:选两枚反面。翻一枚变正,重掷另一枚:以 1/21/2 到 3 个正面、以 1/21/2 到 2 个正面。
e1=2+12e3+12e2=6.e_1=2+\frac12 e_3+\frac12 e_2=6.
  • i=0i=0:选两枚反面。翻一枚变正,重掷另一枚:以 1/21/2 到 2 个正面、以 1/21/2 到 1 个正面。
e0=2+12e2+12e1=7.e_0=2+\frac12 e_2+\frac12 e_1=7.

初始正面数 XBinomial(4,1/2)X\sim\mathrm{Binomial}(4,1/2),因此期望动作数为

E[eX]=7116=4.4375.\mathbb{E}[e_X]=\frac{71}{16}=4.4375.

Original Explanation

Let TT be the total number of coin flips needed and XX be the total number of heads that appear on the first flipping of the coins. Then E[T]=E[E[TX]]=k=04E[TX=k]P[X=k]\mathbb{E}[T] = \mathbb{E}[\mathbb{E}[T \mid X]] = \sum_{k=0}^{4}\mathbb{E}[T \mid X =k]\mathbb{P}[X = k] by Law of Total Expectation. XBinom(4,12)X \sim \text{Binom}\left(4,\dfrac{1}{2}\right) because XX counts the number of heads appearing in 44 flips of a fair coin. To set our notation, let eie_i represent the additional number of flips needed to stop our process once we have ii heads.

If X=4X = 4, then we get 4 heads, so E[TX=4]=4\mathbb{E}[T \mid X = 4] = 4. This would mean e4=0e_4 = 0.

If X=3X = 3, then we would consider one heads and one tails. We should turn over the tails so that we have a guaranteed head, i.e., we end up with either 33 or 44 heads after this process. Then, with equal probability, we would get a heads or tails on the remaining coin, so e3=2+12e3+12e4e_3 = 2 + \dfrac{1}{2}e_3 + \dfrac{1}{2}e_4. Putting in e4=0e_4 = 0 yields e3=4e_3 = 4. This means E[TX=3]=8\mathbb{E}[T \mid X = 3] = 8.

If X=2X = 2, then we are considering 22 tails, meaning we turn one over and flip the other. This is exactly the same scenario as above as we are guaranteed to have 33 or 44 heads after with the same probabilities, so e2=4e_2 = 4 as well. This means E[TX=2]=8\mathbb{E}[T \mid X = 2] = 8.

If X=1X = 1, then we consider 22 tails. We turn one over, and then we flip the other. We will end with either 22 or 33 heads after this iteration with equal probability. Therefore, e1=2+12e2+12e3e_1 = 2 + \dfrac{1}{2}e_2 + \dfrac{1}{2}e_3. As e2=e3=4e_2 = e_3 = 4, e1=6e_1 = 6. This means E[TX=1]=10\mathbb{E}[T \mid X = 1] = 10.

Lastly, if X=0X = 0, we just consider 22 tails again. We turn one over, and then we flip the other. We will end with either 11 or 22 heads after this iteration with equal probability, so e0=2+12e1+12e2e_0 = 2 + \dfrac{1}{2}e_1 + \dfrac{1}{2}e_2. Plugging in e1=6e_1 = 6 and e2=4e_2 = 4 yields e0=7e_0 = 7, so E[TX=0]=11\mathbb{E}[T \mid X = 0] = 11.

Finally, we can plug the values and the PMF of XX into our expression from the beginning, we get that E[T]=1164+4168+6168+41610+11611=13516\mathbb{E}[T] = \dfrac{1}{16} \cdot 4 + \dfrac{4}{16} \cdot 8 + \dfrac{6}{16} \cdot 8 + \dfrac{4}{16} \cdot 10 + \dfrac{1}{16} \cdot 11 = \dfrac{135}{16}.