<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/spacings-on-a-torus/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://xianblog.wordpress.com/2018/03/22/spacings-on-a-torus/"> 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><a rel="nofollow" href="https://i1.wp.com/warwick.ac.uk/fac/sci/statistics/staff/academic-research/kendall/personal/abstracts/dead/leaf.gif?ssl=1" target="_blank"><img width="400" src="https://i1.wp.com/warwick.ac.uk/fac/sci/statistics/staff/academic-research/kendall/personal/abstracts/dead/leaf.gif?resize=400%2C74&ssl=1" data-recalc-dims="1" height="74"></a><a rel="nofollow" href="https://i2.wp.com/warwick.ac.uk/fac/sci/statistics/staff/academic-research/kendall/personal/abstracts/dead/leaf63.gif?ssl=1" target="_blank"><img width="402" src="https://i2.wp.com/warwick.ac.uk/fac/sci/statistics/staff/academic-research/kendall/personal/abstracts/dead/leaf63.gif?resize=402%2C203&ssl=1" data-recalc-dims="1" height="203"></a></p>
<p><strong>W</strong>hile <a rel="nofollow" href="https://xianblog.wordpress.com/2018/03/15/brussels-skyline-jatp/" target="_blank">in Brussels</a> last week I noticed an interesting <a rel="nofollow" href="https://stats.stackexchange.com/q/333505/7224" target="_blank">question on X validated</a> that I considered in the train back home and then more over the weekend. This is a question about spacings, namely how long on average does it take to cover an interval of length L when drawing unit intervals at random (with a torus handling of the endpoints)? Which immediately reminded me of Wilfrid Kendall (<a rel="nofollow" href="https://xianblog.wordpress.com/2016/11/10/snapshot-from-warwick-jatp/" target="_blank">Warwick</a>) famous gif animation of coupling from the past via leaves covering a square region, from the top (forward) and from the bottom (backward)…</p>
<p>The problem is rather easily expressed in terms of uniform spacings, more specifically on the maximum spacing being less than 1 (or 1/L depending on the parameterisation). Except for the additional constraint at the boundary, which is not independent of the other spacings. Replacing this extra event with an independent spacing, there exists a <a rel="nofollow" href="https://stats.stackexchange.com/a/163147/7224" target="_blank">direct formula</a> for the expected stopping time, which can be checked rather easily <a rel="nofollow" href="https://stats.stackexchange.com/a/333988/7224" target="_blank">by simulation</a>. But the exact case appears to be add a few more steps to the draws, 3/2 apparently. The following graph displays the regression of the Monte Carlo number of steps over 10⁴ replicas against the exact values:</p>
<p><a rel="nofollow" href="https://xianblog.files.wordpress.com/2018/03/xvaled1803.jpg" target="_blank"><img data-orig-file="https://xianblog.files.wordpress.com/2018/03/xvaled1803.jpg" data-orig-size="480,480" data-medium-file="https://xianblog.files.wordpress.com/2018/03/xvaled1803.jpg?w=300" data-attachment-id="35686" data-image-meta="{" data-image-description="" src="https://xianblog.files.wordpress.com/2018/03/xvaled1803.jpg?w=317&h=317&fit=317%2C317&resize=317%2C317" data-permalink="https://xianblog.wordpress.com/2018/03/22/spacings-on-a-torus/xvaled1803/" data-large-file="https://xianblog.files.wordpress.com/2018/03/xvaled1803.jpg?w=317&amp;h=317&amp;fit=317%2C317&amp;resize=317%2C317" alt="" data-image-title="" sizes="(max-width: 317px) 100vw, 317px" width="317" data-comments-opened="1" class="wp-image-35686" data-recalc-dims="1" height="317"></a></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/2018/03/22/spacings-on-a-torus/"> 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/usBjG0c78V0" height="1"></a></div>