## Easy: Balls and probabillity

A forum for good logic/math puzzles.

Moderators: jestingrabbit, Moderators General, Prelates

userxp
Posts: 436
Joined: Thu Jul 09, 2009 12:40 pm UTC

### Easy: Balls and probabillity

Imagine that you have a bag with a number of white balls and a number of black balls, such that when picking two random balls from the bag, the probability of them being the same color is the same as the probability of them being of different colors. How many balls of each color are there? (Edit: the correct answer is the one using the fewest number of balls)

It's easy to find the answer by trying the possibilities. If you want something a bit harder, make a formula for calculating the likelihood of picking two balls of the same color given n black balls and m white balls.
Last edited by userxp on Thu Sep 17, 2009 6:52 pm UTC, edited 1 time in total.

skeptical scientist
closed-minded spiritualist
Posts: 6142
Joined: Tue Nov 28, 2006 6:09 am UTC
Location: San Francisco

### Re: Easy: Balls and probabillity

Spoiler:
Ways of picking 2 balls: [imath]n+m \choose 2[/imath]. Ways of picking one of each color: nm. So the probability that the two balls are different colors is [imath]\frac{2nm}{(n+m)(n+m-1)}[/imath]. If this is equal to 1/2, then [imath](n+m)(n+m-1)=4nm[/imath], so [imath](n-m)^2=n+m[/imath], so it's impossible to tell the number of balls of each color; any pair of consecutive triangular numbers works.
I'm looking forward to the day when the SNES emulator on my computer works by emulating the elementary particles in an actual, physical box with Nintendo stamped on the side.

"With math, all things are possible." —Rebecca Watson

dedalus
Posts: 1169
Joined: Fri Apr 24, 2009 12:16 pm UTC
Location: Dark Side of the Moon.

### Re: Easy: Balls and probabillity

This is my working, differs a bit from skep's:
Spoiler:
Probability of either ball being colour a = a/(a+b). So, chance of both balls being the same colour is (a/(a+b))^2 + (b/(a+b))^2, and the probability of both balls being a different colour is 2ab/(a+b)^2. We want to find thus when a^2+b^2=2ab; a^2-2ab+b^2=0, (a-b)^2=0, a=b.

I'm kind of unsure how you can get any solutions other then this, maybe I read the question wrong.
doogly wrote:Oh yea, obviously they wouldn't know Griffiths from Sakurai if I were throwing them at them.

jaap
Posts: 2084
Joined: Fri Jul 06, 2007 7:06 am UTC
Contact:

### Re: Easy: Balls and probabillity

dedalus wrote:This is my working, differs a bit from skep's:
Spoiler:
Probability of either ball being colour a = a/(a+b). So, chance of both balls being the same colour is (a/(a+b))^2 + (b/(a+b))^2, and the probability of both balls being a different colour is 2ab/(a+b)^2. We want to find thus when a^2+b^2=2ab; a^2-2ab+b^2=0, (a-b)^2=0, a=b.

I'm kind of unsure how you can get any solutions other then this, maybe I read the question wrong.

The balls are taken out without replacement. Therefore:
Spoiler:
You should get a(a-1) + b(b-1) = 2ab.
Rearrangement gives (a-b)2 = a+b, just like skeptical scientist's answer.

userxp
Posts: 436
Joined: Thu Jul 09, 2009 12:40 pm UTC

### Re: Easy: Balls and probabillity

Spoiler:
skeptical scientist wrote:so it's impossible to tell the number of balls of each color; any pair of consecutive triangular numbers works.

Yes, there is an infinite number of solutions. Any correct answer should be considered valid, but I'm editing the description to make it more precise.

skeptical scientist
closed-minded spiritualist
Posts: 6142
Joined: Tue Nov 28, 2006 6:09 am UTC
Location: San Francisco

### Re: Easy: Balls and probabillity

Spoiler:
A better solution is to find all of the correct answers, which I did.
I'm looking forward to the day when the SNES emulator on my computer works by emulating the elementary particles in an actual, physical box with Nintendo stamped on the side.

"With math, all things are possible." —Rebecca Watson

dedalus
Posts: 1169
Joined: Fri Apr 24, 2009 12:16 pm UTC
Location: Dark Side of the Moon.

### Re: Easy: Balls and probabillity

jaap wrote:
dedalus wrote:This is my working, differs a bit from skep's:
Spoiler:
Probability of either ball being colour a = a/(a+b). So, chance of both balls being the same colour is (a/(a+b))^2 + (b/(a+b))^2, and the probability of both balls being a different colour is 2ab/(a+b)^2. We want to find thus when a^2+b^2=2ab; a^2-2ab+b^2=0, (a-b)^2=0, a=b.

I'm kind of unsure how you can get any solutions other then this, maybe I read the question wrong.

The balls are taken out without replacement. Therefore:
Spoiler:
You should get a(a-1) + b(b-1) = 2ab.
Rearrangement gives (a-b)2 = a+b, just like skeptical scientist's answer.

Ah of course. Thanks for the correction.
doogly wrote:Oh yea, obviously they wouldn't know Griffiths from Sakurai if I were throwing them at them.

Poohblah
Posts: 53
Joined: Thu Feb 26, 2009 3:54 am UTC

### Re: Easy: Balls and probabillity

Spoiler:
4 balls total. 1 white, 3 black. There are 6 possible combinations of 2 balls. Of those combinations, 3 possibilities are choosing the one white ball and one of the black ones, and the other three are choosing two of the black balls. Like suggested earlier, 1 and 3 are two consecutive triangular numbers.

### Who is online

Users browsing this forum: No registered users and 9 guests