{"id":3571,"date":"2022-11-11T09:12:15","date_gmt":"2022-11-11T15:12:15","guid":{"rendered":"https:\/\/laurentlessard.com\/bookproofs\/?p=3571"},"modified":"2022-11-11T23:33:33","modified_gmt":"2022-11-12T05:33:33","slug":"randomly-cutting-a-sandwich","status":"publish","type":"post","link":"https:\/\/laurentlessard.com\/bookproofs\/randomly-cutting-a-sandwich\/","title":{"rendered":"Randomly cutting a sandwich"},"content":{"rendered":"<p>This week&#8217;s <a href=\"https:\/\/fivethirtyeight.com\/features\/when-will-the-fall-colors-peak\/\">Riddler Classic<\/a> is geometry puzzle about randomly slicing a square sandwich.<\/p>\n<blockquote><p>I have made a square sandwich, and now it&#8217;s time to slice it. But rather than making a standard horizontal or diagonal cut, I instead pick two random points along the perimeter of the sandwich and make a straight cut from one point to the other. (These points can be on the same side.)<\/p>\n<p>What is the probability that the smaller resulting piece has an area that is at least one-quarter of the whole area?<\/p><\/blockquote>\n<p>My solution:<br \/>\n<a href=\"javascript:Solution('soln_sandwichcut','toggle_sandwichcut')\" id=\"toggle_sandwichcut\">[Show Solution]<\/a><\/p>\n<div id=\"soln_sandwichcut\" style=\"display: none\">\n<p>Suppose the sandwich has side length 1. Let $t \\in [0,1]$ be location of the first point (measured from a corner). We have three cases to consider:<\/p>\n<ol>\n<li> If the second point is on the same side (probability $\\frac{1}{4}$), the area of the resulting smallest piece will be zero.\n<li> If the second point is on an adjacent side (probability $\\frac{1}{2}$), the area of the resulting smallest piece will be $\\frac{1}{2}tr$, where $r \\in [0,1]$ is the location of the second point on the adjacent side.\n<li> If the second point is on the opposite side (probability $\\frac{1}{4}$), the area of the resulting piece will be the smaller of the two resulting quadrilaterals. Specifically, it will be $\\min(\\frac{t+r}{2},1-\\frac{t+r}{2})$, where $r \\in [0,1]$ is the location of the second point on the opposite side.\n<\/ol>\n<p>We will solve the general case, which is to find the probability that the smallest slice will have a fraction at least $p$ of the total area. the problem asks for $p=\\frac{1}{4}$. Since the total area of the square is $1$, we are effectively asking: &#8220;what is the probability that the smallest area is at least $p$?&#8221;.<\/p>\n<p><strong>Case 1.<\/strong> If we are in the first case (points on the same side), the probability that the area is greater than $p$ is zero, since the area is always zero. So we conclude that:<br \/>\n\\[<br \/>\na_1 = 0<br \/>\n\\]<\/p>\n<p><strong>Case 2.<\/strong> If we are in the second case (points on an adjacent sides), we want the probability that $\\frac{1}{2}tr > p$, where $r$ and $t$ are chosen uniformly at random in $[0,1]$. This amounts to computing:<br \/>\n\\begin{align}<br \/>\na_2 &#038;= \\int_0^1 \\int_0^1 \\mathbf{1}\\bigl( \\tfrac{1}{2}tr \\gt p \\bigr)\\,\\mathrm{d}r\\,\\mathrm{d}t \\\\<br \/>\n&#038;= \\int_{2p}^1 \\int_0^1 \\mathbf{1}\\bigl(r \\gt \\tfrac{2p}{t} \\bigr)\\,\\mathrm{d}r\\,\\mathrm{d}t \\\\<br \/>\n&#038;= \\int_{2p}^1 \\left( 1-\\frac{2p}{t}\\right)\\,\\mathrm{d}t \\\\<br \/>\n&#038;= 1-2p+2p\\log(2p)<br \/>\n\\end{align}Note that we had to change the lower bound of the integral for $t$ because when $t \\lt 2p$, we have $\\tfrac{2p}{t}\\gt 1$, so the integrand is zero. Geometrically, this is the fraction of the region $(t,r)\\in[0,1]^2$ where $tr\\gt p^2$, sketched below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/11\/sandwich_slice_case2.png\" alt=\"\" width=\"523\" height=\"544\" class=\"aligncenter size-full wp-image-3579\" srcset=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/11\/sandwich_slice_case2.png 523w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/11\/sandwich_slice_case2-288x300.png 288w\" sizes=\"auto, (max-width: 523px) 85vw, 523px\" \/><\/p>\n<p><strong>Case 3.<\/strong> If we are in the third case (points on opposite sides), we perform a similar computation with the area of the quadrilateral:<br \/>\n\\begin{align}<br \/>\na_3 &#038;= \\int_0^1 \\int_0^1 \\mathbf{1}\\bigl( \\min(\\tfrac{t+r}{2},1-\\tfrac{t+r}{2}) \\gt p \\bigr)\\,\\mathrm{d}r\\,\\mathrm{d}t \\\\<br \/>\n&#038;= \\int_0^1 \\int_0^1 \\mathbf{1}\\bigl( \\tfrac{t+r}{2}\\gt p\\text{ and } 1-\\tfrac{t+r}{2} \\gt p \\bigr) \\,\\mathrm{d}r\\,\\mathrm{d}t \\\\<br \/>\n&#038;= \\int_0^1 \\int_0^1 \\mathbf{1}\\bigl( p \\lt \\tfrac{t+r}{2} \\lt 1-p\\bigr) \\,\\mathrm{d}r\\,\\mathrm{d}t \\\\<br \/>\n&#038;= \\int_0^1 \\int_0^1 \\mathbf{1}\\bigl( 2p \\lt t+r \\lt 2-2p\\bigr) \\,\\mathrm{d}r\\,\\mathrm{d}t \\\\<br \/>\n&#038;= 1-4p^2<br \/>\n\\end{align}A trick to evaluating the above integral is to do it geometrically. Sketching the region for which $2p\\lt t+r\\lt 2-2p$, we see that it is the square of area $1$ with the two corners cut off, whose area is $(2p)^2$, so the result is $1-4p^2$. See below for an illustration.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/11\/sandwich_slice_case3.png\" alt=\"\" width=\"517\" height=\"539\" class=\"aligncenter size-full wp-image-3580\" srcset=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/11\/sandwich_slice_case3.png 517w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/11\/sandwich_slice_case3-288x300.png 288w\" sizes=\"auto, (max-width: 517px) 85vw, 517px\" \/><\/p>\n<p>Putting everything together, the probability that the area of the smallest piece is at least $p$ is given by sum of the probabilities we already calculated, each weighted by their likelihood of occurrence, so $f(p) =  \\frac{1}{4}a_1 + \\frac{1}{2}a_2 + \\frac{1}{4}a_3$. Plugging in the results from above and simplifying, we obtain our final answer:<\/p>\n<p style=\"text-align: center;\"><span style=\"background-color: #AFC8E6; padding: 25px 10px 25px 10px;\">$\\displaystyle<br \/>\nf(p) = \\frac{3}{4}-p-p^2+p \\log (2 p)<br \/>\n$<\/span><\/p>\n<p>Here is what the function looks like:<\/p>\n<p><a href=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/11\/sandwich_slice_plot.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/11\/sandwich_slice_plot.png\" alt=\"\" width=\"578\" height=\"416\" class=\"aligncenter size-full wp-image-3578\" srcset=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/11\/sandwich_slice_plot.png 578w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/11\/sandwich_slice_plot-300x216.png 300w\" sizes=\"auto, (max-width: 578px) 85vw, 578px\" \/><\/a><\/p>\n<p>Naturally, the plot only extends to $p=\\frac{1}{2}$ because the area of the smaller piece cannot be more than half of the total area. When $p=\\frac{1}{4}$ (what the original problem asked about), we obtain $f(\\frac{1}{4}) = \\frac{7}{16}-\\frac{\\log (2)}{4}\\approx 0.264213$. So the probability that the smaller piece is at least one quarter of the whole area is about 26.4%.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This week&#8217;s Riddler Classic is geometry puzzle about randomly slicing a square sandwich. I have made a square sandwich, and now it&#8217;s time to slice it. But rather than making a standard horizontal or diagonal cut, I instead pick two random points along the perimeter of the sandwich and make a straight cut from one &hellip; <a href=\"https:\/\/laurentlessard.com\/bookproofs\/randomly-cutting-a-sandwich\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Randomly cutting a sandwich&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3578,"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":[28,10,8,2],"class_list":["post-3571","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-riddler","tag-calculus","tag-geometry","tag-probability","tag-riddler"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/3571","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=3571"}],"version-history":[{"count":11,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/3571\/revisions"}],"predecessor-version":[{"id":3587,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/3571\/revisions\/3587"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/media\/3578"}],"wp:attachment":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/media?parent=3571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/categories?post=3571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/tags?post=3571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}