返回题库

颜色切换次数期望

Color Switches

专题
Probability / 概率
难度
L6

题目详情

一个罐子里有 100 个球(50 黑 50 白)。随机不放回逐个取出直到取完。

若相邻两次取出的颜色不同(黑后白或白后黑),称为一次“颜色切换”。

问:颜色切换次数的期望是多少?

提示:期望线性性。

You are given an urn with 100 balls (50 black and 50 white). You pick balls from urn one by one without replacements until all the balls are out. A black followed by a white or a white followed by a black is "a colour change". Calculate the expected number of colour-changes if the balls are being picked randomly from the urn.

Hint

Linearity of expectation

解析

答案是 50

共有 99 个相邻位置对。对任意相邻对,颜色不同的概率为

P(不同)=501005099+501005099=5099.P(\text{不同})=\frac{50}{100}\cdot\frac{50}{99}+\frac{50}{100}\cdot\frac{50}{99}=\frac{50}{99}.

用线性性:

E[切换次数]=995099=50.E[\text{切换次数}]=99\cdot\frac{50}{99}=50.

Original Explanation

50

Solution

Each time we draw, there could be a possible color-switch, except the first time we draw, hence 99 possible switches.

Let XiX_i be an indicator variable, value 1 if ithi_{th} position has a colour change and zero otherwise, note that ii goes from 11 to 9999.

Total number of switches, S=X1+X2+...+X99=i=199XiS = X_1 + X_2 + ... + X_{99} = \sum_{i=1}^{99} X_i

The expected number of color switches is denoted by the sum of these variables, i.e E[S]=E[X1+X2+...+X99]E[S] = E[X_1 + X_2 + ... + X_{99}]

Linearity of expectation states that the expected value of the sum of random variables is equal to the sum of their individual expected values.

Hence the answer is E[S]=E[X1]+E[X2]+...+E[X99]E[S] = E[X_1] + E[X_2] + ... + E[X_{99}]

Note that each XiX_i is identical, and the expected value is equal for each ii, i.e, E(Xk)=E(X1)E(X_k) = E(X_1)

Hence E[S]=E[X1]+...+E[Xn]=i=199E[X1]=99E[X1]E[S] = E[X_1] + ... + E[X_n] = \sum_{i=1}^{99} E[X_1] = 99 \cdot E[X_1]

Also, we can calculate the expected value, E[X1]=1P(X1=1)+0P(X1=0)=P(X1=1)E[X_1] = 1 \cdot P(X_1 = 1) + 0 \cdot P(X_1 = 0) = P(X_1 =1)

Probability of any given color change is (either first is R second is B, or first is B and second is R) =P(X1=1)=501005099+501005099=50/99= P(X_1 = 1)= \dfrac{50}{100} \cdot \dfrac{50}{99} + \dfrac{50}{100} \cdot \dfrac{50}{99} = 50/99

Finally, the answer is E[S]=i=199E[Xi]=99E[X1]=9950/99=50 E[S] = \sum_{i=1}^{99} E[X_i] = 99 \cdot E[X_1] = 99 \cdot 50/99 = 50


Note: XiX_i's are not independent, but since all the balls are drawn randomly, the probability-distribution is identical for each draw. For instance, if you are given no information about the previous colors, and I ask 'what is the probability that 5th draw has a color change?', your answer will not depend on '5', instead the answer will be same for any index.