{"id":1873,"date":"2017-03-19T16:55:34","date_gmt":"2017-03-19T21:55:34","guid":{"rendered":"http:\/\/www.laurentlessard.com\/bookproofs\/?p=1873"},"modified":"2017-03-20T10:48:47","modified_gmt":"2017-03-20T15:48:47","slug":"convex-ranches","status":"publish","type":"post","link":"https:\/\/laurentlessard.com\/bookproofs\/convex-ranches\/","title":{"rendered":"Convex ranches"},"content":{"rendered":"<p>This <a href=\"https:\/\/fivethirtyeight.com\/features\/can-you-find-the-honest-prince\/\">Riddler puzzle<\/a> is about randomly generating convex quadrilaterals.<\/p>\n<blockquote><p>Consider four square-shaped ranches, arranged in a two-by-two pattern, as if part of a larger checkerboard. One family lives on each ranch, and each family builds a small house independently at a random place within the property. Later, as the families in adjacent quadrants become acquainted, they construct straight-line paths between the houses that go across the boundaries between the ranches, four in total. These paths form a quadrilateral circuit path connecting all four houses. This circuit path is also the boundary of the area where the families\u2019 children are allowed to roam.<\/p>\n<p>What is the probability that the children are able to travel in a straight line from any allowed place to any other allowed place without leaving the boundaries? (In other words, what is the probability that the quadrilateral is convex?)<\/p><\/blockquote>\n<p>Here is my solution:<br \/>\n<a href=\"javascript:Solution('soln_cvxquad','toggle_cvxquad')\" id=\"toggle_cvxquad\">[Show Solution]<\/a><\/p>\n<div id=\"soln_cvxquad\" style=\"display: none\">\n<p>The only way the quadrilateral can be nonconvex is if one of its vertices is &#8220;inward&#8221;. In other words, an internal angle of the quadrilateral is greater than 180 degrees. The figure below shows an example of a nonconvex case (on the left) and a convex case (on the right). For the nonconvex example, the vertex labeled K is inward.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad1-1024x491.png\" alt=\"\" width=\"840\" height=\"403\" class=\"aligncenter size-large wp-image-1876\" srcset=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad1-1024x491.png 1024w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad1-300x144.png 300w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad1-768x368.png 768w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad1-1200x575.png 1200w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad1.png 2044w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>It&#8217;s clear that at most one vertex can be inward. So, by symmetry, we can write the following statement regarding the probability of the quadrilateral being convex.<br \/>\n\\begin{align}<br \/>\n\\mathbb{P}(\\text{convex}) &#038;= 1-\\mathbb{P}(\\text{nonconvex}) \\\\<br \/>\n&#038;= 1-\\mathbb{P}(\\text{one vertex is inward})\\\\<br \/>\n&#038;= 1-4\\cdot\\mathbb{P}(\\text{a particular vertex is inward})<br \/>\n\\end{align}So let&#8217;s calculate the probability of a particular vertex being inward. This only depends on the positions of the two adjacent vertices. Consider the diagram below and opposite vertices $J(-a,b)$ and $L(p,-q)$ where $0 \\le a,b,p,q \\le 1$ are the coordinates. The vertex $K(u,v)$ with $0 \\le u,v \\le 1$ will be inward if it ends up in the shaded triangle. The probability of this occurring is equal to the area of the triangle.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad2-1-1024x702.png\" alt=\"\" width=\"840\" height=\"576\" class=\"aligncenter size-large wp-image-1879\" srcset=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad2-1-1024x702.png 1024w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad2-1-300x206.png 300w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad2-1-768x526.png 768w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad2-1-1200x822.png 1200w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2017\/03\/cvxquad2-1.png 1525w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>Since we&#8217;d like to find the total probability of $K$ being inward, we must find the expected area of the shaded triangle with respect to the points $J$ and $L$ being uniformly randomly chosen in their respective regions. The area is $A=\\tfrac{1}{2}xy$ where $x$ and $y$ are the intersections with the axes indicated. Calculating $x$ and $y$ amounts to finding the intersection of the line segment $JL$ with the axes. A bit of algebra reveals the formula:<br \/>\n\\[<br \/>\nx = \\frac{bp-aq}{b+q},<br \/>\n\\qquad<br \/>\ny = \\frac{bp-aq}{a+p}<br \/>\n\\]To find the expected area, we integrate $\\frac{1}{2}xy$ over $0\\le a,b,p,q \\le 1$. We must take care to account for the case where $x$ and $y$ are both negative, which we do by dividing the result by $2$. Finally, we substitute the result into the formula for the probability of convexity and we obtain:<br \/>\n\\begin{align}<br \/>\n\\mathbb{P}(\\text{convex}) &#038;= 1-4\\cdot\\mathbb{P}(\\text{vertex }K\\text{ is inward})\\\\<br \/>\n&#038;= 1-4 \\int_0^1\\int_0^1\\int_0^1\\int_0^1 \\frac{1}{2}\\cdot\\frac{1}{2}\\,x\\,y\\,\\,\\mathrm{d}a\\,\\mathrm{d}b\\,\\mathrm{d}p\\,\\mathrm{d}q\\\\<br \/>\n&#038;= 1-\\int_0^1\\int_0^1\\int_0^1\\int_0^1 \\frac{(bp-aq)^2}{(a+p)(b+q)}\\,\\mathrm{d}a\\,\\mathrm{d}b\\,\\mathrm{d}p\\,\\mathrm{d}q\\\\<br \/>\n&#038;=\\frac{1}{6}(11-8\\log2)\\\\<br \/>\n&#038;\\approx 0.909137<br \/>\n\\end{align}So the probability that the quadrilateral is convex is about 90.9%.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This Riddler puzzle is about randomly generating convex quadrilaterals. Consider four square-shaped ranches, arranged in a two-by-two pattern, as if part of a larger checkerboard. One family lives on each ranch, and each family builds a small house independently at a random place within the property. Later, as the families in adjacent quadrants become acquainted, &hellip; <a href=\"https:\/\/laurentlessard.com\/bookproofs\/convex-ranches\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Convex ranches&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1876,"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,8,2],"class_list":["post-1873","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-riddler","tag-geometry","tag-probability","tag-riddler"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/1873","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=1873"}],"version-history":[{"count":13,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/1873\/revisions"}],"predecessor-version":[{"id":1875,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/1873\/revisions\/1875"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/media\/1876"}],"wp:attachment":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/media?parent=1873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/categories?post=1873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/tags?post=1873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}