Advanced Engineering
Mathematics
Instructor: Dr. Madiha Liaqat
Outline of Today’s Lecture
Descriptive Statistics
The stem and leaf graph
Line graph, Bar graph, Histogram
Frequency Polygon, Time Series Graph
Measurement of location of data
Mean, Median and Mode
Skewness
Probability Statistics
Sample Space and Events
Mutually Exclusive Events
Union and Intersection
Joint Probability
Complementary Events
Multiplication Law of Probability
Descriptive Statistics
Data can be described and presented in many different formats.
For example, suppose you are interested in buying a house in a particular
area. You may have no clue about the house prices, so you might ask your real
estate agent to give you a sample data set of prices. Looking at all the prices
in the sample often is overwhelming. A better way might be to look at the
median price and the variation of prices. The median and variation are just
two ways that you will learn to describe data. Your agent might also provide
you with a graph of the data.
Today, you will study numerical and graphical ways to describe and display
your data.
Descriptive Statistics
A graph can be a more effective way of presenting data than a
mass of numbers because we can see where data values
cluster and where there are only a few data values.
Newspapers and the internet use graphs to show trends and to
enable readers to compare facts and figures quickly.
Statisticians often graph data first to get a picture of the
data. Then more formal tools may be applied.
Some of the types of graphs that are used to summarize and
organize data are the dot plot, the bar graph, the histogram,
the stem-and-leaf plot, the frequency polygon, pie chart etc.
The stem-and-leaf graph or stemplot
It is a good choice when the data sets are small.
To create the plot, divide each observation of data into a stem and a
leaf. The stem consists of the leading digit(s), while the leaf consists
of a final significant digit.
For example, 23 has stem two and leaf three. The number 432 has
stem 43 and leaf two. Likewise, the number 5,432 has stem 543 and
leaf two. The decimal 9.3 has stem nine and leaf three.
Write the stems in a vertical line from smallest to largest. Draw a
vertical line to the right of the stems. Then write the leaves in
increasing order next to their corresponding stem. Make sure the
leaves show a space between values, so that the exact data values
may be easily determined. The frequency of data values for each stem
provides information about the shape of the distribution.
Example
For Susan Dean's spring precalculus class, scores for the first exam were as
follows (smallest to largest):
33, 42, 49, 49, 53, 55, 55, 61, 63, 67, 68, 68, 69, 69, 72, 73, 74, 78, 80, 83,
88, 88, 88, 90, 92, 94, 94, 94, 94, 96, 100
The stemplot shows
that most scores fell
in the 60s, 70s, 80s,
and 90s. Eight out of
the 31 scores or
approximately 26
percent (8/31) were
in the 90s or 100, a
fairly high number of
As.
The stem-and-leaf graph or stemplot
The stemplot is a quick way to graph data and gives an exact picture of the
data. You want to look for an overall pattern and any outliers.
An outlier is an observation of data that does not fit the rest of the data. It is
sometimes called an extreme value.
When you graph an outlier, it will appear not to fit the pattern of the graph.
Some outliers are due to mistakes, for example, writing 50 instead of 500,
while others may indicate that something unusual is happening.
Exercise
The data are the distances (in kilometers) from a home to
local supermarkets. Create a stemplot using the data.
1.1, 1.5, 2.3, 2.5, 2.7, 3.2, 3.3, 3.3, 3.5, 3.8, 4.0, 4.2, 4.5,
4.5, 4.7, 4.8, 5.5, 5.6, 6.5, 6.7, 12.3
Problem
Do the data seem to have any concentration of values?
Solution
The value 12.3 may be an
outlier. Values appear to
concentrate at 3 and 4
kilometers.
Problem
A side-by-side stem-and-leaf plot allows a comparison of the two
data sets in two columns.
In a side-by-side stem-and-leaf plot, two sets of leaves share the same
stem. The leaves are to the left and the right of the stems.
The Tables presented in next slide show the ages of presidents at their
inauguration and at their death. Construct a side-by-side stem-and-
leaf plot using these data.
Example
Presidential Ages at Inauguration Presidential Age at Death
Notice that the leaf values increase in order, from
right to left, for leaves shown to the left of the
stem, while the leaf values increase in order from
left to right, for leaves shown to the right of the
stem.
Line graph
Another type of graph that is useful for specific data values is a line
graph.
In the particular line graph shown in next Example, the x-
axis (horizontal axis) consists of data values and the y-axis (vertical
axis) consists of frequency points. The frequency points are
connected using line segments.
Example
In a survey, 40 mothers were asked how many times per week a
teenager must be reminded to do his or her chores.
A line graph is used to display data that changes
continuously over periods of time.
Bar graphs
Bar graphs consist of bars that are separated from each other. The bars can
be rectangles, or they can be rectangular boxes, used in three-dimensional
plots, and they can be vertical or horizontal.
The bar graph shown in next Example has age-groups represented on the x-
axis and proportions on the y-axis.
Example
By the end of 2011, a social media site had more than 146 million
users in the United States. Table shows three age-groups, the number
of users in each age-group, and the proportion (percentage) of users
in each age-group. Construct a bar graph using this data.
Histogram
A histogram consists of contiguous (adjoining) boxes. It has both a
horizontal axis and a vertical axis. The horizontal axis is more or less
a number line, labeled with what the data represents, for example,
distance from your home to school. The vertical axis is labeled
either frequency or relative frequency (or percent frequency or
probability). The graph will have the same shape with either label.
The histogram (like the stemplot) can give you the shape of the data,
the center, and the spread of the data. The shape of the data refers
to the shape of the distribution, whether normal, approximately
normal, or skewed in some direction, whereas the center is thought of
as the middle of a data set, and the spread indicates how far the
values are dispersed about the center. In a skewed distribution, the
mean is pulled toward the tail of the distribution.
Example
The following data are the heights (in inches to the nearest half inch) of 100
male semiprofessional soccer players. The heights are continuous data since
height is measured.
60, 60.5, 61, 61, 61.5,
63.5, 63.5, 63.5,
64, 64, 64, 64, 64, 64, 64, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5,
66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5,
66.5, 66.5, 66.5, 66.5, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67.5,
67.5, 67.5, 67.5, 67.5, 67.5, 67.5,
68, 68, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69.5, 69.5, 69.5, 69.5, 69.5,
70, 70, 70, 70, 70, 70, 70.5, 70.5, 70.5, 71, 71, 71,
72, 72, 72, 72.5, 72.5, 73, 73.5,
74
The smallest data value is 60, and the largest data value is 74. To make sure each is
included in an interval, we can use 59.95 as the smallest value and 74.05 as the largest
value, subtracting and adding .05 to these values, respectively. We have a small range here
of 14.1 (74.05 – 59.95), so we will want a fewer number of bins; let’'s say eight. So, 14.1
divided by eight bins gives a bin size (or interval size) of approximately 1.76
Example
The boundaries are as follows:
59.95
59.95 + 2 = 61.95
61.95 + 2 = 63.95
63.95 + 2 = 65.95
65.95 + 2 = 67.95
67.95 + 2 = 69.95
69.95 + 2 = 71.95
71.95 + 2 = 73.95
73.95 + 2 = 75.95
The heights 60 through 61.5 inches are in the interval 59.95–61.95. The
heights that are 63.5 are in the interval 61.95–63.95. The heights that are
64 through 64.5 are in the interval 63.95–65.95. The heights 66 through
67.5 are in the interval 65.95–67.95. The heights 68 through 69.5 are in
the interval 67.95–69.95. The heights 70 through 71 are in the interval
69.95–71.95. The heights 72 through 73.5 are in the interval 71.95–73.95.
The height 74 is in the interval 73.95–75.95.
Example
Exercise
The following data are the shoe sizes of 50 male students. The sizes are
continuous data since shoe size is measured. Construct a histogram and
calculate the width of each bar or class interval. Use six bars on the
histogram.
9, 9, 9.5, 9.5, 10, 10, 10, 10, 10, 10, 10.5, 10.5, 10.5, 10.5, 10.5, 10.5, 10.5,
10.5,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11.5, 11.5, 11.5, 11.5, 11.5,
11.5, 11.5,
12, 12, 12, 12, 12, 12, 12, 12.5, 12.5, 12.5, 12.5, 14
A bar graph is used to compare discrete or categorical variables
in a graphical format whereas a histogram depicts the frequency
distribution of variables in a dataset.
Frequency Polygon
Frequency polygons are analogous to line graphs, and just as line graphs make
continuous data visually easy to interpret, so too do frequency polygons.
To construct a frequency polygon, first examine the data and decide on the
number of intervals and resulting interval size, for both the x-axis and y-axis.
The x-axis will show the lower and upper bound for each interval, containing
the data values, whereas the y-axis will represent the frequencies of the
values. Each data point represents the frequency for each interval. For
example, if an interval has three data values in it, the frequency polygon will
show a 3 at the upper endpoint of that interval. After choosing the
appropriate intervals, begin plotting the data points. After all the points are
plotted, draw line segments to connect them.
These points are located halfway
between the lower bound and upper
bound. In fact, the horizontal axis, or x-
axis, shows only these midpoint values.
Time Series Graph
To construct a time series graph, we must look at both pieces of
our paired data set. We start with a standard Cartesian coordinate
system. The horizontal axis is used to plot the date or time
increments, and the vertical axis is used to plot the values of the
variable that we are measuring. By using the axes in that way, we
make each point on the graph correspond to a date and a measured
quantity. The points on the graph are typically connected by straight
lines in the order in which they occur.
Measure of the location of data
The common measures of location are quartiles and percentiles.
Quartiles are special percentiles. The first quartile, Q1, is the same as
the 25th percentile, and the third quartile, Q3, is the same as the
75th percentile. The median, M, is called both the second quartile and
the 50th percentile.
To calculate quartiles and percentiles, you must order the data from
smallest to largest. Quartiles divide ordered data into quarters.
Percentiles divide ordered data into hundredths. Recall that a percent
means one-hundredth. So, percentiles mean the data is divided into
100 sections. To score in the 90th percentile of an exam does not
mean, necessarily, that you received 90 percent on a test. It means
that 90 percent of test scores are the same as or less than your score
and that 10 percent of the test scores are the same as or greater than
your test score.
Quartiles
The median is a number that measures the center of the data. You can think of
the median as the middle value, but it does not actually have to be one of the
observed values. It is a number that separates ordered data into halves. Half
the values are the same number or smaller than the median, and half the values
are the same number or larger. For example, consider the following data:
1, 11.5, 6, 7.2, 4, 8, 9, 10, 6.8, 8.3, 2, 2, 10, 1
Ordered from smallest to largest:
1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10, 11.5
When a data set has an even number of data values, the median is equal to the
average of the two middle values when the data are arranged in ascending
order (least to greatest). When a data set has an odd number of data values,
the median is equal to the middle value when the data are arranged in
ascending order.
Since there are 14 observations (an even number of data values), the median is
between the seventh value, 6.8, and the eighth value, 7.2. To find the median,
add the two values together and divide by two. Result is 7.
Measure of the location of data
Quartiles are numbers that separate the data into quarters. Quartiles may or
may not be part of the data. To find the quartiles, first find the median, or
second, quartile. The first quartile, Q1, is the middle value of the lower half of
the data, and the third quartile, Q3, is the middle value, or median, of the
upper half of the data. To get the idea, consider the same data set:
1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10, 11.5
The data set has an even number of values (14 data values), so the median will
be the average of the two middle values (the average of 6.8 and 7.2), which is
calculated as 6.8+7.22 and equals 7.
So, the median, or second quartile ( Q2 ), is 7.
The first quartile is the median of the lower half of the data, so if we divide the
data into seven values in the lower half and seven values in the upper half, we
can see that we have an odd number of values in the lower half. Thus, the
median of the lower half, or the first quartile ( Q1 ) will be the middle value, or
2. Using the same procedure, we can see that the median of the upper half, or
the third quartile ( Q3 ) will be the middle value of the upper half, or 9.
Measure of the location of data
The quartiles are illustrated below:
The interquartile range is a number that indicates the spread of the middle
half, or the middle 50 percent of the data. It is the difference between the
third quartile (Q3) and the first quartile (Q1)
IQR = Q3 – Q1. The IQR for this data set is calculated as 9 minus 2, or 7.
The IQR can help to determine potential outliers. A value is suspected to
be a potential outlier if it is less than 1.5 × IQR below the first quartile or
more than 1.5 × IQR above the third quartile. Potential outliers always
require further investigation.
Exercise
For the following 13 real estate prices, calculate the IQR and
determine if any prices are potential outliers. Prices are in dollars.
389,950; 230,500; 158,000; 479,000; 639,000; 114,950; 5,500,000;
387,000; 659,000; 529,000; 575,000; 488,800; 1,095,000
Solution
Order the following data from smallest to largest: 114,950; 158,000; 230,500;
387,000; 389,950; 479,000; 488,800; 529,000; 575,000; 639,000; 659,000;
1,095,000; 5,500,000
M = 488,800
Q1 = 230,500 + 387,0002 = 308,750
Q3 = 639,000 + 659,0002 = 649,000
IQR = 649,000 – 308,750 = 340,250
(1.5)(IQR) = (1.5)(340,250) = 510,375
Q1 – (1.5)(IQR) = 308,750 – 510,375 = –201,625
Q3 + (1.5)(IQR) = 649,000 + 510,375 = 1,159,375
No house price is less than –201,625. However, 5,500,000 is more than 1,159,375.
Therefore, 5,500,000 is a potential outlier.
Percentiles
Percentiles are useful for comparing values.
For this reason, universities and colleges use percentiles extensively.
One instance in which colleges and universities use percentiles is
when SAT results are used to determine a minimum testing score that
will be used as an acceptance factor. For example, suppose Duke
accepts SAT scores at or above the 75th percentile. That translates
into a score of at least 1220.
SAT score ranges from 400-1600
A Formula for Finding the kth Percentile
If you were to do a little research, you would find several formulas for
calculating the kth percentile. Here is one of them.
k = the kth percentile. It may or may not be part of the data.
i = the index (ranking or position of a data value)
n = the total number of data
Order the data from smallest to largest.
Calculate i=(k/100) n+1
If i is an integer, then the kth percentile is the data value in the ith position
in the ordered set of data.
If i is not an integer, then round i up and round i down to the nearest
integers. Average the two data values in these two positions in the ordered
data set. The formula and calculation are easier to understand in an
example.
Example
Imagine you have the marks of 20 students. Now, try to calculate the 90th
percentile.
Solution
Step 1: Arrange the score in ascending order.
Solution
Step 2: Plug the values in the formula to find n. Formula: i=k/100 (n+1)
P90 = 94 means that 90% of
students got less than 94 and
10% of students got more than
94
If i is not an integer, then round i up and round i down to the nearest
integers. Average the two data values in these two positions in the ordered
data set.
Example
Suppose you want to find the percentile of 78 marks in the data set.
Solution
Step 1: Arrange the score in ascending order.
Solution
P = 60 means that 78
marks point to the 60th
percentile in the dataset.
Exercise
Listed are 29 ages for Academy Award-winning best actors in order from
smallest to largest:
18, 21, 22, 25, 26, 27, 29, 30, 31, 33, 36, 37, 41, 42, 47, 52, 55, 57, 58, 62,
64, 67, 69, 71, 72, 73, 74, 76, 77
Find the 70th percentile.
Find the 83rd percentile.
Solution
Interpreting Percentiles, Quartiles, and
Median
A percentile indicates the relative standing of a data value when data are sorted into
numerical order from smallest to largest. Percentages of data values are less than or equal
to the pth percentile. For example, 15 percent of data values are less than or equal to the
15th percentile.
Low percentiles always correspond to lower data values.
High percentiles always correspond to higher data values.
A percentile may or may not correspond to a value judgment about whether it
is good or bad. The interpretation of whether a certain percentile is good or bad depends
on the context of the situation to which the data apply. In some situations, a low
percentile would be considered good; in other contexts a high percentile might be
considered good. In many situations, there is no value judgment that applies.
A high percentile on a standardized test is considered good, while a lower percentile on
body mass index might be considered good. A percentile associated with a person's height
doesn't carry any value judgment.
Mean, Median and Mode
The two most widely used measures of the center of the data are
the mean (average) and the median. To calculate the mean weight of
50 people, add the 50 weights together and divide by 50. To find
the median weight of the 50 people, order the data and find the
number that splits the data into two equal parts. The median is
generally a better measure of the center when there are extreme
values or outliers because it is not affected by the precise numerical
values of the outliers. The mean is the most common measure of the
center.
Another measure of the center is the mode. The mode is the most
frequent value. There can be more than one mode in a data set as
long as those values have the same frequency and that frequency is
the highest. A data set with two modes is called bimodal.
Skewness In a perfectly
symmetrical
A skewed left distribution has
more high values. The mean is
distribution, the 6.3, the median is 6.5, and the
mean and the mode is seven
median are the
same.
A skewed right distribution
has more low values. The
If the distribution of data is skewed to the
mean is 7.7, the median is
left, the mean is less than the median,
7.5, and the mode is seven
which is often less than the mode. If the
distribution of data is skewed to the right,
the mode is often less than the median,
which is less than the mean.
Probability Statistics
Introduction to Probability
The theory of probability provides the foundation for statistical inference.
The concept of probability is not foreign to health workers and is frequently
encountered in everyday communication.
For Example:
A physician say that a patient has a 50-50 chance of surviving a certain
situation.
A physician may say that she is 95 percent certain that a patient has a
particular disease.
A public health nurse may say that nine times out of ten a certain client will
break an appointment.
As these examples suggest, most people express probabilities in terms of
percentages.
Introduction to Probability
(Contd…..)
In dealing with probabilities mathematically, it is more convenient to
express probabilities as fractions.
Thus, we measure the probability of the occurrence of some event by
a number between zero and one.
The more likely the event, the closer the number is to one; and the
more unlikely the event, the closer the number is to zero.
An event that cannot occur has a probability of zero, an event that is
certain to occur has a probability of one.
Probability
Probability is a measure that is associated with how certain we are of
results, or outcomes, of a particular activity.
When the activity is a planned operation carried out under controlled
conditions, it is called an experiment.
If the result is not predetermined, then the experiment is said to be a
chance experiment.
Each time the experiment is attempted is called a trial.
Probability
Examples of chance experiments include the following:
flipping a fair coin,
spinning a spinner,
drawing a marble at random from a bag, and
rolling a pair of dice.
A result of an experiment is called an outcome.
Sample Space (S)
A sample space is set of all possible outcomes.
A sample space is represented by the symbol S.
There are two possible outcomes with sample space of tossing a coin.
S={Head, Tail}
There are 6 possible outcomes with sample space of rolling a dice.
S={1,2,3,4,5,6}
There are 52 possible outcomes with the sample space of drawing a card.
S={2,2,2,2,3,3,3,3,……………A,A,A,A}
There are four main ways to represent a sample space:
Event
An event is a subset of a sample space S.
In referring to probabilities of events, an event is any set of outcomes of
interest.
The symbol { } is used as shorthand for the phrase “the event”.
The probability of an event E, denoted by P(E) or Pr(E) always satisfies
0<= Pr(E) <=1
Probability
The probability of an event is the relative frequency of this set of outcomes
over an indefinitely large (or infinite) number of trials.
Pr(E)=n(E)/n(S) = No. of fav. Outcomes of event/No. of all possible outcomes
Example
In case of throwing a coin, what is:
Pr(Head): ?
In case of throwing a dice, what is:
Pr(6): ?
Pr(Even#): ?
OR and AND Events
OR Event
An outcome is in the event A OR B if the outcome is in A or is
in B or is in both A and B. For example, let A = {1, 2, 3, 4, 5}
and B = {4, 5, 6, 7, 8}. A OR B = {1, 2, 3, 4, 5, 6, 7, 8}. Notice that
4 and 5 are not listed twice.
AND Event
An outcome is in the event A AND B if the outcome is in
both A and B at the same time. For example, let A and B be
{1, 2, 3, 4, 5} and {4, 5, 6, 7, 8}, respectively. Then A AND B = {4,
5}.
Complementary Events
A is the event that event A does not occur. It is called the complement of A.
The probability of an event A is equal to 1 minus the probability of its
complement, which is written A and
P(A)=1-P(A)
Complementary Events
The complement of event A is denoted A′ (read "A prime"). A′
consists of all outcomes that are not in A. Notice that
P(A) + P(A′) = 1.
For example, let S = {1, 2, 3, 4, 5, 6} and let A = {1, 2, 3, 4}.
Then, A′ = {5, 6}. P(A) = 4/6, P(A′) = 2/6, and P(A) + P(A′) =
4/6+2/6 = 1.
Complementary Events (Example-2)
Suppose that out of 1200 admissions to a general hospital during a
certain period of time, 750 are private admission. If we designate
these as set A and A is equal to 1200-750, or 450. We may compute
P(A)=750/1200=0.625
and
P(A)=450/1200=0.375
and see that
P(A)=1-P(A)
0.375=1-0.625
0.375=0.375
Complementary Events (Example-3)
Consider the sample space S= {book, cell phone, mp3, paper,
stationery, laptop}
Let A={book, stationery, laptop, paper}
Then the complement of A is A={cell phone, mp3}
Mutually Exclusive
Two events A and B are mutually exclusive or disjoint if A n
B=Փ, that is if A and B have no elements in common
Or
Two events A and B are mutually exclusive if they cannot both
happen at same time.
Mutually Exclusive Events
Two events are mutually exclusive if they cannot both occur at the same time.
Another word that means mutually exclusive is disjoint.
If two events are disjoint, then the probability of them both occurring at the same
time is 0. Disjoint: P(A and B) = 0
If two events are mutually exclusive, then the probability of either occurring is the
sum of the probabilities of each occurring.
Specific Addition Rule
Only valid when the events are mutually exclusive.
P(A or B) = P(A) + P(B)
Mutually Exclusive Events
Example: What is the probability of throwing a 1 or 2 using a fair 6-sided die?
P(X=1) = 1/6
P(X=2) = 1/6
P(X=1 OR X=2) = P(X=1) + P(X=2) = 1/6 + 1/6 = 2/6
Note that the two events are mutually exclusive as the die can’t be in two states at
the same time.
Example: A single 6-sided die is rolled. What is the probability of rolling a 5 or an odd
number?
The number rolled can be a 5 and odd. These events are not mutually exclusive since
they can occur at the same time.
Non-Mutually Exclusive Events
Non-mutually exclusive events are events that can happen at the
same time.
Examples include: driving and listening to the radio, even numbers
and prime numbers on a die, losing a game and scoring, or running
and sweating. Non-mutually exclusive events can make calculating
probability more complex.
Example
For example, suppose the sample space S = {1, 2, 3, 4, 5, 6, 7, 8, 9,
10}. Let A = {1, 2, 3, 4, 5}, B = {4, 5, 6, 7, 8}, and C = {7, 9}.
A AND B = {4, 5}.
P(A AND B) = 2/10 and is not equal to zero. Therefore, A and B are
not mutually exclusive.
A and C do not have any numbers in common so P(A AND C) = 0.
Therefore, A and C are mutually exclusive.
Non-Mutually Exclusive Events
In events which aren't mutually exclusive, there is some overlap.
When P(A) and P(B) are added, the probability of the intersection (and) is
added twice.
To compensate for that double addition, the intersection needs to be
subtracted.
General Addition Rule
Always valid.
P(A or B) = P(A) + P(B) - P(A and B)
Mutually Exclusive Events
Non-Mutually Exclusive Events
Exercise
Exercise
Solution
Zero (0) or one (1) tails occur when the outcomes HH, TH, HT show up. P(F) =
3/4.
Two faces are the same if HH or TT show up. P(G) = 2/4.
A head on the first flip followed by a head or tail on the second flip occurs
when HH or HT show up. P(H) = 2/4.
F and G share HH so P(F AND G) is not equal to zero (0). F and G are not
mutually exclusive.
Getting all tails occurs when tails shows up on both coins (TT). H’s outcomes
are HH and HT. J and H have nothing in common so P(J AND H) = 0. J and H
are mutually exclusive.
Assignment 1
(to be submitted on MS teams till 27/09/2024)
Construction of unique examples:
Please make five examples (in a single Word file) explaining the
following concepts:
1. Sample Space
2. Mutually Exclusive Events
3. Mutually non-Exclusive Events
Thank You!