### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,158)
- misc (2)
- project euler (2)
- puzzle (40)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 177,959 hits

Advertisements

Programming Enigma Puzzles

22 June 2013

Posted by on **From New Scientist #2579, 25th November 2006**

The word processor on which I produced this Enigma developed a fault yesterday and it still needs to be repaired. Whenever I type a positive whole number it actually reduces it by a fixed whole number percentage and then, to the nearest whole number, it prints that answer.

So, for example, when I typed my age yesterday it actually printed 49, which was 7 less than it should have been.

How old am I?

[enigma1419]

Advertisements

%d bloggers like this:

This puzzle requires careful reading to make sure you know what’s going on – I missed a subtlety in my first attempt. I solved this at the time it was published using Perl, but here’s the same approach (but slightly neater) in Python. It runs in 36ms.

Solution:Your correct age is 64.There are two percentage values which give this result: 87% (a 13% reduction) and 88% (a 12% reduction).

I wondered what the subtlety was so I tried it – it a neat twist that I also didn’t see first time round. Here is my version

Much too subtle for me. Nowhere does the puzzle appear to state that a number is reduced twice.

Evidently “whole number” means integer, but I can’t work out what function the word ‘actually’ is performing. Definitely flawed!