How is each bar's height of a histogram determined?

Question

In the context of this exercise, how is each bar’s height determined in a histogram?

Answer

Each bar’s height in a histogram is the count of values that fall within each bin, or range, of values. The actual values of the data do not affect the height, as each is counted as 1 toward the total height of a bar.

Every bin of a histogram, except for the last bin, counts the values in each range in the following manner:

[start, end)

where the start value of a bin is inclusive toward the count, and the end value is exclusive. For example, with a histogram bin of values between 10 and 20, the value 10 is included, but the value 20 is not included.

The last bin of a histogram is inclusive for the end value. For example, if the last bin is between 80 and 90, then both 80 and 90 are included in the final bar.

3 Likes

I have a question related to the last paragraph about the last bin. If 90 was included in the data as you imply, then I suppose that the final bar shouldn’t be between 80-90 but actually between 90 -100 (range = …, 100). So , in this case , even in the last bin, the end value (100) would be excluded .
Moreover, this is the way the histogram was built in the example in the core lesson with the 5 bins and the range(1,6). The last bin was lying between 5 & 6 in order to include 5.
Is there a contrast here between this information you gave about the last bin and the lesson’s example or there is something else I do not follow?

That’s a valid question. I mean, I was confused in that last paragraph. How is that different from what we learnt in the lesson?