aa r X i v : . [ m a t h . HO ] D ec A New Take on Classic ‘Pen Problems’
David A. NashDec. 11, 2019
Abstract
In this article we generalize the classic “farm pen” optimization problem from afirst course in calculus in a handful of different ways. We describe the solution to an n -dimensional rectangular variant, and then study the situation when the pens areeither regular polygons or platonic solids. “43. A rectangular stockade is to be built which must have a certain area.If a stone wall already constructed is available for one of the sides, find thedimensions which would make the cost of construction the least.” [2, pg.134]“A farmer wants to build four fenced enclosures on his farm for his free-range ostriches. To keep costs down, he is always interested in enclosingas much area as possible with a given amount of fence. For the fencingprojects in Exercises 35–38, determine how to set up each ostrich pen sothat the maximum possible area is enclosed, and find this maximum area.... 37. A rectangular ostrich pen built with 1000 feet of fencing material,divided into three equal sections by two interior fences that run parallel tothe exterior side fences as shown next at the left.” [6, pg. 288]“Pen Problems,” such as the two given above, have been around in mathematics text-books for over one hundred years. The first, from Granville’s calculus textbook (publishedin 1904), was the oldest that the author was able to dig up. However, several significantlyolder textbooks have similar style three-dimensional problems involving the constructionof rectangular boxes with no tops, thus, it seems likely that there are older examples oftwo-dimensional pen problems out there as well. The second example is from Taalmanand Kohn’s much more modern entry (2014), and it includes three other variations on thissame theme.In each of these problems, we are tasked with maximizing the space we can enclose givensome fixed constraint on the shape and size of the border. In a first course in calculus,students are often taught to begin these problems by solving for one of the variables in1he boundary constraint equation in order to reduce the measure of the space enclosedto a function of just one variable. For example, we might visualize Taalman and Kohn’sexample from above as in Figure 1. We would then like to maximize the area A = (3 x ) y given a fixed perimeter 1000 = 6 x + 4 y . y x x x Figure 1: Three ostrich pens of equal area.Given this particular setup, one can show the area is maximized when x = 83 . ¯3 and y = 125. What is perhaps more interesting though, is that the amount of fencing used in thevertical direction (4 y = 500) and the amount used in the horizontal direction (6 x = 500) areboth exactly half of the total fencing allotted. The same phenomenon occurs in Grenville’sversion, where – given a fixed area to enclose – the perimeter is minimized by letting theportion parallel to the existing wall be twice as long as the sides in the perpendiculardirection (hence half the new fencing used is parallel to the wall, and half is perpendicularto it). In fact, the same is true of the three-dimensional box problem as well – the volumeis maximized when the surface area perpendicular to each cardinal direction is exactly of the total available. x y zz Figure 2: A two-tiered tv stand made out of wood and particleboard.Another common variant involves designs using different materials for some of the walls(each with different costs associated to them). For example, we might design a tv stand(see Figure 2) as two rectangular spaces which are open at the front. Most of the wallswill be made out of wood (at $3 per sqft), but the back wall of the top section will behalf particle board (at $2 per sqft) and half open (to allow cables to pass out the back).Given these design choices, we’d like to maximize the volume we can hold (regardless ofthe aesthetics) given a fixed cost of $81 (rather than a fixed surface area).2nder these conditions, the volume we’d like to maximize is V = xy (2 z ), and the costconstraint is 81 = 3(3)( xy ) + 4(3)( yz ) + [1(3) + (2)]( xz ) = 9 xy + 12 yz + 4 xz . We’llagain spare the details, but the volume can be maximized here by taking x = 3, y = 1, and z = . More importantly, observe that the cost of the horizontal walls (those perpendicularto the z -axis) is exactly 9(3)(1) = $27, the cost of the walls perpendicular to the y -axis is12(1)( ) = $27, and the cost of the walls perpendicular to the x -axis is 4(3)( ) = $27. Sowe maximize our volume by splitting the cost evenly among each of the directions!Does the optimal solution always correspond to splitting the constraint equally amongeach of the directions? In Section 1, we begin by addressing this question in a rectangularsetup that has been generalized to any number of dimensions.We follow that up in Sec-tions 2 and 3 by considering chains of pens made out of equal sized regular polygons andmore compact arrangements of triangles, squares, and hexagons. Finally, in Section 4, weconsider the equivalent 3-dimensional situation with chains of equal sized platonic solidpens. At each stage, we also compare to using circles or spheres where it is impossible toshare any of the boundary. n -dimensional Rectangular Pen Problem In n -dimensions ( n ≥ b , . . . , b n ∈ N , we might create a b × b ×· · · × b n grid of equal size rectangular n -dimensional spaces each with identical side lengths x , . . . , x n ≥
0. Thus, the hypervolume that we’d like to maximize is V = n Y j =1 ( x j b j )We will consider the case in which our constraint is a fixed cost, C , under the assumptionthat the cost of each possible material per unit of hypersurface area is constant. Observe,if we focus only on walls that are perpendicular to the i -th direction, a single wall for asingle chamber has hypersurface area Q j = i x j . Perhaps some of the chamber walls alreadyexist (or partially exist), or we may design the grid so that only certain ones use particularmaterials, etc. Regardless of the particular features, we may count the total cost of thesewalls by adding up a linear combination of the material costs with weights coming from a count (possibly fractional) of the number of walls of each type – just as we observed in thetv stand example above.Importantly, this is a linear combination of various constants that have been establishedwithin the design parameters, thus we may represent that linear combination with a singleconstant c i . For simplicity in what follows, we set C i = c i Q j = i b j so that cost of all wallsperpendicular to the i -th direction is C i Q j = i ( x j b j ) and the total cost is exactly: C = n X i =1 C i Y j = i ( x j b j )3 emma 1. If C i = 0 for any i , then the volume V can be made arbitrarily large.Proof. Without loss of generality, we assume C n = 0, then every term in our constraintequation contains a factor of x n . If we take x i = x for all i < n , and x n = C P i
When constructing a b × b × · · · × b n grid of rectangular n -dimensionalspaces subject to a fixed cost, C , the hypervolume is maximized when the cost of the wallsperpendicular to each direction is exactly Cn .Proof. Recall, from the method of Lagrange multipliers, we know that the maximum vol-ume, subject to our fixed cost constraint, should occur when, for all 1 ≤ i ≤ n , we have ∂V∂x i = λ ∂C∂x i for some parameter λ = 0. Thus, for any such i , we have ∂V∂x i = λ ∂C∂x i = ⇒ b i Y j = i ( x j b j ) = λ X k = i b i C k Y j = k,i ( x j b j ) Since V is zero whenever x i = 0 for any i , we will ignore these potential solutions andassume that x i > i . Thus, we may divide both sides by b i Q j = i ( x j b j ) to obtain1 = λ P k = i C k x k b k for each i . Equating the sums for two different indices, i = j , we have λ P k = i C k x k b k = λ P k = j C k x k b k which implies that C j x j b j = C i x i b i for all i and j . Thus, aftersubstituting, our equation becomes 1 = λ ( n − C i x i b i for all i . Hence, x i b i = λ ( n − C i forall i and we may substitute this fact into our cost equation to obtain C = n X i =1 C i Y j = i λ ( n − C j = nλ n − ( n − n − n Y i =1 C i . Moreover, isolating the cost of the walls that are perpendicular to the i -th direction gives C i Q j = i ( a j b j ) = C i Q j = i λ ( n − C j = λ n − ( n − n − C · · · C n , which is exactly Cn .4 orollary 1 (Surface Area) . When constructing a b × b × · · · × b n grid of rectangular n -dimensional spaces subject to a fixed amount of hypersurface area, S , the hypervolume ismaximized when the hypersurface area perpendicular to each direction is exactly Sn .Proof. ( b i + 1) counts the number of full-length walls – each with hypersurface area Q j = i ( a j b j ) – that are perpendicular to the i -th direction. Thus, setting C i = ( b i + 1)converts the cost equation to an equation for the total hypersurface area. If the goal is to maximize the enclosed space, we might want to consider other kindsof designs as well – for example, those that use non-rectangular shapes. Back in twodimensions, it is well-known that a single circular enclosure will give you the best ratio ofarea to perimeter. However, in creating multiple pens, those circular designs won’t be ableto share sides, which seems counterproductive. More precisely, given a fixed perimeter P to work with, the perimeter of k circular pens must satisfy P = 2 πrk , which implies thatthe enclosed area is A k ( ∞ ) = kπ (cid:18) P πk (cid:19) = P πk . If we choose to use regular n -sided polygons instead, then we can always create a chainof k of these polygons so that each shares a side with its neighbors, see Figure 3. Recallthat for a single pen, the ratio of area to perimeter grows with n . However, with multiplepens, the amount of shared perimeter shrinks as n grows. Our goal is thus to determinethe best balancing point for these counteractive forces. n = 7 , k = 2 n = 5 , k = 4 Figure 3: A chain of two heptagons, and a chain of four pentagons.It is well-known [4] that a regular n -sided polygon with side length s has area ns cot( πn )and a perimeter of ns . Thus, if we create a chain of k regular n -gons, then the total areaand perimeter are exactly: A = k · ns cot( πn ) and P = kns − ( k − s = s ( k ( n −
1) + 1)5olving for s in the perimeter equation and substituting, we find that (for a fixed integer k ∈ N ), the total area of this arrangement is A k ( n ) = P k · n cot( πn )[ k ( n −
1) + 1] ( n ≥ . In other words, given a fixed perimeter, P , with which to construct these pens, the areadepends only on which polygon we choose.If we consider A k ( x ) as a continuous function ( x ≥
3) rather than a discrete one, wemay take the derivative using the quotient rule. After multiplying the numerator anddenominator by sin ( πx ) and applying the double angle identity, we have: A ′ k ( x ) = P k · sin( πx )[1 − k ( x + 1)] + πx [ k ( x −
1) + 1]sin ( πx )[ k ( x −
1) + 1] Since x ≥
3, the sign of this derivative, for each k ∈ N , is completely determined by thesign of N k ( x ) := sin( πx )[1 − k ( x + 1)] + πx [ k ( x −
1) + 1]. This can be rearranged by puttingall terms with a k together to get: N k ( x ) = k (cid:20) ( n − πx − x + 12 sin (cid:18) πx (cid:19)(cid:21) + πx + 12 sin (cid:18) πx (cid:19) In order to explore N k ( x ) it will be helpful to replace the sine terms with rationalfunctions instead. It is well-known that sin( θ ) < θ for all θ >
0, thus sin( πx ) < πx for all x >
0. More important to our discussion, however, is the following result:
Lemma 2. sin (cid:0) πx (cid:1) > πx +1 for all x > . .Proof. Recall that the Taylor series representation of sine is ∞ X i =0 ( − i x i +1 (2 i + 1)! . Hence,using the second Taylor polynomial, sin (cid:0) πx (cid:1) > πx − π x for all x >
0. In addition, observethat πx +1 = πx − πx ( x +1) . Thus, it will follow that sin (cid:0) πx (cid:1) > πx +1 whenever π x < πx ( x +1) ,or rearranging, when 6 πx − π x − π x > x ≥ .
5. (Note: this inequality is not sharp)Applying Lemma 2 and the fact that sin( πx ) < πx , we have: D k ( x ) < k (cid:20) ( n − πx − x + 12 · πx + 1 (cid:21) + πx + 12 · πx = π (2 − k ) x for all x ≥ . D k ( x ) < A ′ k ( x ) <
0) for all x ≥ . k ≥
2. It follows that,for k ≥
2, we have A k ( n + 1) < A k ( n ) for all n ≥
8. Thus, for multiple pens, any polygonswith more than 8 sides will always be worse than options with fewer sides. In fact, for6hese polygons, the more sides they have, the less total area is enclosed. Now, only A k (3), A k (4), A k (5), A k (6), A k (7), and A k (8) are left to consider.Observe that A k ( n ) < A k ( m ) exactly when P k · n cot( πn )[ k ( n − < P k · m cot( πm )[ k ( m − , whichcan be rearranged as k ( m − k ( n − < r m cot( πm ) n cot( πn ) . As a function of k , the rational function onthe left is always increasing if m > n and always decreasing if m < n , so we need only findthe value of k (if any) at which this function passes the constant value to which it is beingcompared.Since we only care about positive integer values of k , we will refrain from reporting moreexact values for these inequalities. For example, A ( k ) < A ( k ) exactly when k +12 k +1 < q √ which is true for all k > / − − / ( ≈ − . A ( k ) < A ( k ) for all k ≥
1. Interpreting this conclusion, no matter how many pens wewish to build, it would always be better to use squares than equilateral triangles.Continuing in this way (again, reporting only positive integer values), one can showthat A k (8) < A k (7) for all k ≥ A k (7) < A k (6) for all k ≥
3, that A k (6) < A k (5) for all k ≥
3, and that A k (5) < A k (4) for all k ≥
5. Thus:
Theorem 2.
When given a fixed amount of perimeter to create a chain of k equal sizedpens out of regular n -gons, the area is maximized when using heptagons if k = 2 , pentagonsif k = 3 or , and squares for all k ≥ . Remark (Circles) . Recall that the limit as n goes to infinity of an n -gon is a circle. Thus,our exploration of the derivative of A k ( x ) above demonstrates that, using circles is worsethan using any regular polygon with 8 or more sides for all k ≥
2. Using the same techniqueas above, observe that P πk = A k ( ∞ ) < A k (4) = P k · k +1) exactly when q π < k k +1 which is true for all k ≥
2. Hence, given our comparisons above, using circles is worsethan using polygons with 4 or more sides as well for all k ≥
2. Interestingly however, A k ( ∞ ) < A k (3) when q π √ < k k +1 which is true only for k ≥
4. Thus, it is more efficientto use two or three circles than two or three triangles, in spite of the inability to share anyof the perimeter.
Of course, with equilateral triangles, squares, and regular hexagons we can do better byarranging our pens so that they share multiple sides. Harary and Harborth [3] proved,in each of these cases, that using a spiral pattern corresponds to the arrangement of k polygons with the most shared sides, see Figure 4.7 5 231 79111315 17 19 21 254 222 6 8101214 16 18 20 24 10 9 8 711 2 1 612 3 4 513 14 15 16 17 1 2345 6 7 89101112131415 16 17 18 19 20Figure 4: Spiral arrangements of 25 triangles, 17 squares, and 20 hexagons.In fact, they provide a formula for the number of sides in each arrangement: Proposition 1. [3, Theorems 2, 3, and 4](1)
The number of sides in a spiral arrangement of k triangles is k + ⌈ ( k + √ k ) ⌉ . (2) The number of sides in a spiral arrangement of k squares is k + ⌈ √ k ⌉ . (3) The number of sides in a spiral arrangement of k hexagons is k + ⌈√ k − ⌉ . In the discussion that follows, we’ll use A ∗ k ( n ) to denote the total area of each spiralarrangement of k triangles ( n = 3), squares ( n = 4), or hexagons ( n = 6). Of course, sincesharing additional sides is more efficient, it follows that A ∗ k ( n ) ≥ A k ( n ) for each n . By(1), we know that the number of sides for k triangles is always greater than or equal to (3 k + √ k ). The more sides we have, the shorter they’ll each have to be, hence with fixedperimeter P , we have side length s ≤ P k + √ k . This implies that the area of an arrangementof k triangles, which is equal to k · √ s , satisfies A ∗ k (3) ≤ √ k · (cid:18) P k + √ k (cid:19) = √ · kP (3 k + √ k ) . By (2), the number of sides for k squares is between 2 k + 2 √ k and 2 k + 2 √ k + 1, thuswith fixed perimeter P , we have side length P k +2 √ k +1 ≤ s ≤ P k +2 √ k . Hence, the area ofan arrangement of k squares ( k · s ) satisfies kP (2 k + 2 √ k + 1) ≤ A ∗ k (4) ≤ kP (2 k + 2 √ k ) . Finally, from (3), the number of sides for an arrangement of k hexagons is less than orequal to 3 k + √ k − s ≥ P k + √ k − and therefore, A ∗ k (6) ≥ √ · kP k + √ k − . A ∗ k (3) ≤ √ · kP (3 k + √ k ) < kP (2 k +2 √ k +1) ≤ A ∗ k (4)exactly when k +2 √ k +13 k + √ k < − / . This function of k is decreasing for all k >
0, is above3 − / when k = 4, and below 3 − / when k = 5. Thus, A ∗ k (3) < A ∗ k (4) for all k ≥ k ≤
5, we also have A ∗ k (3) = A k (3) < A k (4) ≤ A ∗ k (4) for k = 1,2, 3, and 4. Hence, A ∗ k (3) < A ∗ k (4) for all k ≥ A ∗ k (4) ≤ kP (2 k +2 √ k ) < √ · kP k + √ k − ≤ A ∗ k (6),exactly when k + √ k − k + √ k < / . This function is decreasing for all k ≥
1, is above108 / at k = 6 and below 108 / at k = 7. Thus, A ∗ k (4) < A ∗ k (6) for all k ≥
7. Inthe previous section, we showed that A ∗ k (4) = A k (4) < A k (6) = A ∗ k (6) for k = 1 and 2since these are just chains. For the rest, we can count the number of sides and comparedirectly: A ∗ (4) = P < √ P = A ∗ (6), and A ∗ (4) = P < √ P = A ∗ (6),and A ∗ (4) = P < √ P = A ∗ (6), and A ∗ (4) = P < √ P = A ∗ (6). Hence A ∗ k (4) < A ∗ k (6) for all k ≥ Theorem 3.
When given a fixed amount of perimeter to create an optimally packed ar-rangement of k equal sized pens, the area enclosed by hexagons will be larger than thatenclosed by squares, which in turn will be larger than that enclosed by equilateral trianglesfor all k ≥ . Moving up a dimension, suppose we want to create 3-dimensional enclosures with sharedsurfaces to save on materials. Mimicking our 2-dimensional efforts with regular polygons,we might restrict ourselves to using the platonic solids (tetrahedron, cube, octahedron, do-decahedron, and icosahedron). As above, we’ll refer to the total volume of an arrangementof k identical solids using the notation V k ( f ) where f counts the number of faces in a singlecopy. The formulas for volume and surface area in terms of side length are well-known andallow us to represent the volume of each solid in terms of its surface area, A . In each case,the volume of a single solid is proportional to A / , thus, for simplicity in what follows wewill use q f to denote the reciprocal of the proportionality constant so that V ( f ) = A / q f for each solid ( f = 4, 6, 8, 12, or 20). Here are the specific proportionality constants:(tetrahedron) q = 6 q √ , (cube) q = 6 √ , (octahedron) q = 6 q √ q = 6 p − √ · (225 + 90 √ / √ , (ico) q = 12 p √
33 + √ q > q > q > q > q , thus the icosahedron gives the best ratio ofvolume to surface area for a single pen, followed by a dodecahedron, octahedron, cube,9nd tetrahedron. Just as before though, if we create a chain of k such pens with each pensharing a single face with its neighbors, then there will be a trade off between enclosingmore volume and sharing more surface area.The total surface area for a k -length chain is exactly kf − ( k − f A , where f is the numberof faces in the given solid and A is the surface area of a single solid. Thus, given a fixedamount of total surface area, T , to work with, we may split that surface area up so thateach individual solid gets A = T fk ( f − (double counting the shared faces). Using thesurface area A , we can then calculate the volume of a single solid and scale by k to obtainthe total volume for the entire chain. For example, with a chain of two tetrahedra ( k = 2, f = 4), we have A = T and therefore the total volume is V (4) = 2 · ( T ) / √ √ = T / √ √ .When comparing two different solids with f and F faces respectively, one can rearrangethe inequalities as in the previous sections so that: V k ( f ) < V k ( F ) ⇐⇒ k ( F −
1) + 1 k ( f −
1) + 1 < Ff (cid:18) q f q F (cid:19) / . This leaves us with a constant on the right of the inequality and a function of k which isincreasing for all k ≥ F > f and decreasing for all k ≥ F < f . Hence, onceagain, there is at most one value of k for which the two sides are equal.For example, when comparing the tetrahedron and the cube, we have V k (4) < V k (6) ifand only if k +13 k +1 < (cid:18) √ √ √ (cid:19) / = / , which is true for all k ≥
1. On the other hand, k +15 k +1 < (cid:0) (cid:1) / when k = 67 and k +15 k +1 > (cid:0) (cid:1) / when k = 68, so (reporting integer valuesonly) V k (6) < V k (8) if and only if k ≤
67. Similar arguments show that V k (8) < V k (12) forall k ≥
1, that V k (6) < V k (12) for all k ≥
1, that V k (12) < V k (20) if and only if k ≤
8, that V k (8) < V k (20) for all k ≥
1, and that V k (6) < V k (20) for all k ≥
1. Hence:
Theorem 4.
When given a fixed amount of surface area to create a chain of k equal sizedplatonic solid pens, the choices can be ordered by volume contained (from most to least) asfollows: For k ≤ ≤ k ≤
67 For k ≥ Icosahedron Dodecahedron DodecahedronDodecahedron Icosahedron IcosahedronOctahedron Octahedron CubeCube Cube OctahedronTetrahedron Tetrahedron Tetrahedron
Remark (Spheres) . The volume of a sphere in terms of its surface area is A / √ π , thus, for achain of k spheres, we have A = Tk and hence V k ( ∞ ) = k · ( Tk ) / √ π = T / √ πk . Using a similar10rocedure, we observe that V k (12) < V k ( ∞ ) when k k +1 < (cid:16) q √ π (cid:17) / , which is true forall k ≥
1, and V k (20) < V k ( ∞ ) when k k +1 < (cid:16) q √ π (cid:17) / , which is also true for all k ≥ Conclusions and Future Research
The author’s initial question was whether – regardless of the design/arrangement of the ( n -dimensional) pens – it is optimal for the walls in each of the n directions to receive exactly n of the allotted boundary. Corollary 1 proves that this is the case for arrangementsof rectangular pens for all n ≥
2. In studying the related question of how to maximizethe enclosed space using regular polygons and platonic solids, the regularity makes thisinitial question somewhat nonsensical as the side lengths cannot be adjusted to take betteradvantage of the shared sides/faces. If we allow ourselves to consider non-regular shapeshowever, then the initial question again becomes more relevant. For example, it is well-known (see e.g. [1]) that for a single n -sided shape, the area is maximized when thatshape is regular (hence each direction gets an equal amount of the perimeter). The authorhas already begun to study the case of multiple, non-regular triangles, where the answerappears to depend on the particular arrangement, and hopes to share this work in a futureinstallment. References [1] G.D. Chakerian,
A Distorted View of Geometry , Chapter 7 in
Mathematical Plums (R.Honsberger, editor), MAA, Washington D.C., (1979)[2] William Anthony Granville,
Elements of the Differential and Integral Calculus , Ginn,Boston, (1904).[3] Frank Harary and Heiko Harborth,
Extremal animals , Journal of Combinatorics, Infor-mation and System Sciences, , no. 1, pp 1–8, (1976).[4] Roger A. Johnson, Modern Geometry , Houghton Mifflin, New York, (1929).[5] G.E.F. Sherwood and Angus E. Taylor,
Calculus: Revised Edition , Prentice-Hall, NewYork, (1946)[6] Laura Taalman and Peter Kohn,