title: Looking for a smarter way to randomly split a 1D range of values
body: <p>I am in need of a way to randomly split a 1-dimensional range of values (i.e. continuous integers) into k sections. Just using a pseudo-random generator to pick split points would technically get the job done. However it allows for possibility of ranges either being very tiny (conversely very large). I've been looking for a way to generally solve this problem without resorting to hard-coded range limits.</p>
  
  <p>I have found this <a href="http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/" rel="nofollow">article</a>. It is concerned with 2d terrain generation. But it faces the same issue and presents a solution. You can see the Polygons section, where the author mentions Lloyd relaxation. What that whole thing derives from is Voronoi diagrams, and it works with 2d ranges. Furthermore, if you look at the algorithm for building the Voronoi diagram that Lloyd relaxation needs, it starts with:</p>
  
  <blockquote>
    <p>let  *(z) be the transformation  *(z) = (zx, zy + d(z)), where d(z) is a parabola with minimum at z</p>
  </blockquote>
  
  <p>Naturally, I don't have parabolas in 1d.</p>
  
  <p>It is not clear to me how to achieve the same results in my case of 1d range. Or maybe there is a different/better approach to the problem?</p>