### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (49)
- teaser (3)

### Site Stats

- 184,820 hits

Advertisements

Programming Enigma Puzzles

2 February 2015

Posted by on **From New Scientist #1402, 22nd March 1984** [link]

“Care for a flutter?” Alf asked Bert.

“Suits me,” Bert replied.

“We need a 50p, a 20p, a 10p and a 5p coin. I’ll contribute one of them and you the other three.”

“Then what?”

“We toss all four. If any come up Heads, then whichever of us has the most money (not the most coins) head-side up scoops all four coins. If all four come up Tails, we toss again.”

“OK. Who contributes what?”

“Well,” said Alf, “as I am putting in only one coin, I’ll decide which it is to be.”

Which coin gives the crafty Alf the best bet?

This puzzle brings the total number of *Enigma* puzzles on the site to 780. As the final *Enigma* was #1780, you might think that means there are 1,000 puzzles left to publish. But at Christmas time, especially in the 80’s, multiple puzzles were often published under the same number. (Also, I’ve so far come across three puzzles that are duplicates of already published puzzles). So, my current estimate is that I will need to publish around 1,788 puzzles to have a full archive of *Enigma* puzzles, so it’ll be a couple of weeks before there are around 1,000 puzzles left to go.

[enigma255]

Advertisements

%d bloggers like this:

This Python program examines the possibilities, and picks the coin that maximizes the winnings. It runs in 36ms.

Solution:Alf should contribute the 20p coin.Hi Jim, I’m in trouble with this one! Doing the puzzle longhand, it seems to me that Alf has 8/15 chances to gain 35p if he owns the 50p coin, 4/15 chances to gain 65p if he owns the 20p coin, 2/15 chances to gain 75p if he owns the 10p coin and 1/15 chances to win 80p if he owns the 5p coin. It’s a no-brainer – Alf should hang on to the 50p coin. Please put my mind at rest.

PS Well done with your first 780 puzzles.

I’m not an expert on odds and probabilities (you might want to look at [ http://en.wikipedia.org/wiki/Odds ] for more details), but this is how I understand it.

If you contribute the 50p then you are more likely to win the game (as you note), but I think you also need to consider what Alf stands to lose, not just what he stands to win.

If Alf put in a £1 million pound coin instead of the 50p, then he would have a 53% chance of winning 35p, but a 47% chance of losing his £1M. The gambling odds of a win are about 3,000,000 – 1 against.

But if he lets Bert put the £1M in and he only puts in 20p, then he has a 27% chance of winning £1M, and a 73% chance of losing his 20p. The gambling odds of a win are 5,000,000 – 1 on.

As the gambling odds indicate it’s better to go for a 27% chance of winning £1M on a 20p stake than a 53% chance of winning 35p on a £1M stake.

The exaggerated amount makes it a bit easier to see what’s going on. But as the value of the largest coin reduces the gambling odds approach the probability of a win and if we replaced the 50p coin by a 40p coin the gambling odds and the probabilities are the same, so it wouldn’t really matter what coin Alf chose to put in.

With the coins given in the question:

If Alf chooses the 50p coin the probability of a win is 8/15 (about 53%). The gambling odds are 35-50 corresponding to a probability of 10/17 (about 59%). This is more than the actual probability, so the bet is worse than fair.

If Alf chooses the 20p coin the probability of a win is 4/15 (about 27%). The gambling odds are 65-20 corresponding to a probability of 4/17 (about 24%). This is less than the actual probability, so the bet is better than fair.

Choosing 10p the probability of a win is 2/15 (about 13%). The gambling odds are 75-10, corresponding to a probability of 2/17 (about 12%), so the bet is slightly better than fair.

Choosing 5p the probability of a win is 1/15 (about 7%). The gambling odds are 80-5, corresponding to a probability of 1/17 (about 6%), so the bet is slightly better than fair.

The best bet for Alf is to choose 20p.

So much for the theory, I wrote a program to try a million random trials for each choice of coin and the observed outcomes match the calculations:

Thanks Jim – it was me that was the no-brainer!