### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

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

### Site Stats

- 183,172 hits

Advertisements

Programming Enigma Puzzles

8 April 2014

Posted by on **From New Scientist #1327, 14th October 1982** [link]

“I would if I could, but I’m sorry I can’t”

I felt that I had to say this to my Aunt.

She seemed to expect me to lend her some cash

And knowing my Aunt that would surely be rash.

I happen to know what her overdraft is;

My Uncle’s is large, hers is much more than his.

Her husband, my Uncle, in fact owed the bank

A number of pounds which was, let’s be frank,

Sixty-three more than my overdraft then.

Aunty’s and mine are two-hundred-and-ten;

Between them, I mean, and I’d like you to see,

When I say “much”, Aunt’s is Uncle’s times three —

Or as near to three as it can be,

Bearing in mind this vital fact,

The pounds we owe are all exact.What are the overdrafts of my Aunt, my Uncle and myself?

[enigma182]

Advertisements

%d bloggers like this:

This Python code runs in 32ms.

Solution:My Aunt’s overdraft is £205. My Uncle’s overdraft is £68. My overdraft is £5.The actual ratio of the Aunt’s and Uncle’s overdrafts is 3 + 1/68 (≈ 3.015).

This Enigma was set for multiple outputs in the MiniZinc configuration and gave the following results – I added the last column:

Aunt Uncle Me 3 * Uncle

209 64 1 (3*64 = 192)

208 65 2 (3*65 = 195)

207 66 3 (3*66 = 198)

206 67 4 (3*67 = 201)

205 68 5 (3*68 = 204)

The last condition in the Enigma gives the solution:

Aunt = 205, Uncle = 68 and Me = 5

I think we can solve this using the

minimizeparameter tosatisfyto get the A/U value closest to 3 directly.Yes, good point.

Although the <minimize> constraint produces the correct single solution,

It still gives the same multiple solutions for a multiple configuration output, which seems a bit odd.

I thought MiniZinc produced a simple, neat solution for this Enigma