Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a histogram which shows the frequency of elements in a set. I'd like to add minimum number of elements to the set such that the histogram of the set as defined above becomes fairly uniform. Is there any efficient method that allows me to do it with minimum added elements? Some limited peaks in the uniform histogram is also acceptable but majority of the bins in the final histogram should be fairly uniform.


share|cite|improve this question

You need to decide somehow what the minimum allowable number of counts per bin is, then add counts to bring any bins that are too low up to the minimum.

share|cite|improve this answer
Thanks. But This does not seem to be efficient since how I can get that minimum correctly?. Unless, I count all the bins find an average and fill all the bins to that average is what I thought but it is not efficient either. Is there any way such that I can do this by a PDF or something like that? – user39576 Oct 10 '12 at 18:44
The simplest would be to compute the average counts per bin and bring all the bins up to that. That would make it completely flat. Since you didn't say how much variation is acceptable, there isn't a well defined algorithm. You could make a new histogram of counts/bin and use that to determine the allowable minimum. – Ross Millikan Oct 10 '12 at 18:51
Thanks. Limited variation is acceptable as long as the histogram looks uniformly distributed despite minor variation. However, I am not sure whether the number of added elements remain minimum or not. Please not that, this is going to be applied on large number of sets which are not similar in terms of their number of values but their values remain with in the range. The ultimate result would be a uniform histogram for all the sets with minimum random elements such that all the histograms look relatively the same. – user39576 Oct 10 '12 at 18:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.