{"id":2906,"date":"2020-08-21T16:23:10","date_gmt":"2020-08-21T21:23:10","guid":{"rendered":"https:\/\/laurentlessard.com\/bookproofs\/?p=2906"},"modified":"2020-08-21T16:55:37","modified_gmt":"2020-08-21T21:55:37","slug":"polygons-with-perimeter-and-vertex-budgets","status":"publish","type":"post","link":"https:\/\/laurentlessard.com\/bookproofs\/polygons-with-perimeter-and-vertex-budgets\/","title":{"rendered":"Polygons with perimeter and vertex budgets"},"content":{"rendered":"<p>his week&#8217;s <a href=\"https:\/\/fivethirtyeight.com\/features\/can-you-corral-your-hamster\/\">Riddler Classic<\/a> involves designing maximum-area polygons with a fixed budget on the length of the perimeter and the number of vertices. The original problem involved designing enclosures for hamsters, but I have paraphrased the problem to make it more concise.<\/p>\n<blockquote><p>\nYou want to build a polygonal enclosure consisting of posts connected by walls. Each post weighs $k$ kg. The walls weigh $1$ kg per meter. You are allowed a maximum budget of $1$ kg for the posts and walls.<\/p>\n<p>What\u2019s the greatest value of $k$ for which you should use four posts rather than three?<\/p>\n<p><em>Extra credit:<\/em> For which values of $k$ should you use five posts, six posts, seven posts, and so on?\n<\/p><\/blockquote>\n<p>Here is my solution:<br \/>\n<a href=\"javascript:Solution('soln_hamster_enclosure','toggle_hamster_enclosure')\" id=\"toggle_hamster_enclosure\">[Show Solution]<\/a><\/p>\n<div id=\"soln_hamster_enclosure\" style=\"display: none\">\n<p>For a fixed perimeter, the maximum-area polygon with $n$ sides is a <em>regular<\/em> polygon. Since we are interested in maximizing area, we should therefore always use regular polygons as our shape, and we should always use our entire mass budget of $1$ kg.<\/p>\n<p>Let&#8217;s assume the weight of the posts $k$ is given and fixed. If the perimeter is $p$ and the number of sides is $n$, the formula for the area of a regular $n$-gon is as follows (<a href=\"https:\/\/www.mathopenref.com\/polygonregularareaderive.html\">explanation here<\/a>).<br \/>\n\\[<br \/>\nA = \\frac{p^2}{4n \\tan\\frac{\\pi}{n}}<br \/>\n\\]Our total budget constraint is that $p + kn \\leq 1$. Since our goal is to maximize area we should always use our entire budget. So $p = 1-kn$. This means that $n \\leq \\frac{1}{k}$ in order to ensure we respect the weight budget. So for a fixed $k$, the maximum area of an $n$-gon enclosure is given by the formula<\/p>\n<p style=\"text-align: center;\"><span style=\"background-color: #AFC8E6; padding: 25px 10px 25px 10px;\">$\\displaystyle<br \/>\nA = \\frac{(1-kn)^2}{4n\\tan\\frac{\\pi}{n}}\\qquad\\text{for: }2\\leq n \\leq \\frac{1}{k}<br \/>\n$<\/span><\/p>\n<p>Let&#8217;s talk about limiting cases for a moment.<\/p>\n<ul>\n<li>If $n=2$, we have $\\tan(\\pi\/n) = \\infty$ so $A=0$. This makes sense; an enclosure with only two sides will be flat and have zero area.\n<li>If $k\\to 0$ we can take $n\\to\\infty$. A polygon with infinitely many sides but a fixed perimeter is simply a circle, so let&#8217;s see if this checks out. Using the fact that $\\lim_{n\\to\\infty} n \\tan\\tfrac{\\pi}{n} = \\pi$, we obtain a total area of $A = \\tfrac{1}{4\\pi}$. This is precisely the area of a circle with perimeter $1$! Indeed, if $2\\pi r = 1$, then we obtain $r = \\frac{1}{2\\pi}$ and therefore $A = \\pi r^2 = \\frac{1}{4\\pi}$.\n<\/ul>\n<p>So for each $k$, we should choose the $n \\in \\{2,3,4,\\dots,\\lfloor \\tfrac{1}{k}\\rfloor\\}$ that maximizes $A$. Here is a plot showing plots of $A$ for each $n$ and $k$. When $k$ is large (posts weigh a lot), we try to use as few of them as possible. So at first, the triangle ($n=3$) is best. As we decrease $k$, it eventually becomes more efficient to use a square ($n=4$), and so on. As $k$ goes to zero, we obtain the solution with $n\\to\\infty$, which is the circular enclosure discussed above.<\/p>\n<p><a href=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2020\/08\/hamster.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2020\/08\/hamster-1024x595.png\" alt=\"\" width=\"840\" height=\"488\" class=\"aligncenter size-large wp-image-2936\" srcset=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2020\/08\/hamster-1024x595.png 1024w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2020\/08\/hamster-300x174.png 300w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2020\/08\/hamster-768x446.png 768w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2020\/08\/hamster-1536x892.png 1536w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2020\/08\/hamster-2048x1189.png 2048w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2020\/08\/hamster-1200x697.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<p>To find out where the transition occurs between $n$ and $n+1$, we should look for the value of $k$ at which the areas match (indicated by the black dots on the plot). So we want to find $k$ such that:<br \/>\n\\[<br \/>\n\\frac{(1-kn)^2}{4n\\tan\\frac{\\pi}{n}} = \\frac{(1-k(n+1))^2}{4(n+1)\\tan \\frac{\\pi}{n+1}}<br \/>\n\\]Solving this equation for $k$, we obtain:<\/p>\n<p style=\"text-align: center;\"><span style=\"background-color: #AFC8E6; padding: 40px 10px 40px 10px;\">$\\displaystyle<br \/>\nk_n = \\frac{ \\sqrt{n \\tan \\frac{\\pi}{n}}-\\sqrt{(n+1) \\tan \\frac{\\pi}{n+1}} }{ (n+1)\\sqrt{n \\tan \\frac{\\pi}{n}}-n\\sqrt{(n+1) \\tan \\frac{\\pi}{n+1}} }<br \/>\n$<\/span><\/p>\n<p>We can interpret this formula as follows: $k_n$ is the smallest value of $k$ for which we should use $n$ posts in our enclosure. So if we make $k$ smaller, it becomes more efficient to use $(n+1)$ posts instead. Here are the first few numerical values of $k_n$:<\/p>\n<table style=\"width: 100%\">\n<colgroup>\n<col span=\"1\" style=\"width: 15%;\">\n<col span=\"1\" style=\"width: 25%;\">\n<col span=\"1\" style=\"width: 60%;\">\n    <\/colgroup>\n<thead>\n<tr>\n<th>$n$<\/th>\n<th>$k_n$<\/th>\n<th>Range of $k$ for this $n$<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>$2$<\/td>\n<td>$0.333333$<\/td>\n<td>$0.333333 \\leq k$<\/td>\n<\/tr>\n<tr>\n<td>$3$<\/td>\n<td>$0.089642$<\/td>\n<td>$0.089642 \\leq k \\leq 0.333333$<\/td>\n<\/tr>\n<tr>\n<td>$4$<\/td>\n<td>$0.039573$<\/td>\n<td>$0.039573 \\leq k \\leq 0.089642$<\/td>\n<\/tr>\n<tr>\n<td>$5$<\/td>\n<td>$0.021016$<\/td>\n<td>$0.021016 \\leq k \\leq 0.039573$<\/td>\n<\/tr>\n<tr>\n<td>$6$<\/td>\n<td>$0.012511$<\/td>\n<td>$0.012511 \\leq k \\leq 0.021016$<\/td>\n<\/tr>\n<tr>\n<td>$7$<\/td>\n<td>$0.008056$<\/td>\n<td>$0.008056 \\leq k \\leq 0.012511$<\/td>\n<\/tr>\n<tr>\n<td>$8$<\/td>\n<td>$0.005494$<\/td>\n<td>$0.005494 \\leq k \\leq 0.008056$<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>his week&#8217;s Riddler Classic involves designing maximum-area polygons with a fixed budget on the length of the perimeter and the number of vertices. The original problem involved designing enclosures for hamsters, but I have paraphrased the problem to make it more concise. You want to build a polygonal enclosure consisting of posts connected by walls. &hellip; <a href=\"https:\/\/laurentlessard.com\/bookproofs\/polygons-with-perimeter-and-vertex-budgets\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Polygons with perimeter and vertex budgets&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2936,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[7],"tags":[10,26,2],"class_list":["post-2906","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-riddler","tag-geometry","tag-optimization","tag-riddler"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/2906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/comments?post=2906"}],"version-history":[{"count":20,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/2906\/revisions"}],"predecessor-version":[{"id":2937,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/2906\/revisions\/2937"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/media\/2936"}],"wp:attachment":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/media?parent=2906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/categories?post=2906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/tags?post=2906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}