Algorithm for optimal spacing in intervals Is there an algorithm to optimally space points within multiple intervals? Optimal in this case means maximizing the smallest distance between any two points so that each pair of points has at least distance X. For example, in the intervals (1,3) and (5,7) you can space out three points with a distance of at least 2 (at 1,5, and 7). But you can't space out three points with a distance of at least 3. Is there an easy way to do this with a program?
Sure.  A simple approach is to use binary search on the separation distance $d$: given $d$, it is easy test whether there is a way to space out $k$ points so that all are at least $d$ apart (I'll let you figure out how; if you can do it for one interval, you should be be able to do it for multiple intervals).  Then use binary search on $d$.