Hacker News new | ask | show | jobs
by skip 5637 days ago
Since the count of items is known a priori (=sizeof(S)), doesn't that mean that the mean and the sum are related in a well defined way? Basically then both critera can be simplified to a single criterion on either sum or mean.
1 comments

Thanks for your response, skip! SUM is the sum of attributes A, but MEAN is the mean of attributes B, so I don't see how they can be simplified.
Oh, I missed this detail. In that case for a deterministic result I think you need to look at every possible combination. However, you can order them by the minimum criterion first, and start searching from the smallest to largest, so then the first group than meets the interval criteria is guaranteed optimal.