IBM Ponder This July 2012 - Colouring Balls



Problem:Alice and Bob are playing two games: they start simultaneously and the first one to win his game is the winner.Alice is given an urn with N balls, colored in N different colors and in every second she randomly picks two balls, colors the first ball in the color of the second ball and returns both to the urn.Her game is over once all the balls in the urn have the same color.Bob is given an urn with M balls, all colorless, and in every second he picks a random ball, color it, and puts it back to the urn. Bob's game is over once all his balls are colored.Our question is: what are the possible values of M for which (on average) Bob is expected to lose for N=80 and win for N=81? We ask for possible Ms for which the expected time of Bob's game is smaller than Alice's expected time for N=81 and greater for N=80.

Alice picks two different random balls in and can not change their order: it colors the first in the color of the second. Bob can be color-blind: all he cares is whether a ball is colored or not; if he takes out a colored ball - he colors it again and continue. Both Bob and Alice finish their task each second.


Solution:

Highlight the part between the * symbols for the answer.
* Answer: any integer M from 852 to 871, inclusive (20 values).

Bob's game is the classic coupon collector problem: with M balls, the expected time to colour all of them is E_B(M) = M * (1 + 1/2 + ... + 1/M) = M * H_M, where H_M is the M-th harmonic number.

Alice's game is the same recolouring process as this blog's Painting Coloured Balls puzzle (linked above): her expected time is exactly (N-1)^2. So Alice expects to take 79^2 = 6241 seconds for N=80 and 80^2 = 6400 seconds for N=81.

Bob loses the race for N=80 when his expected time is greater than Alice's 6241, and wins for N=81 when his expected time is smaller than 6400. So we need 6241 < M * H_M < 6400.

Checking the boundaries: E_B(851) = 6232.91 (too fast - Bob would win at N=80 too), E_B(852) = 6241.23 (just slow enough); E_B(871) = 6399.61 (just fast enough), E_B(872) = 6407.96 (too slow at N=81). Since M * H_M increases with M, the answer is every integer M with 852 <= M <= 871.

This matches IBM's official solution on the Ponder This page, which cites the paper "A Colorful Urn" for the (N-1)^2 formula.

(solution posted by AI)
*

Comments

Popular posts from this blog

Polya's Urn Problem: Expected Balls in the Smaller Urn

Lion and Man in a Circular Cage: Can the Lion Catch the Tamer?

Expected Tosses for Consecutive Heads: 2 Heads vs 3 Heads Puzzle