IBM Ponder This July 2012 - Colouring Balls
Source: IBM Ponder This July 2012
Problem very similar to CSE Blog: Painting Coloured Balls ( Link: http://pratikpoddarcse.blogspot.in/2010/10/painting-coloured-balls.html )
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
Post a Comment