<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/le-monde-puzzle-1707/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://xianblog.wordpress.com/2017/07/28/le-monde-puzzle-1707/"> R – Xi'an's Og</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><strong><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRsQd3v7efgSlmsNPKddzl-oQS9fZOF8a68V6KPmf5dnmI_EJ66rw" alt="" width="273" height="185">A</strong> geometric <a rel="nofollow" href="https://xianblog.wordpress.com/2011/09/03/le-monde-puzzle-website/" title="Le Monde puzzle [website]" target="_blank">Le Monde mathematical puzzle</a>:</p>
<ol>
<li><em>Given a pizza of diameter 20cm, what is the way to cut it by two perpendicular lines through a point distant 5cm from the centre towards maximising the surface of two opposite slices? </em></li>
<li><em> Using the same point as the tip of the four slices, what is the way to make four slices with equal arcs in four cuts from the tip again towards maximising the surface of two opposite slices?<br>
</em></li>
</ol>
<p><strong>F</strong>or both questions, I did not bother with the maths but went itself to a discretisation of the disk, counting the proportion of points within two opposite slices and letting the inclination of these slices move from zero to π/2. Unsurprisingly, for the first question, the answer is π/4, given that there is no difference between both surfaces at angles 0 and π/2. My R code is as follows, using (5,0) as the tip:</p>
<pre>M=100
surfaz=function(alpha){
surfz=0
cosal=cos(alpha);sinal=sin(alpha)
X=Y=seq(-10,10,le=M)
Xcosal=(X-5)*cosal
Xsinal=(X-5)*sinal
for (i in 1:M){
norm=sqrt(X[i]^2+Y^2)
scal1=Xsinal[i]+Y*cosal
scal2=-Xcosal[i]+Y*sinal
surfz=surfz+sum((norm&lt;=10)*(scal1*scal2>0))}
return(4*surfz/M/M/pi)}
</pre>
<p><a rel="nofollow" href="https://xianblog.files.wordpress.com/2017/07/lemonde10172.jpg" target="_blank"><img data-orig-file="https://xianblog.files.wordpress.com/2017/07/lemonde10172.jpg?w=333&amp;h=333&amp;fit=333%2C333&amp;resize=333%2C333" data-orig-size="480,480" data-medium-file="https://xianblog.files.wordpress.com/2017/07/lemonde10172.jpg?w=333&amp;h=333&amp;fit=333%2C333&amp;resize=333%2C333?w=300" data-attachment-id="33960" data-image-meta="{" data-image-description="" src="https://xianblog.files.wordpress.com/2017/07/lemonde10172.jpg?w=333&h=333&fit=333%2C333&resize=333%2C333" data-permalink="https://xianblog.wordpress.com/2017/07/28/le-monde-puzzle-1707/lemonde10172/" data-large-file="https://xianblog.files.wordpress.com/2017/07/lemonde10172.jpg?w=333&amp;h=333&amp;fit=333%2C333&amp;resize=333%2C333?w=450" alt="" data-image-title="" sizes="(max-width: 333px) 100vw, 333px" data-comments-opened="1" class="wp-image-33960" data-recalc-dims="1"></a>The second puzzle can be solved by a similar code, except that the slice area between two lines has to be determined by a cross product:</p>
<pre>surfoz=function(alpha,ploz=FALSE){
  sinal=sin(alpha);cosal=cos(alpha)
  X=Y=seq(-10,10,le=M)
  frsterm=cosal*(10*cosal-5)+sinal*(10*sinal-5)
  trdterm=cosal*(10*cosal+5)+sinal*(10*sinal+5)
  surfz=0
  for (i in 1:M){
    norm=sqrt(X[i]^2+Y^2)
    scal1=(10*(Y[i]-5)*cosal-(10*sinal-5)*X)*frsterm
    scal2=-(-10*(Y[i]-5)*sinal-(10*cosal-5)*X)*frsterm
    scal3=(-10*(Y[i]-5)*cosal+(10*sinal+5)*X)*trdterm
    scal4=-(10*(Y[i]-5)*sinal+(10*cosal+5)*X)*trdterm
    surfz=surfz+sum((norm&lt;=10)* 
    ((scal1>0)*(scal2>0)+
     (scal3>0)*(scal4>0)))}
 return(4*surfz/M/M/pi)}
</pre>
<p><a rel="nofollow" href="https://xianblog.files.wordpress.com/2017/07/lemonde10171.jpg" target="_blank"><img data-orig-file="https://xianblog.files.wordpress.com/2017/07/lemonde10171.jpg?w=321&amp;h=321&amp;fit=321%2C321&amp;resize=321%2C321" data-orig-size="480,480" data-medium-file="https://xianblog.files.wordpress.com/2017/07/lemonde10171.jpg?w=321&amp;h=321&amp;fit=321%2C321&amp;resize=321%2C321?w=300" data-attachment-id="33961" data-image-meta="{" data-image-description="" src="https://xianblog.files.wordpress.com/2017/07/lemonde10171.jpg?w=321&h=321&fit=321%2C321&resize=321%2C321" data-permalink="https://xianblog.wordpress.com/2017/07/28/le-monde-puzzle-1707/lemonde10171/" data-large-file="https://xianblog.files.wordpress.com/2017/07/lemonde10171.jpg?w=321&amp;h=321&amp;fit=321%2C321&amp;resize=321%2C321?w=450" alt="" data-image-title="lemonde10171" sizes="(max-width: 321px) 100vw, 321px" data-comments-opened="1" class="wp-image-33961" data-recalc-dims="1"></a></p>
<p>a code that shows that <em>all</em> cuts lead to identical surfaces for bot sets of slices. A fairly surprising result!</p>
<p> </p>
<p>Filed under: <a rel="nofollow" href="https://xianblog.wordpress.com/category/books/" target="_blank">Books</a>, <a rel="nofollow" href="https://xianblog.wordpress.com/category/kids/" target="_blank">Kids</a>, <a rel="nofollow" href="https://xianblog.wordpress.com/category/statistics/r-statistics/" target="_blank">R</a> Tagged: <a rel="nofollow" href="https://xianblog.wordpress.com/tag/competition/" target="_blank">competition</a>, <a rel="nofollow" href="https://xianblog.wordpress.com/tag/geometry/" target="_blank">geometry</a>, <a rel="nofollow" href="https://xianblog.wordpress.com/tag/le-monde/" target="_blank">Le Monde</a>, <a rel="nofollow" href="https://xianblog.wordpress.com/tag/mathematical-puzzle/" target="_blank">mathematical puzzle</a>, <a rel="nofollow" href="https://xianblog.wordpress.com/tag/optimisation/" target="_blank">optimisation</a>, <a rel="nofollow" href="https://xianblog.wordpress.com/tag/r/" target="_blank">R</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xianblog.wordpress.com/33959/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/comments/xianblog.wordpress.com/33959/"></a> <img border="0" alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" data-recalc-dims="1"></p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://xianblog.wordpress.com/2017/07/28/le-monde-puzzle-1707/"> R – Xi'an's Og</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/glvcg7kv9Uo" height="1"></a></div>