How do I sample N items from a list ensuring the samples are as similar as possible to each other? Is there anyway to sample 6 numbers without replacement this list of 12 numbers
(490,   700,    850,    1220,   505,    650,    930,    810,    800,    960,    1130,   1480)

ensuring that the average is as close as possible to the remaining 6 numbers?
In this case is the average the best method of making sure that the two samples are as similar as possible? (Maybe something like a Density curve)?
 A: My first thought was that a hierarchical cluster analysis using a method that minimizes variability would be the best approach (e.g., Ward's method).  However, this doesn't constrain to a solution with a fixed number of clusters (or more appropriately, a fixed number of items within a fixed number of clusters, such as a half-half split).
So, I would propose a less elegant sampling approach to find the "best" split sample with the desired criteria.  Randomly sample different splits of the 12 values (into equal groups of 6 each); calculate the difference of the standard deviations for each group; retain the split that gives the lowest value.  If you sample over a larger enough number of iterations, you should be able to find a reasonably good solution.
Here's the code I applied to your data:
vals <- c(490, 700, 850, 1220, 505, 650, 930, 810, 800, 960, 1130, 1480)

set.seed(1234)

min.abs.diff <- abs(diff(sd(vals[1:6]),sd(vals[7:12])))
best.split <- c(rep.int(0,6),rep.int(1,6))
for(ctr in 1:2000) {
    grp <- sample(c(rep.int(0,6),rep.int(1,6)),12)
    sd.diff <- abs(diff(aggregate(vals~grp,data.frame(vals,grp),sd)[,2]))
    min.abs.diff <- min(min.abs.diff,sd.diff)
    if(sd.diff == min.abs.diff && ctr>50) {
        print(ctr)
        print(grp)
        best.split <- grp
        }
}

aggregate(vals~grp,data.frame(vals,grp=best.split),sd)
vals[which(best.split==0)]
vals[which(best.split==1)]

This resulted in the following:
  grp     vals
1   0 283.7898
2   1 283.9674

And the groups were:
700  850  930  800 1130 1480
490 1220  505  650  810  960

I hope this helps with your project.  And, I hope that if there is a more elegant way to cluster the data to achieve minimum differences in variability for fixed sample sizes...I'd very much like to see that.
