**From New Scientist #2648, 22nd March 2008**

I put some or all of the 15 red balls and some or all of the 6 coloured balls from a set of snooker balls into a bag and calculated that there was a 1 in X chance that the first two balls that I picked out at random would both be coloured, X being an integer.

If I had put one more red ball into the bag there would have been a 1 in (X + 1) chance that the first two balls that I picked out were both coloured.

How many red and how many coloured balls did I put into the bag?

[enigma1486]

### Like this:

Like Loading...

The following Python program runs in 36ms.

Solution:Initially there were 9 red and 6 coloured balls in the bag.