### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,123)
- misc (2)
- project euler (2)
- puzzle (31)
- site news (43)
- tantalizer (31)
- teaser (3)

### Site Stats

- 168,282 hits

Programming Enigma Puzzles

26 February 2016

Posted by on **From New Scientist #1482, 14th November 1985** [link]

My two elder sisters love Mr Ivor Fitzclarence Biggabagg’s seductive sweet-counter. His “Bettamix”, a random mixture of liquorice and blackcurrant gums, is splendid value, they reckon: each buys a quantity every week. When they get home, they allow me to pick one gum for myself. Isn’t that nice of them?

I hate liquorice and love blackcurrant, but unfortunately they won’t let me just look and choose a blackcurrant gum. They do however let me first inspect the contents of each bag. Then I can

choose one bag at random and then pick a gum at random from iteithermix up the contents of both bags and then pick a gum at random.orYou will be glad to hear that I have now worked out a simple rule for deciding which of the two methods gives me the better chance of a blackcurrant gum.

I was surprised last week to find that it didn’t matter which method I chose. Anne’s bag contained 6 liquorice and 14 blackcurrant gums. Pam’s held 18 liquorice and quite a few blackcurrant.

Before I had a chance to choose, Anne removed some of the blackcurrant gums from Pam’s bag and asked me, in this new situation, to decide which method. And again I was surprised to find that it didn’t matter which method I chose.

How many blackcurrants did Anne remove?

**Note:** A correction was issued to this puzzle in **New Scientist #1485** (along with the solution), the puzzle statement above has been modified accordingly.

[enigma334]

Advertisements

%d bloggers like this:

For Anne’s bag (6 liquorice + 14 blackcurrant), the probability of choosing a blackcurrant from Anne’s bag is:

For Pam’s bag (18 liquorice +

xblackcurrant), the probability of choosing a blackcurrant from Pam’s bag is:So the probability of choosing a blackcurrant using method 1 is:

Mixed together there are 24 liquorice + (14 +

x) blackcurrant, the probability of choosing a blackcurrant is:We are interested in cases where these last two probabilities are equal.

This Python program considers increasing values of

x, until it gets two values whereP1andP2are the same. It runs in 52ms.Solution:Anne removed 40 blackcurrants.Initially there were 42 blackcurrants in Pam’s bag, and probability of choosing a blackcurrant is 7/10 (70%) by either method.

After Anne removes 40 blackcurrants from Pam’s bag there are only 2 remaining, and the probability of choosing a blackcurrant is now 2/5 (40%) by either method.

Manually we can rewrite the equation P1 = P2 as:

Which factorises as:

Giving the solutions

x= 2,x= 42.