MathProblem 19 Balls and an urn problem #1
作者:互联网
You have an urn with four balls of different colors. Randomly you draw two at a time, then painting the first ball to match the second. What is the expected number of drawings before all balls are the same color?
Solution
每次只能选两个球,然后将第一个球的颜色涂成第二个球的颜色。问期望多少步可以将四个颜色不同的球涂成一样的颜色。
不妨假设最开始为 \(1,2,3,4\). 经过一次操作后,得到 \(1,1,3,4\),不妨记为 \(1,1,2,3\),此时为 \(P 1\).
- 如果第一次抽取是 \(1\). 此时得到的仍然是 \(P1\), 而这种概率为 \(2/4=1/2\)
- 第一次抽取 \(2\ or\ 3\),第二次抽取是 \(1\),则得到 \(1,1,1,2\),记为 \(P2\), 此时概率为 \(2\cdot \frac{1}{4}\cdot \cdot\frac{2}{3} = 1/3\)
- 第一次抽取 \(2\ or\ 3\) ,第二次抽取的是 \(3\ or\ 2\), 则得到 \(1,1,2,2\), 记为 \(P3\). 概率为 \(2\cdot 1/4\cdot 1/3 = 1/6\)
所以从 \(P1\) 可以转移到 \(P1,P2,P3\) 这三种状态。考虑 \(P2, P3\) 如何转移。
- \(P2\) 转移的状态同样有: \(P2\) with \(1/2\), \(P3\) with \(1/4\), end with \(1/4\)
- \(P3\) : \(P3\) with \(1/3\), \(P2\) with \(2/3\)
由此得到转移方程:
\[\begin{align} a&=(a+1)/2 + (b+1)/3 + (c+1)/6\\ b&=(b+1)/2 + 1/4 + (c+1)/4\\ c&=(c+1)/3 + (2/3)\cdot(b+1) \end{align} \]得到 \(a=8\). 所以期望的步骤为 \(8+1=9\).
标签:P2,P3,Balls,P1,19,urn,cdot,抽取,得到 来源: https://www.cnblogs.com/xinyu04/p/16538836.html