All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Balls in an urn (Posted on 2008-11-11) Difficulty: 2 of 5
An urn contains a number of colored balls, with equal numbers of each color. Adding 20 balls of a new color to the urn would not change the probability of drawing (without replacement) two balls of the same color. How many balls are in the urn? (Before the extra balls are added.)

See The Solution Submitted by pcbouhid    
Rating: 3.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer trial and error | Comment 1 of 4

If e is the number of each color and c is the number of colors, then before the new balls are added, the probability of a match would be (e-1)/(e*c-1).  Once the 20 extra balls of a new color are added, this probability becomes conditional on whether the first ball chosen was the new color or one of the original colors. The probability is then c*e/(c*e+20) * (e-1)/(c*e+19) + 20/(c*e+20) * 19/(c*e+19).

The program evaluates these for up to 30 colors originally within the limitation of c+e not exceeding 100.

   10   for T=1 to 100
   20   for Colors=2 to 30
   25    if Colors>=T then goto 80
   30    NEach=T-Colors
   40    PSame=(NEach-1)//(Colors*NEach-1)
   50    PSame2=(Colors*NEach)//(Colors*NEach+20)*(NEach-1)//(Colors*NEach+19)
   60    PSame2=PSame2+20//(Colors*NEach+20)*19//(Colors*NEach+19)
   70    if PSame=PSame2 then print Colors;NEach,PSame;1//PSame
   80   next Colors
   90   next T
 19  10          1//21  21

It finds 10 of each of 19 colors resulting in a 1/21 probability of a match both before and after the addition of 20 balls of a new color.

So there were 190 balls in the urn before the 20 extra were added.

  Posted by Charlie on 2008-11-11 18:22:28
Please log in:
Remember me:
Sign up! | Forgot password

Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (1)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Copyright © 2002 - 2018 by Animus Pactum Consulting. All rights reserved. Privacy Information