Water retention on mathematical surfaces refers to the water caught in ponds on a surface of cells of various heights on a regular array such as a square lattice, where water is rained down on every cell in the system. The boundaries of the system are open and allow water to flow out. Water will be trapped in ponds, and eventually all ponds will fill to their maximum height, with any additional water flowing over spillways and out the boundaries of the system. The problem is to find the amount of water trapped or retained for a given surface. This has been studied extensively for two mathematical surfaces: magic squares and random surfaces.
Magic squares have been studied for over 2000 years. In 2007, the idea of studying the water retention on a magic square was proposed. In 2010, Al Zimmermann's programing contest produced the presently known maximum retention values for magic squares order 4 to 28. Computing tools used to investigate and illustrate this problem are found here.
There are 4,211,744 different retention patterns for the 7x7 square. A combination of a lake and ponds is best for attaining maximum retention. No known patterns for maximum retention have an island in a pond or lake.
Maximum-retention magic squares for orders 7-9 are shown below:
The figures below show the 10x10 magic square. Is it possible to look at the patterns above and predict what the pattern for maximum retention for the 10x10 square will be? No theory has been developed that can predict the correct combination of lake and ponds for all orders, however some principles do apply. The first color-coded figure shows a design principle of how the largest available numbers are placed around the lake and ponds. The second and third figures show promising patterns that were tried but did not achieve maximum retention.
Several orders have more than one pattern for maximum retention. The figure below shows the two patterns for the 11x11 magic square with the apparent maximum retention of 3,492 units:
The most-perfect magic squares require all (n-1)^2 or in this case all 121 2x2 planar subsets to have the same sum. ( a few examples flagged with yellow background, red font). Increased internal complexity reduces retention.
Before 2010 if you wanted an example of a magic square larger than 5x5 you had to follow clever construction rules that provided very isolated examples. The 13x13 pandiagonal magic square below is such an example. Harry White's CompleteSquare Utility allows anyone to use the magic square as a potter would use a lump of clay. The second image shows a 14x14 magic square that was molded to form ponds that write the 1514 - 2014 dates. The animation notes how the surface was sculptured to fill all ponds to capacity before the water flows off the square. This square honors the 500th anniversary of Durer's famous magic square in Melencolia I.