返回题库

弹珠游程数

Marble Runs

专题
Algorithmic Programming / 算法编程
难度
L6

题目详情

袋中有 50 个红球与 50 个蓝球,不放回随机抽取直到抽完并记录颜色序列。

“游程(run)”指任意长度的连续同色段,例如 RBBRRRBRRRBBRRRBRR 有 5 个游程。

求游程总数的期望。

You repeatedly draw marbles from a bag containing 50 red and 50 blue marbles until there are no more marbles left, recording the order of red and blue marbles drawn. You then count the number of "runs,'' where a run is defined as any number of consecutive marbles of the same color. For example, RBBRRRBRRRBBRRRBRR contains 5 runs. What is the expected number of runs that you observe?

解析

设游程数为 RR,令 IiI_i 表示第 ii 与第 i+1i+1 个球颜色不同的指示变量(i=1,,99i=1,\dots,99),则

R=1+i=199Ii.R=1+\sum_{i=1}^{99} I_i.

随机排列下,相邻两位置异色概率为

P(Ii=1)=2505010099=5099.P(I_i=1)=\frac{2\cdot 50\cdot 50}{100\cdot 99}=\frac{50}{99}.

因此

E[R]=1+995099=51.\mathbb{E}[R]=1+99\cdot\frac{50}{99}=\boxed{51}.