Featured Post

This post stems from this Question to which the author has never taken the time to give any answer whatsoever.

To help the reader understand what this is all about, I reproduce an abriged version of this question

I have the following data ... [and I want to]  create a cumulative histogram with corresponding polygon employing this same information...

The data the author refers to is a collection of decimal numbers.

The term "histogram" has a very well meaning in Statistics, without entering into technical details, let us say an histogram is an estimator of a Probability Density Function (continuous random variable) or of a mass function (discrete random variable), see for instance Freedman & Diaconis.

The expression "cumulative histogram" is more recent, see for instance Wiki for a quick explanation. Shortly a cumulative histogram can be seen as an approximation of the Cumulative Density Function (CDF) of the random variable whose the sample at hand is drawn from.

In fact there exists an alternative concept named ECDF (Empirical Cumulative Distribution Function) which has been around for a long time and which is already an estimator of the CDF.
Personally I am always surprised, given the many parameters it depends upon (anchors, number of bins, binwidth selection method, ...), when someone wants to draw a cumulative histogram: Why not draw instead the ECDF, a more objective estimator, even simpler to build than the cumulative histogram, and which does not use any parameter (that people often tune to get a pretty image instead of having a reliable estimator)? 

Anyway, I have done a little bit of work arround the OP's question, and it ended in a procedure named Hodgepodge (surely not a very explicit name but I was lacking inspiration) which enables plotting (if asked) several informations in addition to the required cumulative histogram:

  • The histogram of the raw data for the same list of bin bounds.
  • The kernel density estimator of this raw-data-histogram.
  • The ECDF of the data.

Here is an example of data

and here is what procedure Hodgepodge.mw  can display when all the graphics are requested

Featured Post

Many problems in mathematics are easy to define and conceptualize, but take a bit of deeper thinking to actually solve. Check out the Olympiad-style question (from this link) below:

 

Former Maplesoft co-op student Callum Laverance decided to make a document in Maple Learn to de-bunk this innocent-looking problem and used the powerful tools within Maple Learn to show step-by-step how to think of this problem. The first step, I recommend, would be to play around with possible values of a and b for inspiration. See how I did this below:


Based on the snippet above, we might guess that a = 0.5 and b = 1.9. The next step is to think of some equations that may be useful to help us actually solve for these values. Since the square has a side length of 4, we know its area must be 42 = 16. Therefore, the Yellow, Green and Red areas must add exactly to 16. That is,


With a bit of calculus and Maple Learn's context panel, we can integrate the function f(x) = ax2 from x = -2 to x = 2 and set it equal to this value of 8/3. This allows us to solve for the value of a.


We see that a = 1/2. Since the area of the Red section must be three times that of the Yellow (which we determined above to be 8/3), we get Red = (8/3)*3 = 8.

The last step is to find the value of b. In the figure below, we know that the line y = 4 and the curve y = bx2 intersect when bx2 = 4 (i.e. when x = ± 2/sqrt(b)).

 

Since we know the area of the red section is 8 square units, that must be the difference between the entire area underneath the horiztonal line at y = 4 and the curve y = bx2 on the interval [-2/sqrt(b), 2/sqrt(b)]. We can then write the area of the Red section as an integral in terms of b, then solve for the value of b, since we know the Red area is equal to 8.

Voila! Setting a = 1/2 and b = 16/9 ≈ 1.8 guarantees that the ratio of Yellow to Green to Red area within the square is 1:2:3, respectively. Note this is quite close to our original guess of a = 0.5 and b = 1.9. With a bit of algebra and solving a couple of integrals, we were able to solve a mathematics Olympiad problem!



Mathematica plotting code

Maple 2024 asked by masa13 15 February 01