### Random Post

### Recent Posts

### Recent Comments

Jim Randell on Tantalizer 452: Snailspaces | |

Brian Gladman on Enigma 1061: Par is never… | |

Hugh Casement on Enigma 1061: Par is never… | |

Jim Randell on Enigma 1061: Par is never… | |

geoffrounce on Puzzle 47: Digits all wro… |

### Archives

### Categories

- article (11)
- enigma (1,175)
- misc (2)
- project euler (2)
- puzzle (44)
- site news (46)
- tantalizer (48)
- teaser (3)

### Site Stats

- 183,007 hits

Advertisements

This brute force program is quite short and runs in 459ms.

Solution:The phone number is 09876.We can also use the alphametic solver (

SubstitutedExpression()) from theenigma.pylibrary to solve this puzzle.This run file executes in 216ms.

(The digits are not necessarily distinct, and leading zeros are allowed).

Expressing a similar set of constraints in MiniZinc allows several of the MiniZinc solvers to find a solution in 65-69ms.

This reminds me of the game marketed as Mastermind.

Ten incorrect numbers seems a lot, to be able to deduce five digits.

Could it have been solved with fewer numbers given?

Certainly I noticed when solving the problem that the final candidate (07145) is not required, as we have already got down to a single unique solution with the first nine candidates. So they are not all required.

In fact 9 in the minimum number of candidates required. We can do without exactly one of: 35862, 84771, 98174, 07145.

Enigma 52is anotherMastermindtype of puzzle.Using profile based timing, this version runs in 90ms on my laptop.

@Brian: For comparison purposes the total run time of this program is 201ms in my environment.

Using the telephone numbers in the order listed as num1 to num10 in the code below,

it looks as though the correct digit in the correct position is not unique in four of the five digits

– as identified in the extra comments at the end of my code.

To complicate things further, the correct digit also appears in two or three incorrect positions in all five digits.

Here’s my interpretation of the problem using MiniZinc. I get a 65ms run time using

mzn-g12fd -a.