Given a bag of n balls each with a different color. Each time you pick up a pair of balls and paint both to one of their colors. What's the expected number of steps before all balls become the same color?
Analysis:
This is a problem from the "Green Cover Book". It's easy to see that we have the following transition probability. Thus if we let μi be the expected number of steps getting to one color when the bag has i distinct colors, then we have μi=1+i(i−1)n(n−1)μi−1+(1−i(i−1)n(n−1))μi.
From this we can use induction to prove that
μi=i−1in(n−1).
Therefore we have
μn=(n−1)2.
No comments:
Post a Comment