How can I define histogram bins in a well define mathematical expression especially driven from data points x_i, i=1,..,n and the range or any other well define measures in the dataset.
There are multiple criterias to determine the proper number of required bins to represent the data. For example, Sturges' rule states that, the proper number of bins to represent data of size N is
I=1+3.322*log(N). After that, Sturges' rule suggests that each bin should have the length of L, where L is
L=range/I
Another famous rule is Rice's rule.
I hope you find this answer suits what you are looking for.
Thanks Yasser Al Zain, while your answer is about decision rules on choice of number histogram bins, my question is how can I define the bins using a mathematical expression? As we all know frequency of data points within a bin width determine the bin height while range divides by the required number of bins determine a bin width. My actual challenge is to express the above statement in a well defined mathematical expression.