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

- 178,002 hits

Advertisements

Programming Enigma Puzzles

5 March 2012

Posted by on **From New Scientist #2719, 1st August 2009** [link]

Joe gave Penny a rectangular piece of card 12 centimetres by 6 centimetres with the instruction that she had to draw four straight lines out from the centre of the card to an edge, each a whole number of centimetres long, so that, by cutting along two of the lines, a piece of card with an area equal to any multiple of 6 square centimetres (from 1 to 6) can be produced.

What will the total length of the four lines be?

[enigma1556]

Advertisements

%d bloggers like this:

I initially solved this one by drawing it out, doing it programatically is a bit trickier, although it does find another family of answers (which give the solution).

The following Python program runs in 37ms.

Solution:The total length of the 4 lines is 19 cm.This is the solution I came up with on paper:

Cuts along the following 2 lines partition the rectangle into pieces with the following areas:

Of course there are answers that are rotations/reflections of this that give the same solution.

My program also found a second family of answers. The four lines are the same, but in a different configuration:

Cuts along the following 2 lines partition the rectangle into pieces with the following areas: