### Random Post

### Recent Posts

### Recent Comments

Jim Randell on Enigma 1691: Factory part… | |

Jim Randell on Puzzle 52: Football on the Isl… | |

geoffrounce on Enigma 1691: Factory part… | |

Hugh Casement on Enigma 1070: Time to work | |

Jim Randell on Enigma 1070: Time to work |

### Archives

### Categories

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

### Site Stats

- 177,808 hits

Advertisements

The following Python does a bit of calculus to find solutions.

To check cards up to 300cm in size it takes 93ms.

Solution:The card is 3 cm × 8 cm.If you can’t do differentiation you can get the SymPy library to do it for you.

If you don’t know calculus here’s a solution that uses numerical approximations to find the maximum volume for the box. It runs in 215ms.

Only the first turning point of the graph of volume vs. square length,s, needs to be considered, as the graph always has the form shown in this diagram:

Of course, I should have included 2 in the list of primes, but initially had assumed that the square length was restricted to being a whole number of centimetres.

Another way of approaching the problem is as follows:

Starting from the formula for volume, v = (a-2s)(b-2s)s , ( a,b are the sides of the original rectangle, s is the length of the square cut out from each corner),

The maximum volume is the first turning point of the function, i.e. the lower root of

dv/ds = 12s^2 -4(a+b)s + ab = 0

which is s= ( (a+b) – sqrt(a^2 + b^2 – ab) )/6

Assuming a<b, the lengths of the rectangular box is 4 times the width gives the equation

4(a-2s) = b-2s

produces the equation

sqrt(a^2 + b^2 – ab) = 2b – 3a

so (a^2 + b^2 – ab) is a perfect square. The solution can be found from this information with the following code:

Or even more simply, avoiding the need to generate a list of squares:

Or you can plug it into Wolfram Alpha [link] (I could get it to do the calculus separately, but not along with the other constraints), which tells you the solution is:

b= 8a/3,c= 2a/9Additionally

aandbmust be positive integers and one of them must be prime.From the formula for

bit follows thatamust be a multiple of 3 (as 8 is not divisible by 3), andbmust be composite (as 8 is), henceamust be prime, and a multiple of 3.So:

a= 3,b= 8,c= 2/3.You can do this in your head, doesn’t need any calculus. Start with base L = W/4. Height = h.

If you increment the small square, h goes up increasing volume. L goes down, decreasing volume by twice as much. W decreases volume by 4 times as much, so volume stays constant when h = 0.1L. That makes the card 1.2L x 0.45L, ratio of card sides 120/45 reduces to 8/3 one of which is prime

I think I see your argument, and it seems that this is a similar technique to differentiation from first principles. It’s been a long while since I did this at school, but I think you would formalise it like this:

At the maximum volume the base of the box is

w× 4wand has heighth.So the volume is:

v=w× 4w×h= 4w²h.The dimensions of the card are:

a=w+ 2h,b= 4w+ 2h, 0 <h<a/2.If the height is changed by a small amount,

e, the volume of the box becomes:v' = (w− 2e) × (4w− 2e) × (h+e)expanding:

v' = 4w²h− 10ewh+ 4e²h+ 4ew² − 10e²w+ 4e³So: (

v' −v) /e= −10wh+ 4eh+ 4w² − 10ew+ 4e²As

etends to 0 this tends to the derivative: −10wh+ 4w²As the volume is at a maximum we set the derivative to zero, hence:

0 = 4

w² − 10wh= 2w(2w− 5h)As

wis non-zero it follows that at the maximum 2w= 5h, hence:h= 2w/5.So considering the ratio

a:b:a:b=w+ 2h: 4w+ 2h=

w+ 4w/5 : 4w+ 4w/5= 9

w/5 : 24w/5= 3 : 8

and the solution follows.

Well done for being able to do this in your head!