TITLE: Baby Shower Problem. Too hard for 1st grader but got parents thinking
QUESTION [13 upvotes]: So our six year old son comes home from 1st grade with the following math puzzle.

Your Aunt is having a baby. You have created a party game for a baby shower.  It is called pick the gender.  You put pink and blue tiles into a bag.  You ask two guests to pick one tile each out of the bag without looking. You tell your guests that if they are the same color, player A wins and if they are two different colors, then player B wins.
How many tiles of which colors did you put into the bag to make sure that both players have an equal chance of winning?

Putting aside the obvious fact that this seems way too hard for a 1st grader it got us thinking...  Is there a clever way to solve this problem that doesn't involve guessing lots of ugly combinations?
Let $P$ = Number of Pink Balls, $B$ = Number of Blue balls.
It seems to me that the probability of Player "B" winning is
$$\left(\frac{P}{P+B}\right)\left(\frac{B}{P+B-1}\right) + \left(\frac{B}{P+B}\right)\left(\frac{P}{P+B-1}\right)$$
In a fair game this probability is 50%.
$$\frac{2PB}{(P+B)(P+B-1)} = \frac{1}{2}$$
Or $$(P+B-1)(P+B)=4PB$$
At this point we're stuck.  We notice a few random facts but can't put it all together.  For example, either $(P+B)$ or $(P+B-1)$ is divisible by four and the other one is an odd number.  We can also rearrange the terms to show that $4PB+P+B$ is a square.
Can anyone out in math exchange land help us with a solution that does not involve fancy-pants math and does not involve a lot of guessing, spraying and praying?  It just seems like there ought to be an elegant solution...

REPLY [7 votes]: Say there are $p$ pink balls and $b$ blue balls; then the number of pairs of balls of the same color is $p(p-1)+b(b-1)$ and the total number of pairs of balls is $(p+b)(p+b-1)$. We want the second of these to be twice the first, giving
$$ 2 [p(p-1)+b(b-1)] = (p+b)(p+b-1). $$
After much rearrangement, this is equivalent to
$$ (p-b)^2 = p+b $$.
So the total number of balls must be the square of the difference between the number of balls of each color.  Let $p + b = n^2$, and assume $p>b$; then we have $p+b = n^2, p-b = n$ which gives $p = (n^2+n)/2, b = (n^2-n)/2$; all the solutions are of this form or of the reverse form. Furthermore we must have $n \ge 2$; if $n = 0$ or $n = 1$ there aren't enough tiles to play the game. In particular the solutions are
$$ (p,b) = (3,1), (6,3), (10,6), (15,10), \cdots $$
and their reversals $(1,3), (3,6), \cdots$. 
I agree that it would be quite difficult for a first grader to come up with any of these solutions.