Puzzle: Mr Bates vs The Post Office

Puzzle: Mr Bates vs The Post Office

The Post Office in DS City has come up with a new measure to limit packages that can be sent under a new flat rate, regardless of weight or volume. The "strap measure" of a box is the length of the longest side plus two times the sum of the two shorter sides. For the new flat rate for sending a packet, the strap measure may not exceed 100 inches.

Your e-commerce client Mr. Bates sells large comforters of 9,000 cubic inches in volume and wants to make use of this new flat rate if possible. What should the measurements of the packaging box be to maximize the volume of the package? Can you design a box that will be large enough to hold these comforters and that can be sent at the flat rate price?

 

 

 

Do you think you have the solution? Then scroll down for our solution!

 

 

The maximum volume is achieved setting the lengths to 33 and one third inches for the long side and 16 and two third inches for each shorter side.

Problems like this can easily be solved using InsideOpt Seeker. Here is a simple Python program to obtain the optimal measurements. It is based on the realization that the volume will be maximized if the two shorter side have equal length, and we fully exhaust the strap measure limit.

import seeker as skr

# create environment
env = skr.Env("license.sio")

# declare variable for the long side
x = env.continuous(1, 100)

# derive the lengths of the shorter sides
short_sum = 100-x
short = short_sum/4

# compute the volume
volume = env.prod([x, short, short])

# maximize the volume for one second
env.maximize(volume, 1)

# extract the solution
print("Volume =", volume.get_value())
print("Sides=", [round(a.get_value(),2) for a in [x, short, short]])
print(env.get_number_evaluations(), "evaluations")

# end the environment
env.end()

Running this program results in this output:

Volume = 9259.259259257551

Sides= [33.33, 16.67, 16.67]

1173944 evaluations

Good news for Mr. Bates: We will be able to accommodate the comforters at the flat rate price. If you have optimization needs in your business, we are here to help!