title: R: Getting around periodic random numbers
body: <p>I'm building a distribution of proportions of random values lower than a specified threshold.</p>
  <pre class="lang-r prettyprint-override"><code>ret = c(); thr = 0.5; n = 15; reps = 10000
  for (x in 1:reps) {
    prop = sum(runif(n, 0, 1) &lt; thr) / n
    ret = c(ret, prop)
  }
  plot(density(ret), main=NA)
  </code></pre>
  <p>The resulting density distribution is highly periodic and is not something one would theoretically expect:</p>
  <p><a href="https://i.stack.imgur.com/BqyJO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BqyJO.png" alt="enter image description here" /></a></p>
  <p>I presume this has something to do with the periodicity of the random number generator. Is there any way around this?</p>