### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,367)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (48)
- site news (58)
- tantalizer (94)
- teaser (7)

### Site Stats

- 233,130 hits

Programming Enigma Puzzles

15 November 2012

Posted by on **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]

%d bloggers like this:

The following Python program runs in 36ms.

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