Mean, Median and Mode JavaScript Simulation Applet HTML5

This simulation illustrates the concept trio of mean, median and mode. As a quick recap, here are brief definitions of the three terms.

For a list of n numbers,

Mean: Sum all the numbers in the list, then divide by n.
Median: Order the list of numbers in increasing order, then find the number in the middle of the list. If n is odd, the median is the middle term. If n is even, the median is the arithmetic mean of the two middle terms.
Mode: Count the frequencies of each number occurring in the data set. The number(s) with the highest frequency is the mode. There can either be multiple modes (if two or more elements share the same frequency), one mode, or no modes (if all the elements have the same frequency).

In this simulation (link here), the value of n can be adjusted to a number between 1 and 25 inclusive with either the slider or the field. The data is shown as a histogram, in addition to a table of values. Click/Tap the randomize button to generate a new set of n random numbers from 1 to 9.

The view of the histogram can also be adjusted to show animal faces, symbols, and/or a bar graph to represent the frequency of each number occurring in the data set.

Additionally, there is an option to order/unorder the data set, making it useful to calculate the median if you wish to do so yourself.

The top left corner of the panel shows the values of the mean, median and mode for the given data set.


Next Post Previous Post
No Comment
Add Comment
comment url