[Math] Baby Shower Problem. Too hard for 1st grader but got parents thinking

combinatoricsprobability

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…

Best Answer

$$(P+B-1)(P+B)=4PB$$ is equivalent to

$$(P-B)^2=P+B $$

Let $x:=P-B$ then $P+B=x^2$.

Solving Yields $P= \frac{x^2+x}{2}$ and $B= \frac{x^2-x}{2}$, where $x$ needs to be an integer....(Note that $x$ can also be negative). Note that this generates all solutions.

Thanks to Henning who pointed the small mistake.

Related Question