1. Lecture 2
Topics: Histogram, Box-and-Whisker Plot or Box
Plot
SADAF SALEEM
Department of Computer Sciences
GIFT University, Pakistan
Course Title: Probability Theory
Course Code: MATH-313
Program: BS MATH
Semester: Spring 2023
2. Histogram
• Histogram is used for quantitative data is similar to the bar chart showing
the distribution of qualitative data.
• Horizontal axis is marked as classes
• Vertical axis is marked as class frequencies
• The heights of the bars are represent the class frequencies
• Class interval should be the same
• It look like this
3. Histogram
Example 1:
Below is the frequency distribution of the profits on vehicle sales last month at
the Applewood Auto Group. Construct a histogram.
Solution:
• The class frequencies are scaled along the vertical axis (Y-axis)
• either the class limits or the class midpoints along the horizontal axis.
5. Histogram
Example 3:
Molly’s Candle Shop has several retail stores in the coastal areas of North and
South Carolina. Many of Molly’s customers ask her to ship their purchases.
The following chart shows the number of packages shipped per day for the
last 100 days.
a. What is this chart called?
b. What is the total number of frequencies?
c. What is the class interval?
d. What is the class frequency for the 10 up to 15 class?
e. What is the relative frequency of the 10 up to 15 class?
f. What is the midpoint of the 10 up to 15 class?
g. On how many days were there 25 or more packages shipped?
7. Histogram
Example 4:
What observations can you reach based on the information presented in the
histogram?
Solution:
we can make the following statement:
1. The profit from a vehicle ranged from about $200 up to about $3,400.
2. The profits are concentrated between $1,000 and $3,000. The profit on
157 vehicles, or 87 percent, was within this range.
3. The largest concentration, or highest frequency, is in the $1,800 up to
$2,20 class. The middle of this class is $2,000. So we say that the typical
profit on selling a vehicle is $2,000.
8. Histogram
Histogram Vs Bar Chart:
• Bar char are used to represent the frequency distribution of the qualitative
data. Histograms are used to represent the frequency distribution of
quantitative data.
Shape of Histogram:
• Symmetric: if it can be folded along a vertical axis so that the two sides
coincide.
• A distribution that lacks symmetry with respect to a vertical axis is said to be
skewed.
• skewed to the right: if has a long right tail and a much shorter left tail.
• skewed to the left: if has a long left tail and a much shorter right tail.
9. Box-and-Whisker Plot or Box Plot
• Box-and-Whisker Plot or Box Plot
• A box plot is a graphical display, based on quartiles, that helps us picture a
set of data. To construct a box plot, we need only five statistics: the
minimum value, Q1 (the first quartile), the median, Q3 (the third quartile),
and the maximum value. An example will help to explain.
• Steps to follow:
• Extract min and maximum value of the data
• Then find Q1, Q2 and Q3.
• Then plot the following shape and mark x-axis properly.
10. Box-and-Whisker Plot
Example 1
Construct the box and whisker plot for the following data
12, 5, 22, 30, 7, 36, 14, 42, 15, 53, 25
Solution
First, arrange the data in ascending order:
• Median (middle value) = 22
• Lower quartile (middle value of the lower half) = 12
• Upper quartile (middle value of the upper half) = 36
11. Box-and-Whisker Plot
Example 2:
Construct the box and whisker plot for the following data
12, 5, 22, 30, 7, 36, 14, 42, 15, 53, 25, 65
Solution:
First, arrange the data in ascending order: