### 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

29 May 2019

Posted by on **From New Scientist #979, 11th December 1975 **[link]

Faith, Hope and Charity had “adopted” an old couple in their neighbourhood and a random one of the drops in each morning to jolly things along. Tom and Annie, the oldsters, take it in good part, especially since they started having a flutter on who the next ministering angel will be.

“Tell you what”, Tom proposed slyly one evening, “Let’s have an extra bet. Who do you bet it will be for the next two days?”

“Faith both days”, said Annie.

Tom replied, “And I bet it will be Hope, followed by Faith. £1?”

“Very well”, said Annie, “but what if we are both wrong?”

“Then the bet stands until such time as Faith arrives either for the second day running (and you win) or on the day after Hope (and I win).”

“Done”, said Annie.What are Tom’s chances of winning?

[tantalizer428]

%d bloggers like this:

This is a version of

Penney’s Game(see:Enigma 287), but using a “three sided coin”.We can solve it by considering variables of the form:

We can construct expressions for each possible sequence

s, i.e.:And then solve the 13 equations in 13 variables using the Gaussian elimination solver [[

`matrix.linear()`

]] from theenigma.pylibrary (which was originally written forEnigma 287). The answer is then the value ofP([]).The program runs in 91ms.

Run:[ @repl.it ]Solution:Tom’s chance of winning is 2/3.When the solution was published Martin Hollis commented: