Class Notes: STC110
Department of Statistics
Quarter 2, 2026
Contents
1 Data, statistics and sampling
1.1 Data and statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.1 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.2 Various types of data and measurement scale . . . . . . . . . . . . . . . . . . . . . .
1.1.3 The role of statistics in the research process . . . . . . . . . . . . . . . . . . . . . . .
1.2 Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.2 Simple random sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.3 Systematic sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.4 Stratified sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.5 Cluster sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
5
5
6
11
13
13
15
15
16
16
2 Summarising data: tabular & graphical methods
20
2.1 Summarising data for a categorical variable . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.1.1 Frequency distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.1.2 Relative frequency and percent frequency distributions . . . . . . . . . . . . . . . . . 20
2.1.3 Bar charts and pie charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2 Summarising data for a quantitative variable . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.2.1 Frequency, relative frequency and percentage frequency distributions . . . . . . . . . 22
2.2.2 Histogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.2.3 Cumulative frequency distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.2.4 Stem-and-leaf display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.3 Summarising data for two variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.3.1 Cross-tabulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.3.2 The scatter diagram and trend line . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3 Summarising data: numerical methods
34
3.1 Sigma and factorial notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1.1 Sigma notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1.2 Factorial notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2 Measures of location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2.1 Mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
1
CONTENTS
3.3
3.4
3.5
3.6
3.7
CONTENTS
3.2.2 Median . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.3 Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.4 Percentiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.5 Quartiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Measures of variability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.1 Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.2 Interquartile range (IQR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.3 Variance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.4 Standard deviation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.5 Coefficient of variation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Measures of distribution shape, relative location and detecting outliers . . . . . . . . . . .
3.4.1 Distribution shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.2 Z-scores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.3 The Empirical Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.4 Detecting outliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Five-number summaries and boxplots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.1 Five-number summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.2 The box plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Measures of association between two variables . . . . . . . . . . . . . . . . . . . . . . . . . .
3.6.1 Covariance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.6.2 Correlation coefficient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The weighted mean and grouped data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1 Weighted mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.2 Grouped data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
36
37
39
41
41
41
42
42
43
44
45
45
47
48
51
52
52
52
53
54
55
57
57
58
4 Introduction to probability theory
59
4.1 Experiments, counting rules and assigning probabilities . . . . . . . . . . . . . . . . . . . . 59
4.1.1 Counting rules, combinations and permutations . . . . . . . . . . . . . . . . . . . . . 60
4.1.2 Assigning probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.2 Basic relationships of probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.2.1 Complement of an event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.2.2 Union of two events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.2.3 Intersection of two events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.2.4 Addition law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.2.5 Mutually exclusive events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.2.6 Other probability laws . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.3 Conditional probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
4.3.1 Independent events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
4.3.2 Multiplication law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5 Discrete probability distributions
73
5.1 Random variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
5.2 Discrete probability distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.2.1 Discrete uniform probability distribution . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.3 Expected value and variance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5.4 Binomial distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
©Copyright reserved
2
CONTENTS
CONTENTS
6 Continuous random variable
90
6.1 Continuous probability distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
6.1.1 Properties of a probability density function (pdf) . . . . . . . . . . . . . . . . . . . . 90
6.1.2 Comparison between discrete and continuous probability distributions . . . . . . . . 91
6.2 Continuous uniform probability distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
6.3 Normal Probability Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
6.3.1 Using normal probability distributions . . . . . . . . . . . . . . . . . . . . . . . . . . 94
6.3.2 Using Excel to compute standard normal probabilities . . . . . . . . . . . . . . . . . 95
6.3.3 6.2.3 Computing the inverse of the standard normal distribution . . . . . . . . . . . 96
6.3.4 6.2.4 Percentiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
A Formulae Sheet
Chapter 1:
101
©Copyright reserved
3
CONTENTS
CONTENTS
The primary recommended resources for this document is based on the following textbooks:
• Diez, Cetinkaya-Rundel, Dorazio & Barr – Advanced High School Statistics. (3rd ed.)
• Anderson, Sweeney, Williams, Camm and Cochran - Modern Business Statistics with Microsoft Excel.
(7th ed.) (South-Western CENGAGE Learning)
Scientists seek to answer questions using methods and carefully collected observations. The observations, collected from surveys and experiments, form the backbone of the research process, and are
collectively called data. It is helpful to put statistics in the context of a general process of investigation
(research):
1. Identify a question or problem.
2. Collect relevant data on the topic.
3. Analise the data.
4. Form a conclusion.
The first two units below will focus on the basic properties of data and data collection. Units 3 and 4 will
focus on the first steps in analysing data. After collecting data, the next stage in the investigative process
is to describe and summarise the data. We will look at ways to summarise numerical and categorical data
graphically, numerically, and verbally. While numerical and graphical summaries are done using computer
software in practice, it is helpful to understand how these summaries are created and it is especially important to understand how to interpret and communicate the findings.
Statistical (and mathematical) concepts will be demonstrated and interpreted through Excel (practical
coding) and simulation within a data science framework. Unit 5 will focus on introductory probability
theory and theoretical distributions. Probability forms a key building block in statistics, and you are
probably already aware of many ideas. However, formalization of the concepts will be new to most. The
unit will aim to introduce probability concepts through examples (and simulation) that will be familiar to
most people.
Without the relevant tools, you cannot change a
flat tyre!
Without the relevant tools, you cannot master data
analysis!
As you work through the content of this module, try to see how the different topics are connected.
These connections will be pointed out in class, and it will be wise to attend class punctually to note this.
©Copyright reserved
4
1
DATA, STATISTICS AND SAMPLING
1
Data, statistics and sampling
1.1
Data and statistics
1.1.1
Data
Data and data sets
Data is the facts and figures collected, analysed and summarized for presentation and interpretation. All
the data collected in a particular study is called a data set.
Elements
The entities on which data are collected.
Variable
A characteristic of interest for the elements.
Observation
A set of measurements obtained for a particular element.
Example 1.1. Suppose that we captured the age and weight of 5 randomly selected first-year students.
Then the data set is given by:
Student number
1
2
3
4
5
Age (in years)
18
19
18
20
19
Weight (in kg)
75
67
85
90
62
• Elements: students
• Variables: age and weight (It should be noted that there could be other variables, such as height and
gender.)
• Observation: row of data points for a single student
Remark 1. When we deal with cross-tabulations in Unit 1.3, the rows and columns will both contain
variables. It is therefore important to understand exactly what your study is about before interpreting
tables or other data summaries.
©Copyright reserved
5
1
DATA, STATISTICS AND SAMPLING
1.1.2
1.1
Data and statistics
Various types of data and measurement scale
Variables define data. Consider the following examples of variables:
©Copyright reserved
6
1
DATA, STATISTICS AND SAMPLING
1.1
Data and statistics
Data types
A variable is said to be numerical if it can take on a wide range of numerical values, and it is sensible to
add, subtract, or take averages of those values. Data are classified as either quantitative (numerical) or
qualitative (categorical) based on this criterion.
The classification of quantitative data can further be refined into either discrete or continuous.
Consider the next example:
Data is said to be discrete if the numerical values take ‘jumps’ (or are countable) – that is, when we
observe integers or whole numbers. Data is continuous if it can be measured with a value between any two
other values, and contains decimals.
Measurement scales
The next criterion for classifying data is based on measurement scale. If data for a variable consists of labels
or names used to identify an attribute of the element, the scale of measurement is considered a nominal
scale. See for example the variable venue where most of leisure time is spent in the example below. The
scale of measurement for a variable is considered an ordinal scale if the data exhibit the properties of
nominal data and in addition, the order or rank of the data is meaningful. See for example the variable
preference for spending time with friends in the example below.
If data has all the properties of ordinal data, and the interval between values is expressed in terms of a fixed
unit (quantitative discrete data), the scale of measurement is interval. Note that a true zero does not
exist for interval-scaled data and the difference between values is meaningful. The scale of measurement
for a variable is the ratio scale if data have all the properties of interval data and the ratio of any two
values is meaningful. Note that a true zero value exists in this case.
Data classification (with respect to type and measurement scale) can be summarised as follows:
©Copyright reserved
7
1
DATA, STATISTICS AND SAMPLING
©Copyright reserved
1.1
Data and statistics
8
1
DATA, STATISTICS AND SAMPLING
1.1
Data and statistics
Cross-sectional and time series data
For purposes of statistical analysis, distinguishing between cross-sectional and time series data is important.
• Cross-sectional data: Data collected at the same or approximately the same point in time. For example, data collected when a respondent completes a questionnaire or during a survey, as summarised
in the table below.
©Copyright reserved
9
1
DATA, STATISTICS AND SAMPLING
1.1
Data and statistics
• Time series data: Data collected over several time periods. For example, the amount spent on
groceries each month recorded over a couple of months, or the ZAF/USD exchange rate recorded
over time.
Descriptive statistics and statistical inference
Most statistical information in the media, company reports, and other publications consists of data that
are summarised and presented in a form that is easy for the reader to understand. Such summaries of
data, which are tabular, graphical, or numerical, are referred to as descriptive statistics.
The process of conducting a survey to collect data for an entire population is called a census. The
process of conducting a survey to collect data for a sample is called a sample survey. As one of its
major contributions, statistics uses data from a sample to make estimates and test hypotheses about the
characteristics of a population through a process referred to as statistical inference.
©Copyright reserved
10
1
DATA, STATISTICS AND SAMPLING
1.1
Data and statistics
Class discussion (bring your solutions to class):
Identify the population and sample in the following cases and classify them as either A (descriptive statistics) or B (inferential statistics):
1. A statistics professor asked students in a class their ages. Based on this information, the professor
states that the average age of all the students in the university is 21 years. This is an example of
.
2. The Department of Transportation of a city has noted that on the average there are 14 accidents per
day. The average number of accidents is an example of
.
3. The owner of a factory regularly requests a graphical summary of all employees’ salaries. The
graphical summary of salaries is an example of
.
1.1.3
The role of statistics in the research process
Back to an overview of steps in the general process of investigation (research):
Source: Modern Statistics in Practice – Steyn, Smit, du Toit & Strassheim, Chapter 1: Pages 1-6
©Copyright reserved
11
1
DATA, STATISTICS AND SAMPLING
1.1
Data and statistics
Planning
- Formulation of the objectives of the investigation is crucial.
- Only relevant information should be obtained.
- Questionnaires may be a useful tool to obtain information.
- Samples, instead of the population, are generally used to save time and costs.
Data collection
- Should not present many problems if planning was done carefully.
- Depending on the study, data collection can happen within a few minutes or over many months or
years.
Editing & coding
• Data editing should be used to eliminate obvious errors.
• Dubious data should preferably be eliminated but this is not always the case.
• Data may be coded on the questionnaire before being captured on computer, especially in large
surveys.
Analysis
• Statistical techniques are used to analyse data.
• Step 1: Descriptive statistics are used to order and summarize the data obtained in order to observe
trends.
• Step 2: Inferential statistics are used to draw conclusions about the population from the sample
using the calculated descriptive measures.
Conclusions
• After analysis the most important conclusions are given in the form of a report.
• When a research question is not fully answered, this should be stated in the report.
• New or follow-up questions are often a result of research and will lead to continued investigations.
The research process can therefore be seen as a cycle.
Since the sampling method plays such an important role in the research process, it will be the topic of our
next unit.
©Copyright reserved
12
1
DATA, STATISTICS AND SAMPLING
1.2
1.2
Sampling
Sampling
Recommended material:
• Steyn, Smit, du Toit & Strasheim – Modern Statistics in Practice – Chapter 2
• Diez, Cetinkaya-Rundel, Dorazio & Barr – Advanced High School Statistics, 3e
• https://www.youtube.com/watch?v=be9e-Q-jC-0
1.2.1
Terminology
• A census survey contains all population elements.
• Any subgroup or subset of elements of the population is called a sample.
• The process by which the sample is drawn from the population is known as sampling.
• The sampling frame is a representation of all the elements in the population from which several
elements are drawn to form the sample.
• A complete sampling frame is not always available. For example, a list of all the people in a community
may not be available. The population of those elements for which a sampling frame exists is the
survey or sampled population.
• A sample survey aims to obtain results from a subset of population elements, which have to be
generalised to the entire population. That is, the results obtained from the sample must hold true
(within statistical variation limits) for the population from which the sample is selected.
• A perfect sample would be a scaled-down version of the population and mirroring every characteristic
of the whole population. If this is the case, we can say that our sample is representative of the
population.
• The sampling error is caused by the inherent inability of a sample to provide totally accurate
information on the population.
• Sample bias occurs if sample elements are obtained in such a way that, for some reason, certain
sections of the population are either not represented at all or represented only in a lesser degree.
©Copyright reserved
13
1
DATA, STATISTICS AND SAMPLING
1.2
Sampling
• Sampling observation errors (also called non-sampling errors) are not the result of a certain
sampling procedure or sample size, but are the errors made by the sampler or respondent during the
collection of the sample data.
• Valid generalisation, i.e., inference can only be made if the sample is representative of the population. This is also referred to as a “random” sample.
• Random digits are a random arrangement of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, and can be
used to draw random samples as will be demonstrated in the following sections.
• A homogeneous population is one where all individuals can be regarded as the same type.
• A heterogeneous population is one containing subpopulations of different types.
• A population can be either homogeneous or heterogeneous, depending on the purpose of the study.
Let’s say for instance that we are interested in knowing the average amount of money spent per month
on fast food by Hatfield campus students. In this case, the population would be homogeneous since
we are not making a distinction between any subgroups within the population, i.e., we are seeing all
students as ‘the same’ since we are not making a distinction between individuals based on factors
such as gender, age, race, etc. If we are, however, interested making a comparison of the average
amount of money spent on fast food per month between the genders, we now have two subgroups
and our population is heterogeneous. It is therefore critical to understand the purpose of a study
and to properly define the population of interest before choosing an appropriate sampling method.
How should the sample be drawn to ensure the best level of representation?
There are two classes of sampling:
1. Probability sampling: If each element in a population has a known probability or chance of being
included in the sample, the sample is called a probability sample. Here we are going to look at:
• Simple random sampling
• Systematic sampling
• Stratified sampling
• Cluster sampling
2. Non-probability procedures: If a sample is not obtained in a probabilistic manner, but rather
in some subjective manner, the sampling method can be classified into one of the following three
categories:
• Convenience sampling
• Judgement sampling
• Quota sampling
Since the results obtained using probability sampling can be generalised to the population, we will only be
discussing the four methods listed for probability sampling.
©Copyright reserved
14
1
DATA, STATISTICS AND SAMPLING
1.2.2
1.2
Sampling
Simple random sampling
The most basic random sample is called a simple random sample, which is equivalent to using a raffle to
select cases. This means that each case in the population has an equal chance of being included and there
is no implied connection between the cases in the sample. A common downfall is a convenience sample,
where individuals who are easily accessible are more likely to be included in the sample.
Due to man’s inherent bias (refer Example 1.19, p 36 of Diez, Cetinkaya-Rundel, Dorazio & Barr), no
individual can draw a completely random sample unless some or other objective mechanism is used. In
this module we are going to use Excel’s built-in random number generator. Most pocket calculators also
have a key that will generate random numbers.
Sampling algorithm:
1. Using the RAND function in Excel, assign a random number between 0 and 1 to each of the population
elements.
2. Select the n elements with the smallest random numbers.
Remark 2. This method does not guarantee a representative sample of the population. Refer to undercoverage bias, non-response, and response bias that can still crop up (p37, Diez, Cetinkaya-Rundel, Dorazio
& Barr). When there is no bias in a sample, increasing the same size tends to increase the precision and
reliability of the estimate. When a sample is biased, it may be impossible to decipher helpful information
from the data, even if the sample is very large.
In summary, the two properties that are always true in a simple random sample, are:
• Each case in the population has an equal chance of being included in the sample.
• Each group of n cases has an equal chance of making up the sample.
In this module, the statistical methods will focus on data collected using simple random sampling.
1.2.3
Systematic sampling
Systematic sampling is to be applied only if the given population is logically homogeneous, since systematic
sample units are uniformly distributed over the population. This method is different from simple random
sampling but much quicker to conduct. It is sometimes used when there exists a convenient list of all
individuals of the population.
Sampling algorithm:
1. Create a list of every member of the population.
2. Select a random starting point.
3. Thereafter, we select every kth element on the list.
Remark 3. Both simple random sampling and systematic sampling are appropriate techniques to use if
the population of interest is homogeneous.
©Copyright reserved
15
1
DATA, STATISTICS AND SAMPLING
1.2.4
1.2
Sampling
Stratified sampling
Sometimes there is a variable that is known to be associated with the quantity we want to estimate,
defining different sub-populations within the population. When sub-populations vary considerably, it is
advantageous to sample each subpopulation (stratum) independently. Stratification is the process of
grouping members of the population into relatively homogeneous subgroups before sampling.
• The strata should be mutually exclusive. That is, every element in the population must be assigned
to only one stratum.
• The strata should also be collectively exhaustive. That is, no population element can be excluded.
Each element must belong to a strata.
After grouping the heterogeneous population into homogeneous subgroups (i.e., strata), simple random
sampling or systematic sampling is applied within each stratum.
Sampling algorithm:
1. Divide heterogeneous population (of size N ) into homogeneous subgroups/strata of size Ni . Note
that the subgroups need not be of the same size.
2. Calculate the size of the samples, ni , to be drawn from each of the strata. These sample sizes are
calculated as follows:
Ni
ni =
n
N
Note that determining the sample sizes is excluded for exam purposes.
3. Draw an appropriately sized sample from each of the strata using either simple random sampling or
systematic sampling.
1.2.5
Cluster sampling
Elements within a cluster should ideally be as heterogeneous as possible, but there should be homogeneity
between clusters. In other words, each cluster should be a small-scale representation of the total population. The clusters should be mutually exclusive and collectively exhaustive. A random sampling technique
such as simple random sampling or systematic sampling is then used to select the clusters to be included in
the study. In single-stage cluster sampling, all the elements from each of the selected clusters are used.
The main difference between cluster sampling and stratified sampling is that in cluster sampling, the
cluster is treated as the sampling unit, so analysis is done on a population of clusters (at least in the first
stage). In stratified sampling, the analysis is done on elements within strata. In stratified sampling, a
random sample is drawn from each of the strata, whereas in cluster sampling only the selected clusters
are studied. The main objective of cluster sampling is to reduce costs by increasing sampling efficiency.
This contrasts with stratified sampling where the main objective is to increase precision.
One version of cluster sampling is area sampling or geographical cluster sampling. In this case,
the clusters consist of geographical areas. Because a geographically dispersed population can be expensive
to survey, greater economy than simple random sampling can be achieved by treating several respondents
within a local area as a cluster.
©Copyright reserved
16
1
DATA, STATISTICS AND SAMPLING
1.2
Sampling
Sampling algorithm (single-stage cluster sampling):
1. Divide population into natural subgroups called clusters.
2. Select clusters at random using either simple random sampling or systematic sampling.
3. Use all the elements in the selected cluster(s).
4. Number of clusters is determined by
• Desired n
• Size of the clusters
Remark 4. Cluster sampling is appropriate when a population is heterogeneous but can also be appropriate
with a homogeneous population.
Stratified sampling vs. Cluster sampling
Class discussion (bring your ideas to class):
1. Suppose we are interested in estimating the proportion of students at the Hatfield campus that have
part-time jobs. It is believed that older students are more likely to work than younger students.
What sampling method should be employed? Describe how to collect such a sample to get a sample
of size 50. (Hint: consider stratified versus cluster sampling)
2. Suppose we are interested in estimating the malaria rate in a densely populated rural area in the
Lowveld of South Africa. We learn that there are 30 villages in the area, each more or less similar
to the next. Our goal is to test 150 individuals for malaria. What sampling method should be
employed? (Hint: consider a multistage method)
©Copyright reserved
17
1
DATA, STATISTICS AND SAMPLING
1.2
Sampling
Closing remark: Things to consider in deciding which method to use:
Summary of random sampling techniques
• Finite Population
• N : Population size
• n: Sample size
The sample must be random & representative
1. Simple Random Sampling (SRS)
• The population is homogeneous.
• Need to number the population.
• Use random digits to select sample
elements.
3. Systematic Sampling
• Population is homogeneous.
• Need a random starting point after
which every k th element is selected.
©Copyright reserved
2. Stratified Sampling
• The population is heterogeneous.
• Renumber each stratum separately.
• Randomly select from each stratum.
4. Cluster Sampling
• Each cluster is representative of the
population.
• Select clusters randomly (all elements in a selected clusters are included in the sample).
18
1
DATA, STATISTICS AND SAMPLING
1.2
Sampling
Chapter 2:
©Copyright reserved
19
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2
Summarising data: tabular & graphical methods
2.1
Summarising data for a categorical variable
2.1.1
Frequency distribution
A frequency distribution is a tabular summary of data showing the number (i.e., frequency) of observations
in each of several nonoverlapping categories or classes.
Example 2.1. Consider the data from a sample of 50 soft drink purchases.
The frequency distribution of soft drink purchases can be constructed as follows:
Soft Drink
Coke Classic
Diet Coke
Dr. Pepper
Pepsi-Cola
Sprite
Total
2.1.2
Tally
50
Frequency
19
8
5
13
5
50
Relative frequency and percent frequency distributions
Often, we want to observe frequencies as the proportion (or percentage) of observations in several nonoverlapping classes.
Frequency in the class
Relative frequency =
n
Percentage frequency is the relative frequency multiplied by 100.
©Copyright reserved
20
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.1 Summarising data for a categorical
variable
Example 2.2 (Continued from Example 2.1). The relative and percentage frequency distributions of soft
drink purchases can be constructed as follows:
Soft drink
Frequency
Relative frequency
Percent frequency
Coke Classic
19
19
50 = 0.38
38
Diet Coke
8
8
50 = 0.16
16
Dr. Pepper
5
5
50 = 0.1
10
Pepsi-Cola
13
13
50 = 0.26
26
Sprite
5
5
50 = 0.1
10
Total
50
1
100
Remark 5. The total of relative frequencies always adds to 1, whereas the total of percentage frequencies
always adds to 100.
2.1.3
Bar charts and pie charts
Bar graphs: Graphical display for summarising categorical data in terms of frequencies, relative frequencies, or percentage frequencies.
• x-axis (horizontal axis): The labels that are used for the classes (categories) of data.
• y-axis (vertical axis): The frequency, relative frequency, or percentage frequency.
• Each bar is of a fixed width.
• Bars are all separately drawn to textitasise the fact that the classes/categories are nonoverlapping.
Pie charts: Another graphical display for summarising categorical data in terms of relative or percentage
frequencies. The area taken up by each category in a pie chart is calculated as:
Relative frequency observed per category × 360◦
Remark 6. Axes should always be labelled and graphs should always have appropriate and descriptive
titles.
©Copyright reserved
21
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.2 Summarising data for a quantitative
variable
Example 2.3 (Continued from Example 2.1). Bar graphs for the frequency, relative frequency, and percentage frequency distributions of the variable “Soft Drink”, as well as a pie chart are presented below.
It is important to notice that bar charts and pie charts can only be used to illustrate one-dimensional
data. For instance, a single pie chart cannot be used to compare the soft drink preferences of males and
females. This comparison can, however, be made using two separate pie charts (one for males and one for
females) or a multiple bar chart. In a multiple bar chart different coloured bars used to indicate the
different factors (such as gender in our example) for each of the categories.
2.2
2.2.1
Summarising data for a quantitative variable
Frequency, relative frequency and percentage frequency distributions
The value of a frequency distribution is that it provides insights about the data that are not easily obtained
by viewing the data in their original unorganised form. A frequency distribution, as defined in Section
2.1.1, also holds for summarising quantitative data, however, with quantitative data we must be careful in
defining the nonoverlapping classes (or groups) to be used. Before constructing a frequency distribution of
quantitative data, we need to first answer the following questions:
• How many classes should we have?
• How wide should each class be?
• How do we choose the class limits?
©Copyright reserved
22
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.2 Summarising data for a quantitative
variable
The approximate number of classes can be calculated by making use of Sturge’s rule:
Approximate number of classes = 1 + 1.4 ln(n)
or
Approximate number of classes = 1 + 3.3 log(n)
Once we know approximately how many classes we should have, we need to find the class width:
Class width ≈
range
largest value − smallest value
=
number of classes
number of classes
Our final step is choosing the class limits. The lower class limit identifies the smallest possible data value
assigned to a specific class while the upper class limit identifies the largest possible data value assigned
to that class. We indicate whether a class limit is included in the class by making use of round or square
brackets, such that
(
]
−→
−→
the value is excluded
the value is included
Remark 7. In this course, we will consider the case of lower limits being excluded, and upper limits being
included – this is called right inclusive. Alternatively, bins can include the lower limits (and exclude the
upper limits) – this is called left inclusive.
The starting point of the first class could be taken to be the smallest value in the data set or a convenient
number just below the smallest value. The upper limit of the first class is then obtained by adding the
calculated class width to the lower limit of the first class. The lower limit of the second class will be the
same value as the upper limit of the first class while the upper limit of the second class is again obtained
by adding the lower limit and the class width. We continue in this manner until all our data values are
contained in classes. Depending on whether we round off or round up the class width, we might end up
with slightly more, or fewer, classes than calculated in step 1. This is, however, not a problem since the
value we calculated was merely an approximation.
Remark 8. In developing frequency distributions for categorical data, we did not need to specify class
limits because each data point naturally fell into a separate class.
Example 2.4. Consider the time (in days) required to complete year-end audits for a random sample of
20 clients.
Year-end audit times (in days)
12
14
19
18
15
15
18
17
20
27
22
23
22
21
33
28
14
18
16
13
Take note that the sample size is 20 (that is, (n = 20)).
©Copyright reserved
23
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.2 Summarising data for a quantitative
variable
The approximate number of classes is obtained as follows by using Sturge’s rule:
Number of classes = 1 + 1.4 ln(20)
or
1 + 3.3 log(20)
= 5.19
or
5.29
≈5
or
5
The approximate class width is calculated as
largest data value – smallest data value
33 − 12
=
= 4.2
number of classes
5
Rounding up, we have a class width of 5.
The smallest value in our data set is 12 but we will choose the lower limit of the first class as 10.
We can now obtain a frequency, relative frequency and percentage frequency distribution for the data:
Audit Time (in days)
(10-15]
(15-20]
(20-25]
(25-30]
(30-35]
Total
2.2.2
Frequency
6
7
4
2
1
20
Relative Frequency
6
20 = 0.30
7
20 = 0.35
0.20
0.10
0.05
1
Percentage Frequency
30
35
20
10
5
100
Histogram
While bar charts and pie charts are useful for summarising qualitative/categorical data, these charts are
not always appropriate for quantitative data. For qualitative data, we have a number of distinct categories.
It is therefore appropriate to make use of separated bars. With quantitative data we can, however, not
have spaces between the categories (i.e., classes) in a chart since the categories are directly adjacent to
each other. This type of chart is called a histogram.
Constructing a histogram
• x-axis (horizontal axis): The variable of interest is placed here
• y-axis (vertical axis): Frequency, relative frequency, or percentage frequency
Just as with bar graphs, we can construct a histogram for the frequency, relative frequency and percentage
frequency distributions. All three types of histograms for our example are shown on the following page.
©Copyright reserved
24
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.2 Summarising data for a quantitative
variable
Remark 9. We do not need to start labelling our x-axis at the point ‘0’ as is done above in the frequency
distribution histogram. It is perfectly acceptable to start at the lower limit of the first class.
Remark 10. As with bar graphs it is crucial that we label our axes appropriately and that we give our
chart an appropriate title.
©Copyright reserved
25
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.2 Summarising data for a quantitative
variable
Describing the shape of a distribution
One of the most important uses of a histogram is to provide information about the shape of how data is
distributed (that is, the shape of a distribution). The shape of a histogram can be described as symmetric,
skewed to the left (negatively skewed) or skewed to the right (positively skewed). The direction of the histogram is described by the “tail” of the distribution, and tells us where the outliers (extreme observations)
are present. The following graphs illustrate these concepts.
Symmetric
Skewed left (negatively skewed)
Skewed right (positively skewed)
©Copyright reserved
26
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.2.3
2.2 Summarising data for a quantitative
variable
Cumulative frequency distributions
The cumulative frequency distribution uses the number of classes, class widths and class limits developed for
the frequency distribution. However, rather than representing the frequency of each class, the cumulative
frequency distribution represents the number of data points with values less than or equal to the upper
class limit of each class.
Remark 11. A cumulative relative frequency distribution represents the proportion of data points, while a
cumulative percentage frequency distribution represents the percentage of data points with values less than
or equal to the upper limit of each class.
Example 2.5 (Example 2.4 continued). Consider the frequency distributions for the audit times example.
Audit time (in days)
Frequency
Relative frequency
Percentage frequency
(10-15]
6
0.30
30
(15-20]
7
0.35
35
(20-25]
4
0.20
20
(25-30]
2
0.10
10
(30-35]
1
0.05
5
Total
20
1
100
The cumulative distributions are then given as follows:
Audit time (in days)
Cumulative frequency
Cumulative relative frequency
Cumulative percent frequency
≤ 15
6
0.30
30
≤ 20
13 (=6+7)
0.65 (=0.3+0.35)
65 (=30+35)
≤ 25
17 (=6+7+4)
0.85 (=0.3+0.35+0.2)
85 (=30+35+20)
≤ 30
19 (=6+7+4+2)
0.95 (=0.3+0.35+0.2+0.1)
95 (=30+35+20+10)
≤ 35
20 (=6+7+4+2+1)
1.00 (=0.3+0.35+0.2+0.1+0.05)
100 (=30+35+20+10+5)
Using the cumulative distributions obtained above, we can answer the following questions:
1. What percentage of the audits has an audit-time of at most 25 days?
We can see that 85% of the audits took 25 days or less.
Answer = 85%.
2. What proportion of the audits has an audit-time of more than 20 days?
From the cumulative percent frequencies, we see that 65% of the audits were less than or
equal to 20 days. Therefore, 100% - 65% = 35% of the audits were more than 20 days.
Answer = 0.35.
©Copyright reserved
27
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.2 Summarising data for a quantitative
variable
3. How many audits have an audit-time of more than 25 days?
If 17 audits were less than or equal to 25 days, then 3 audits were more than 25 days. The
answer is 20 - 17 = 3. But what if you didn’t have all the cumulative distributions above?
Consider the following table:
Audit time (days)
Cumulative % frequency
≤ 15
30
≤ 20
65
≤ 25
85
≤ 30
95
≤ 35
100
If 85% of the audits were less than or equal to 25 days, then 15% were more than 25 days.
To get the number of audits that were more than 25 days, you take: 15%×n = 0.15×20 = 3.
4. What percentage of the audit-times is in the interval of 20–25 days?
From the cumulative percent frequencies, we see that 85% of the audits were ≤ 25 days and
65% were ≤ 20 days. Therefore, 85% - 65% = 20% of the audits are in the interval of 20
to 25 days. Answer = 20%.
5. How many audits took more than 20 days and were ≤ 30 days?
We see that 19 audits were ≤ 30 days and 13 audits were ≤ 20 days. Therefore, 19−13 = 6
audits were more than 20 days and ≤ 30 days. But what if you didn’t have all the cumulative
distributions above? Consider the following table:
Audit time (days)
Cumulative % frequency
≤ 15
30
≤ 20
65
≤ 25
85
≤ 30
95
≤ 35
100
We see that 95% of the audits were ≤ 30 days and 65% were ≤ 20 days. Therefore,
95% − 65% = 30% of the audits were in the range 20–30 days. To get the number of audits:
30% × n = 0.30 × 20 = 6.
6. The upper 15% of the audit-times took longer than
days.
From the cumulative percent frequencies, we see that 85% of the audits took 25 days or less.
Therefore, 100% − 85% = 15% of the audits took more than 25 days.
Answer = 25.
©Copyright reserved
28
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.2 Summarising data for a quantitative
variable
The OGIVE: Constructing the graph of the cumulative frequency distribution
• Plot the cumulative frequencies against the upper class limit.
• Add one interval with frequency of 0 at the beginning to “anchor” the graph.
Upper class limit Audit time
Cumulative
(in days)
Frequency
10
0
15
6
20
13
25
17
30
19
35
20
Remark 12. An OGIVE can also represent the cumulative relative frequencies or the cumulative percentage
frequencies.
Try the questions in Example 2.5 again, but only using the OGIVE given above.
2.2.4
Stem-and-leaf display
A stem-and-leaf display is a graphical display used to simultaneously show the rank order and shape of a
distribution of data. To illustrate the use of a stem-and-leaf display, consider the data below:
61
112
73
126
82
92
115
108
86
97
94
106
75
102
118
The first step in constructing a stem-and-leaf display, is to arrange the leading digits of each data point
to the left of a vertical line. To the right of the vertical line, we record the last digit for each data point.
©Copyright reserved
29
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.2 Summarising data for a quantitative
variable
Ordered stem-and-leaf display
6
1
7
35
8
26
9
247
10
268
11
258
12
6
The numbers to the left of the vertical line form the stem, and each digit to the right of the vertical line is
a leaf. Thus, joining the stem with each leaf in the same row, reads back the original data value. For example, the second row contains the two smallest values in the data set, which are 73 and 75, respectively. The
largest value in the data set is read from the last row with stem “12” and leaf “6” – that is, the value of 126.
In order to view the shape of the distribution, we need to rotate the page counterclockwise onto its
side (such that the stem is at the bottom, and reads from small to large values). In this case, we observe
a moderately skewed to the left distribution (as shown below).
Advantages of the stem-and-leaf display, in comparison to the histogram:
• Shows the “raw” data.
• Shows rank order of data.
• The user can see the shape of the data.
Remark 13. If the leaf unit is not given, then the leaf unit is assumed equal to one.
©Copyright reserved
30
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.3
Summarising data for two variables
Example 2.6. Consider the data given in the table below. Set up a stem-and-leaf display using a leaf unit
of 10.
1565
1852
1644
1766
1888
1812
1790
1679
2008
1852
1912
1967
1954
1733
2044
Note: We ignore the 4th digit, for example, 1565 is simply taken as 1560.
Leaf Unit = 10
15
6
16
47
17
369
18
1558
19
156
20
04
From the stem-and-leaf display above, the smallest value is read as 156 × 10 = 1560 (leaf unit = 10).
2.3
2.3.1
Summarising data for two variables
Cross-tabulation
A cross-tabulation is a tabular summary of data for two variables. Although both variables can be either categorical or quantitative, cross-tabulations in which one variable is categorical and the other is
quantitative are just as common.
Example 2.7. Consider the cross-tabulation (two-way frequency table) below, summarising census data
from 2001.
The left and top margin labels define the classes for the two variables, i.e., province and population
group. Each person in the data set is categorised by province and population group. The elements in this
study are the individuals living in South Africa in 2001.
©Copyright reserved
31
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.3
Summarising data for two variables
Example 2.8. The following table shows the low and high temperatures for 20 cities. In this case, the
elements are the cities, while the low and high temperatures are the variables.
Temp
Albuquerque
Atlanta
Baltimore
Charlotte
Cincinnati
Dallas
Denver
Houston
Indianapolis
Las Vegas
Los Angeles
Miami
Minneapolis
New Orleans
Oklahoma City
Phoenix
Portland
San Francisco
Seattle
St. Louis
City
Low
39
35
26
29
41
47
31
54
22
43
46
65
11
50
40
50
38
43
36
27
High
66
61
42
60
41
62
60
70
42
65
60
84
30
68
62
77
54
55
52
45
In the following cross-tabulation the low temperatures are grouped into 6 categories in the rows and the
high temperatures are grouped into 4 categories in the columns. The cross-tabulation shows the number of
cities that fall into each of the cross-tabulation temperature groupings. For examples, there are 4 cities
with a low temperature between 40 and 49, and a high temperature between 60 and 74.
High Temperature
Low Temperature
30-44
10-19
1
20-29
3
30-39
40-49
1
45-59
60-74
1
1
5
2
3
5
4
5
2
60-70
2.3.2
4
Total
1
50-59
Total
75-90
4
10
1
3
1
1
2
20
The scatter diagram and trend line
A scatter diagram is a graphical presentation of the relationship between two quantitative variables.
One variable (the independent variable) is shown on the horizontal axis and the other variable (the dependent variable) is shown on the vertical axis, and the data points are plotted for different values in a data
set. The direction of the scatter diagram indicates the relationship between the two variables.
©Copyright reserved
32
2 SUMMARISING DATA: TABULAR & GRAPHICAL
METHODS
2.3
Summarising data for two variables
A trend line (drawn as a straight line on the scatter diagram) provides an approximation of the linear
relationship between two quantitative variables. We will discuss measures that indicate the strength of
these relationships in Section 3.6.
Chapter 3:
©Copyright reserved
33
3
SUMMARISING DATA: NUMERICAL METHODS
3
Summarising data: numerical methods
3.1
Sigma and factorial notation
Note that this section is regarded as self-study.
3.1.1
Sigma notation
Addition is important in statistical techniques for which the shorthand notation
X
is used.
Example 3.1.
1.
P4
2.
P4
i=1 xi = x1 + x2 + x3 + x4
i=1 x5 = x5 + x5 + x5 + x5 = 4x5
Additional rules:
Sigma rules:
1.
2.
3.
b
X
i=a
b
X
i=a
b
X
4.
c = (b − a + 1)c
n
X
i=1
cyi = c
b
X
5.
yi
i=0
i=a
(xi ± yi ) =
i=a
©Copyright reserved
∞
X
b
X
i=a
xi ±
b
X
i=
n(n + 1)
2
ri =
1
1−r
yi
i=a
34
3
SUMMARISING DATA: NUMERICAL METHODS
3.1.2
3.2
Measures of location
Factorial notation
Factorial notation is used to indicate that the product of consecutive non-negative integers needs to be
found.
Factorial rules:
1.
2.
n! = n × (n − 1) × (n − 2) × · · · × 3 × 2 × 1
0! = 1
Example 3.2.
1. 5! = 5 × 4 × 3 × 2 × 1
2. 101! = 101 × 100 × 99 × . . . × 2 × 1
3.2
3.2.1
Measures of location
Mean
Perhaps the most important measure of location is the mean (average), as it provides a measure of central
location for the data. If the mean is calculated from sampled data, then the mean is denoted by x. On
the other hand, if the mean is calculated from population data, then the mean is denoted by µ.
Definition 1 (Sample mean). The sample mean is defined as
P
xi
x=
n
where n denotes the sample size and xi denotes the ith observation for the random variable X.
Example 3.3. Consider the number of students per class (for five classes):
46
54
42
46
32
The mean (or average) number of students per class is:
P
xi
46 + 54 + 42 + 46 + 32
x=
=
= 44
n
5
©Copyright reserved
35
3
SUMMARISING DATA: NUMERICAL METHODS
3.2.2
3.2
Measures of location
Median
The median is another measure of central location for a variable. The median is the value in the middle
when the data are arranged in ascending order (smallest to largest value).
Computation algorithm:
1. Arrange the data in ascending order (smallest to largest value).
2. For an odd number of observations, the median is the middle value.
3. For an even number of observations, the median is the average of the middle two values.
Example 3.4 (Odd number of observations). Consider the number of students per class (for five classes),
and calculate the median.
46 54 42 46 32
Arrange the values from smallest to largest:
32
42
46
46
54
Middle value = Median = 46
Example 3.5 (Even number of observations). Consider the number of students per class (for ten classes),
and calculate the median.
46 51 54 39 42 33 46 42 47 32
Arrange the values from smallest to largest:
32
33
39
42
46
46
47
51
54
= 44
Median = 42+46
2
©Copyright reserved
36
3
SUMMARISING DATA: NUMERICAL METHODS
3.2
Measures of location
Example 3.6. The yearly income (in R1000’s) of 8 workers is as follows:
95
102
105
120
125
150
220
450
Calculate the mean and the median.
Mean:
x=
P
xi
95+102+105+120+125+150+220+450
= 170.875
n =
8
Median:
For the median, we arrange the values from smallest to largest:
95
102
105
120 125
150
220
450
Median = 120+125
= 122.5
2
Remark 14. Although the mean is the more commonly used measure of central location, in some situations
the median is preferred. The mean is influenced by extremely small and large data values (i.e., outliers),
while the median is not influenced by extreme values, and thus provides a better measure of central location
than the mean.
3.2.3
Mode
Definition 2 (Mode). The mode is the value that occurs the most frequent (that is, that has the highest
frequency).
Example 3.7. Consider the number of students per class, and calculate the mode.
46
54
42
46
32
∴ The mode is 46.
Remark 15. If the data have exactly 2 modes, then the data is bi-modal. Furthermore, if the data have
more than 2 modes, the data is multimodal.
©Copyright reserved
37
3
SUMMARISING DATA: NUMERICAL METHODS
3.2
Measures of location
Example 3.8. Give the most appropriate measure of location for the following data.
Soft drink
Frequency
Coke Classic
19
Diet Coke
8
Dr. Pepper
5
Pepsi-Cola
13
Sprite
5
The mean / mode / median is Coke Classic.
For this type of data, it makes no sense to speak of the mean or median since the data type is categorical.
Identifying the shape of the data using the mean, mode and median
From the above, we have:
• If mean > median > mode, then the data is positively skewed (skewed to the right).
• If mean < median < mode, then the data is negatively skewed (skewed to the left).
• If mean = median = mode, then the data is symmetric (not skewed).
©Copyright reserved
38
3
SUMMARISING DATA: NUMERICAL METHODS
3.2.4
3.2
Measures of location
Percentiles
A percentile provides information about how the data are spread over the interval from the smallest value
to the largest value.
Definition 3 (Percentile). For a data set containing n observations, the pth percentile divides the data into
two parts, namely, (1) approximately p% of the observations are less than or equal to the pth percentile,
and (2) approximately (100 − p)% of the observations are greater than or equal to the pth percentile.
Calculating the pth percentile:
1. Arrange the data in ascending order (smallest to largest value).
2. Compute an index i
p
(n + 1)
100
where p = percentile of interest, and n = sample size.
i=
Example 3.9. Consider the starting salaries for 12 graduates:
3310
3355
3450
3480
3480
3490
3520
3540
3550
3650
3730
3925
Determine the 80th percentile (P80 ) for the starting salary data:
Step 1: Arrange the data in ascending order (if the data are not already sorted).
p
80
Step 2: i = 100
(n + 1) = 100
(12 + 1) = 10.4
Interpretation of the index i: The 80th percentile is 40% of the way between the value in the 10th
position (i.e., 3650) and the value in the 11th position (i.e., 3730). That is, the 80th percentile is
calculated as follows:
(value in the 10th position) + 40% × (distance between values in the 10th and 11th positions)
∴ 3650 +
40
(3730 − 3650) = 3682
100
Interpretation: 80% of the graduates have a starting salary of R3682 or less.
Remark 16. The position of the percentile (i.e., the value of i) should not be rounded to the nearest
integer.
©Copyright reserved
39
3
SUMMARISING DATA: NUMERICAL METHODS
3.2
Measures of location
More examples on the salary data:
Determine the 33rd percentile (P33 ):
i=
33
(12 + 1) = 4.29
100
Determine the median (P50 ):
i=
50
(12 + 1) = 6.5
100
The 33rd percentile is 29% of the way between
The median is exactly in the middle of the
the value in the 4th position (i.e., 3480) and
values in the 6th and 7th positions:
the value in the 5th position (i.e., 3480):
P50 =
P33 = 3480
3490 + 3520
= 3505
2
Interpretation: 33% of the graduates have
Interpretation: 50% of the graduates have
a starting salary of R3480 or less.
a starting salary of R3505 or less.
Determine the 25th percentile (P25 ):
Determine the 75th percentile (P75 ):
i=
25
(12 + 1) = 3.25
100
i=
75
(12 + 1) = 9.75
100
The 25th percentile is 25% of the way between
The 75th percentile is 75% of the way be-
the value in the 3rd position (i.e., 3450) and
tween the value in the 9th position (i.e., 3550)
the value in the 4th position (i.e., 3480):
and the value in the 10th position (i.e., 3650):
P25 = 3450 +
25
(3480 − 3450) = 3457.5
100
P75 = 3550 +
75
(3650 − 3550) = 3625
100
Interpretation: 25% of the graduates have
Interpretation: 75% of the graduates have
a starting salary of R3457.50 or less.
a starting salary of R3625 or less.
©Copyright reserved
40
3
SUMMARISING DATA: NUMERICAL METHODS
3.2.5
3.3
Measures of variability
Quartiles
It is often desirable to divide a data set into four parts, with each part containing approximately 25% of
the data. These division points are referred to as the quartiles, and are defined as follows:
• Q1 = First quartile = 25th percentile
• Q2 = Second quartile = 50th percentile = median
• Q3 = Third quartile = 75th percentile
Remark 17. Quartiles are four specific percentiles, thus the steps for computing percentiles can be applied
directly in the computation of quartiles.
3.3
3.3.1
Measures of variability
Range
The simplest measure of variability is the range, defined as follows:
Range = Largest Value − Smallest Value
= xmax − xmin
• Advantage: Easy to calculate.
• Disadvantages:
– Sensitive to only two data values, i.e., the maximum and minimum.
– Unstable, as it is influenced by extreme values.
Example 3.10. Consider the starting salaries for 12 graduates:
3310
3355
3450
3480
3480
3490
3520
3540
3550
3650
3730
3925
The range is: xmax − xmin = 3925 − 3310 = 615
Suppose one of the graduates received a starting salary of R10000 per month, then the range is equal to:
xmax − xmin = 10000 − 3310 = 6 690
©Copyright reserved
41
3
SUMMARISING DATA: NUMERICAL METHODS
3.3.2
3.3
Measures of variability
Interquartile range (IQR)
A measure of variability that overcomes the sensitivity to extreme values is the interquartile range is the
range for the middle 50% of the data, defined such that
IQR = Q3 − Q1
• Advantages:
– Easy to interpret.
– Not influenced by extreme values.
• Disadvantage: Only based on the middle 50% of the data.
Example 3.11. Consider the starting salaries for 12 graduates:
3310
3355
3450
3480
3480
3490
3520
3540
3550
3650
3730
3925
The interquartile range for the salary data is:
IQR = Q3 − Q1 = 3600 − 3465 = 135
(values for Q1 and Q3 were calculated in Section 3.2.4)
3.3.3
Variance
The variance, a measure of variability that utilizes all the data, can be defined in terms of the population
or sample data.
• Population variance:
2
P
(xi − µ)2
N
P
(xi − x)2
n−1
σ =
• Sample variance:
2
s =
Interpretation: The variance is the approximate average squared deviation from the mean.
Remark 18. The units of measure for the variance are the squared units of measure for the variable
of interest. For example, if the variable, X, is measured in meters, the variance is measured in squared
meters.
©Copyright reserved
42
3
3.3
SUMMARISING DATA: NUMERICAL METHODS
3.3.4
Measures of variability
Standard deviation
The standard deviation is the positive square root of the variance and can therefore be interpreted as the
average deviation of the observations from their mean.
• Population standard deviation:
√
σ=
s
P
(xi − µ)2
N
P
(xi − x)2
n−1
σ 2 and therefore σ =
• Sample standard deviation:
√
s=
s
s2 and therefore s =
Remark 19. The unit of measure for the standard deviation is the same as the unit of measure for the
variable of interest. For example, if the variable, X, is measured in meters, then the standard deviation is
also measured in meters.
Example 3.12. Calculate the standard deviation of the class sizes:
46
54
42
46
32
Given: x = 44
Method 1:
Number of students in class (xi )
xi − x
(xi − x)2
46
2
4
54
10
100
42
-2
4
46
2
4
32
-12
P
(xi − x) = 0
144
P
(xi − x2 ) = 256
2
s =
©Copyright reserved
P
(xi − x)2
256
256
=
=
= 64
n−1
5−1
4
√
∴ s = 64 = 8
43
3
SUMMARISING DATA: NUMERICAL METHODS
3.3
Measures of variability
Method 2:
2
P
s =
2
i (xi − x)
n−1
(x1 − x)2 + (x2 − x)2 + (x3 − x)2 + (x4 − x)2 + (x5 − x)2
=
n−1
2
2
(46 − 44) + (54 − 44) + (42 − 44)2 + (46 − 44)2 + (32 − 44)2
=
5−1
22 + 102 + (−2)2 + 22 + (−12)2
=
4
256
= 64
=
4
∴s=
√
64 = 8
Method 3 (most efficient): Using STAT-mode on your calculator, s = 8.
Note that σ = 7.1554 gives the population standard deviation which is incorrect since we are dealing with
sample data.
Interpretation of the standard deviation:
The average deviation of the class sizes is 8 students from the average class size (44).
Remark 20. Make sure to familiarise yourself with the statistical function on your calculator. Proper
knowledge of these functions can save you a lot of time in tests.
Remark 21. Take care to use the sample standard deviation and not the population standard deviation
on your calculator when working with sample data.
3.3.5
Coefficient of variation
Definition 4 (Coefficient of variation). The coefficient of variation is a relative measure of variability that
measures the standard deviation relative to the mean, defined such that
cv =
s
× 100
x
The coefficient of variation gives us the sample standard deviation as a percentage of the sample mean.
For example, if the coefficient of variation is 5.9%, it tells us that the sample standard deviation is only
5.9% of the sample mean. This is a useful statistic for comparing the variability of variables that have
different standard deviations and different means.
©Copyright reserved
44
3
3.4 Measures of distribution shape,
relative location and detecting outliers
SUMMARISING DATA: NUMERICAL METHODS
Example 3.13. The class test mark (out of 30) and the semester test mark (out of 50) for seven students
are investigated:
Class Test (out of 30)
Semester Test (out of 50)
x1
25
28
x2
13
45
x3
15
41
x4
19
38
x5
9
43
x6
16
28
x7
22
36
x̄class test = 17
x̄semester test = 37
sclass test = 5.44671
ssemester test = 6.83130
Which test has the biggest relative variation? Calculate the relevant numerical measures.
Coefficient of variation for the class test marks:
s
5.44671
× 100 =
× 100 ≈ 32.039%
x
17
Coefficient of variation for the semester test marks:
cv =
cv =
s
6.83130
× 100 =
× 100 ≈ 18.463%
x
37
Therefore, the class test has the biggest relative variation.
3.4
Measures of distribution shape, relative location and detecting outliers
3.4.1
Distribution shapes
In addition to the measures of location and variability, it is often important to have a measure of the shape
of a distribution. Section 2.2.2 notes that a histogram provides a graphical display that shows the shape
of a distribution.
©Copyright reserved
45
3
SUMMARISING DATA: NUMERICAL METHODS
3.4 Measures of distribution shape,
relative location and detecting outliers
Skewed to the left (negative skew)
The left tail is longer; the mass of the distribution is concentrated on the right of the distribution. It
has relatively few low values, that is, more outliers to the left.
Skewed to the right (positive skew)
The right tail is longer; the mass of the distribution is concentrated on the left of the distribution. It
has relatively few high values, that is, more outliers to the right.
Symmetric
Note: The normal distribution (Section 6.2) is symmetric.
©Copyright reserved
46
3
3.4 Measures of distribution shape,
relative location and detecting outliers
SUMMARISING DATA: NUMERICAL METHODS
3.4.2
Z-scores
Often the relative location of values within a data set is of interest. Measures of relative location help to
determine how far a particular observation is from the mean. By considering both the mean and
standard deviation for a selected sample, the z−score is calculated as follows:
zi =
xi − x
s
The z−score, often referred to as the standardised value, can be interpreted as the number of standard
deviations the observation x is from the mean x. More specifically, if a z−score is negative (positive), it
means that the observation x is below (above) the mean.
Example 3.14. Consider the number of students per class (for five classes):
46
54
42
46
32
Calculate and interpret the corresponding z−scores for each of the observations recorded.
Given: x = 44 and s = 8.
Number of Students in Class (xi )
(xi − x)
zi
46
x1 − x = 2
z1 = 28 = 0.25
54
x2 − x = 10
z2 = 10
8 = 1.25
42
x3 − x = −2
z3 = −2
8 = −0.25
46
x4 − x = 2
z4 = 28 = 0.25
32
x5 − x = −12
z5 = −12
8 = −1.5
Interpretation for x2 and x5 :
• The observation 54 (z2 = 1.25) is 1.25 standard deviations above the mean.
• The observation 32 (z5 = −1.5) is 1.5 standard deviations below the mean.
©Copyright reserved
47
3
3.4 Measures of distribution shape,
relative location and detecting outliers
SUMMARISING DATA: NUMERICAL METHODS
Example 3.15. The mathematics marks for 2 students are compared:
Student 1 (School A):
75%
Student 2 (School B):
80%
School
x
s2
s
A
55
64
8
B
80
144
12
Which student has done the best in mathematics, relative to his/her school?
Student 1:
75 − 55
= 2.5
8
Student 1’s mark is 2.5 standard deviations above the mean.
z=
Student 2:
80 − 80
=0
12
Student 2’s mark is exactly the same value as the mean.
z=
Conclusion: Student 1 has done relatively better in his/her school than Student 2.
3.4.3
The Empirical Rule
The empirical rule states that if data is approximately bell-shaped in distribution, we can expect a
specified percentage of the observations within a certain ‘distance’ (namely, standard deviation units) from
the mean. Most commonly, the percentage of observations within one, two and three standard deviations
of the mean are considered. These percentages are defined (and illustrated) below.
Remark 22. The empirical rule is derived from the properties of the normal distribution (Section 6.2).
Empirical Rule:
• ±68% of the data values will be within 1 standard deviation of the population mean µ.
• ±95% of the data values will be within 2 standard deviations of the population mean µ.
• ±100% of the data values will be within 3 standard deviations of the population mean µ.
©Copyright reserved
48
3
SUMMARISING DATA: NUMERICAL METHODS
3.4 Measures of distribution shape,
relative location and detecting outliers
Graphically, the empirical rule can be represented as follows:
Example 3.16. Suppose IQ scores have a bell-shaped distribution with a mean of 100 and a standard
deviation of 15.
a) What percentage of people have an IQ score between 85 and 115?
Answer = 68%
b) What percentage of people have an IQ score between 70 and 130?
Answer = 95%
©Copyright reserved
49
3
SUMMARISING DATA: NUMERICAL METHODS
3.4 Measures of distribution shape,
relative location and detecting outliers
c) What percentage of people have an IQ score of more than 130?
Answer = 2.5%
100% - 95% = 5% (for both yellow tails combined). Then 5%
2 = 2.5% (for only the upper tail).
d) The 16th percentile (P16 ) is equal to:
Answer = 85
100% - 68% = 32% and 32%
2 = 16%. Therefore, P16 = 85.
e) The 84th (P84 ) percentile is equal to:
Answer = 115
16% + 68% = 84%. Therefore, P84 = 115.
©Copyright reserved
50
3
SUMMARISING DATA: NUMERICAL METHODS
3.4 Measures of distribution shape,
relative location and detecting outliers
f ) Is a person with an IQ score of 160 seen as an outlier?
An outlier is seen as any observation less than 55, or greater than 145, since approximately 100%
of the data should lie between these two values (according to the Empirical Rule). Thus, yes, an IQ
score of 160 is seen as an outlier.
OR
The corresponding z-score is calculated as z = 160−100
= 4, which is greater than 3 (see the next
15
section on outliers).
3.4.4
Detecting outliers
Sometimes a data set will have one or more observations which are unusually large or unusually small.
These extreme values are called outliers. It remains necessary for statisticians to analyse these outliers,
as some of these observations may have been incorrectly recorded or included in the data set, which could
be corrected before further analysis. Alternatively, some of the outliers may in fact be correctly captured,
but include some important information which should be kept in the data set and analysed further. Two
methods for detecting outliers can be used, depending on the shape of the distribution:
1. In the case of a bell-shaped distribution, standardized values (z−scores) can be used to
identify outliers using the following rule:
Since ±100% of the data will be within 3 standard deviations of the mean, it is recommended to treat any data value with z−score < −3 or z –score > 3 as an outlier.
2. In the case where a bell-shaped distribution CANNOT be assumed, the following
limits should be calculated:
Lower limit = Q1 − 1.5(IQR)
Upper limit = Q3 + 1.5(IQR)
If a value is less than the lower limit or greater than the upper limit, we can consider
the value as an outlier.
©Copyright reserved
51
3
SUMMARISING DATA: NUMERICAL METHODS
3.5
3.5.1
3.5 Five-number summaries and
boxplots
Five-number summaries and boxplots
Five-number summary
The following 5 numbers are used to summarise data:
1. Smallest (minimum) value
2. First quartile (Q1 )
3. Second quartile (Q2 )
4. Third quartile (Q3 )
5. Largest (maximum) value
3.5.2
The box plot
A box plot is a graphical summary of data that is based on a five-number summary, and provides a visual
way to identify outliers.
Constructing a box plot
1. A box is drawn with the ends of the box located at the first and third quartiles, respectively. This
box contains the middle 50% of the data.
2. A vertical line is drawn in the box at the location of the median, whereas an X is drawn to indicate
the value of the mean.
3. By using the IQR, limits are located at 1.5(IQR) below Q1 and 1.5(IQR) above Q3 . Data points
outside these limits are considered outliers.
4. Horizontal lines extending from each end of the box are drawn to the smallest and largest values
inside the limits calculated in Step 3. The lines are referred to as the whiskers.
5. Finally, each outlier is indicated as a dot outside the limits calculated from Step 3.
Box plots and skewness
Box plots can used to analyse the distribution shape of the data, that is, whether the data is skewed or
symmetric.
The median is in the middle of the box, indicating symmetry.
The median is not centered in the middle of the box, but
closer to the lower quartile, indicating that the shape of the
distribution is skewed to the right.
The median is not centered in the middle of the box, but
closer to the upper quartile, indicating that the shape of the
distribution is skewed to the left.
©Copyright reserved
52
3
SUMMARISING DATA: NUMERICAL METHODS
3.6 Measures of association between two
variables
Remark 23. When deciding whether a distribution is skewed or symmetric, also consider the lengths of
the whiskers. Remember that 25% of the data lies between the minimum and , and , and and lastly and the
maximum, respectively. By considering the lengths of each of these segments, we are considering the spread
of the data. If for instance the distance between and the maximum is greater than the distance between the
minimum and , this could indicate that the data is skewed to the right.
Example 3.17. Consider the five-number summary of the salary data from Section 3.2.2 (Example 3.11):
xmin = 3310,
Q1 = 3465,
Q2 = 3505,
Q3 = 3600,
xmax = 3925
The box plot is drawn as follows:
Upper limit = Q3 + (1.5)(IQR) = 3600 + (1.5)(135) = 3802.5
Lower limit = Q1 - (1.5)(IQR) = 3465 - (1.5)(135) = 3262.5
If a point falls above (below) the upper (lower) limit, the point is seen as an outlier (i.e., xmax = 3925).
3.6
Measures of association between two variables
Thus far we have examined numerical methods used to summarise data for one variable at a time. Often
it is of interest to analyse the relationship between two variables. In this section, we present the covariance
and correlation as descriptive measures of the relationship between two variables.
©Copyright reserved
53
3
SUMMARISING DATA: NUMERICAL METHODS
3.6.1
3.6 Measures of association between two
variables
Covariance
For a sample of size n, the sample covariance is defined as follows:
P
(xi − x) (yi − y)
sxy =
n−1
The covariance provides a measure of the linear relationship between variables X and Y , and is interpreted
as follows:
• sxy > 0 → positive linear relationship
• sxy < 0 → negative linear relationship
• sxy = 0 → no linear relationship
A positive linear relationship
A negative linear relationship
Remark 24. The covariance does not indicate the strength of the relationship since the covariance depends
on the units of measurement for X and Y . That is, larger (or smaller) values for the covariance does not
indicate a greater (or weaker) strength of the linear relationship between X and Y . A measure that is an
indication of the strength of the relationship is known as the correlation coefficient.
©Copyright reserved
54
3
SUMMARISING DATA: NUMERICAL METHODS
3.6.2
3.6 Measures of association between two
variables
Correlation coefficient
To measure the strength of the linear relationship between x and y, the sample correlation coefficient is
defined as follows:
sxy
rxy =
sx sy
where sxy represents the sample covariance between X and Y , and sx and sy represent the sample standard
deviation of X and Y , respectively. The correlation coefficient is bounded such that −1 ≤ rxy ≤ 1, and
measures the strength and direction of the linear relationship between X and Y .
Positive linear relationship
rxy = 1; perfect positive linear relationship
Negative linear relationship
rxy = −1; perfect negative linear relationship
No linear relationship
rxy = 0
©Copyright reserved
55
3
3.6 Measures of association between two
variables
SUMMARISING DATA: NUMERICAL METHODS
Example 3.18. Consider the observations for the variables X and Y below, together with the calculations
for the variance and standard deviation of X, the variance and standard deviation of Y , the covariance
and correlation coefficient between X and Y :
x
y
(xi − x)
(xi − x)2
(yi − y)
(yi − y)2
(xi − x)(yi − y)
2
50
-1
1
-1
1
1
5
57
2
4
6
36
12
1
41
-2
4
-10
100
20
3
54
0
0
3
9
0
4
54
1
1
3
9
3
1
38
-2
4
-13
169
26
5
63
2
4
12
144
24
3
48
0
0
-3
9
0
4
59
1
1
8
64
8
2
46
-1
1
-5
25
5
30
510
0
20
0
566
99
P
x=
30
xi
=
=3
n
10
P
and
y=
510
yi
=
= 51
n
10
1. Calculate the variance and the standard deviation of X:
P
(xi − x)2
20
2
sx =
=
= 2.2 and
n−1
10 − 1
2. Calculate the variance and the standard deviation of Y:
P
(yi − y)2
566
s2y =
=
= 62.8 and
n−1
10 − 1
sx =
sy =
√
√
2.2 = 1.4907
62.8 = 7.9303
3. Calculate and interpret the covariance between X and Y:
P
(xi − x)(yi − y)
99
sxy =
=
= 11
n−1
9
There is a positive linear relationship between X and Y.
4. Calculate and interpret the correlation coefficient between X and Y:
rxy =
sxy
11
=
≈ 0.93
(sx sy )
(1.4907)(7.9303)
There is a strong positive linear relationship between X and Y.
©Copyright reserved
56
3
3.7 The weighted mean and grouped
data
SUMMARISING DATA: NUMERICAL METHODS
3.7
3.7.1
The weighted mean and grouped data
Weighted mean
In the formulas for the mean defined in Section 3.2.1 give equal importance or weight to each observation
(xi ). Although this practice is most common, in some instances the mean is computed by giving each
observation a weight that reflects its relative importance. A mean computed in this manner is referred to
as a weighted mean, and is defined as follows:
P
wi x i
x= P
wi
where wi represents the weight for the ith observation.
Example 3.19. Consider the following sample of 5 purchases of raw material.
Purchase
Cost per pound ($)
Number of pounds
1
3.00
1200
2
3.40
500
3
2.80
2750
4
2.90
1000
5
3.25
800
Calculate the mean cost per pound for the raw material.
x=
(1200)(3) + (500)(3.4) + (2750)(2.8) + (1000)(2.9) + (800)(3.25)
= 2.96
1200 + 500 + 2750 + 1000 + 800
Example 3.20. The net full supply capacity (FSC, in millions of cubic metres) in the various regions and
catchment areas in South Africa, and also the percentage content as on 31 August 1992 are given in the
table below.
Region/catchment area
FSC (wi )
% content (xi )
Vaaldam
2529
20
Bloemhofdam
1269
20
Sterkfonteindam
2617
99
Calculate the weighted mean for the percentage content in the catchment areas.
P
wi x i
w1 x1 + w2 x2 + w3 x3
(2529)(20) + (1269)(20) + (2617)(99)
x= P
=
=
= 52.23%
wi
w1 + w2 + w3
2529 + 1269 + 2617
©Copyright reserved
57
3
3.7 The weighted mean and grouped
data
SUMMARISING DATA: NUMERICAL METHODS
3.7.2
Grouped data
Grouped data are data formed by aggregating individual observations of a variable into groups or classes,
such that a frequency distribution of these groups serves as a convenient way of summarising and analysing
the data (refer to Sections 2.2.1 and 2.2.2). The sample mean and sample variance for grouped data is
defined as follows:
P
x=
fi Mi
n
and
P
2
s =
fi (Mi − x)2
n−1
where the midpoint for the ith group/class is calculated as
Mi =
lower class limit + upper class limit
.
2
Example 3.21. The audit times for 20 clients are summarised as follows:
Audit times (in days)
Frequency
Mi
10-14
4
10 + 14
2 = 12
15-19
8
15 + 19
2 = 17
20-24
5
20 + 24
2 = 22
25-29
2
25 + 29
2 = 27
30-34
1
30 + 34
2 = 32
Total:
20
Sample mean for the grouped data is:
P
fi Mi
x=
n
f1 M1 + f2 M2 + f3 M3 + f4 M4 + f5 M5
=
n
(4)(12) + (8)(17) + (5)(22) + (2)(27) + (1)(32)
=
20
= 19
Sample variance for the grouped data is:
P
fi (Mi − x)2
s2 =
n−1
f1 (M1 − x)2 + f2 (M2 − x)2 + f3 (M3 − x)2 + f4 (M4 − x)2 + f5 (M5 − x)2
=
n−1
2
2
4(12 − 19) + 8(17 − 19) + 5(22 − 19)2 + 2(27 − 19)2 + 1(32 − 19)2
=
20 − 1
=30
The sample standard deviation is:
s=
√
30 = 5.477
Chapter 4:
©Copyright reserved
58
4
INTRODUCTION TO PROBABILITY THEORY
4
Introduction to probability theory
Scientists and business managers often base their decisions on the analysis of uncertainties. Questions such
as “What is the chance that a new investment will be profitable? ” or “How likely is it that the new innovation will increase productivity? ” may be asked. Probability measures the likelihood that an event will
occur. Thus, uncertainties in various aspects of life can be measured using probabilities. If probabilities
for specific events can be calculated, the likelihood that these events will occur can be determined.
Probabilities are always assigned on a scale from 0 to 1, with a value close to 0 indicating an event is
unlikely to occur and a value close to 1 indicating an is event is almost certain to occur. In the event of
“rain tomorrow”, a probability of 0 indicates that no rain is expected for tomorrow, whereas a probability
of 0.8 indicates that it is very likely that it will rain tomorrow. Furthermore, a probability of 0.5 indicates
that rain is just as likely to occur as not.
4.1
Experiments, counting rules and assigning probabilities
An experiment is defined as a process that generates specified outcomes. On any single repetition of
an experiment, only one of the possible experimental outcomes will occur. The sample space is the
collection of all the possible outcomes of an experiment.
Example 4.1. When rolling a die, you can observe the values 1, 2, 3, 4, 5, or 6.
• Experiment: Rolling a die
• The possible experimental outcomes: 1, 2, 3, 4, 5, 6
(Experimental outcomes are also known as sample points in the sample space)
• Sample space: S = {1, 2, 3, 4, 5, 6} where S is called the sample space.
• The number of experimental outcomes: 6
• Defining the events:
E1 = value observed on the die is a 1
E2 = value observed on the die is a 2
E3 = value observed on the die is a 3
E4 = value observed on the die is a 4
E5 = value observed on the die is a 5
E6 = value observed on the die is a 6
More examples of experiments and experimental outcomes:
1. Coin toss: S = {Head, Tail}
2. Select a part for inspection: S = {Defective, Non-defective}
3. Play a soccer game: S = {Win, Lose, Tie}
©Copyright reserved
59
4
INTRODUCTION TO PROBABILITY THEORY
4.1.1
4.1 Experiments, counting rules and
assigning probabilities
Counting rules, combinations and permutations
How many experimental outcomes are there? Being able to identify and count the experimental outcomes
in any given experiment is a crucial step in assigning probabilities. Some of these counting rules include
the rule for a multiple-step experiment, combinations and permutations.
Multiple-step experiments
Example 4.2. Tossing two coins can be thought of as a two-step experiment in which step (1) is the
tossing of the first coin, and step (2) is the tossing of the second coin. Let H denote tossing a head, and
T denote tossing a tail.
• Sample space: S = {(H, H), (H, T), (T, H), (T, T)}
• The total number of experimental outcomes: 4
• Tree diagram: A graphical representation that is helpful in visualizing a multiple-step.
Counting rule for multiple-step experiments:
If an experiment can be described as a sequence of k steps with
n1 = possible outcomes on step 1
n2 = possible outcomes on step 2
..
.
nk = possible outcomes on step k
then the total number of experimental outcomes are:
n1 × n2 × · · · × nk
©Copyright reserved
60
4
INTRODUCTION TO PROBABILITY THEORY
4.1 Experiments, counting rules and
assigning probabilities
Example 4.2 (continued). Tossing two coins can be thought of as a two-step experiment in which step
(1) is the tossing of the first coin, and step (2) is the tossing of the second coin. Let H denote tossing a
head, and T denote tossing a tail.
From the above, we have n1 = 2 {H, T} and n2 = 2 {H, T}.
Therefore, according to the rule for multiple-step experiments, the total number of experimental outcomes
is n1 × n2 = 4 (as illustrated by the tree diagram on the previous page).
Example 4.3. Tossing five coins is considered as a five-step experiment in which each of the five steps
have two outcomes, i.e., tossing a head ( H), or tossing a tail ( T). According to the rule for multiple-step
experiments, the total number of experimental outcomes is 2 × 2 × 2 × 2 × 2 = 25 = 32.
Example 4.4. Determine how many different routes can a parcel follow if there are:
• 2 starting venues
• 3 cars
• 4 delivery points
Using the counting rule for multiple-step experiments, we have:
n1 = 2 {Starting venue #1, Starting venue #2}
n2 = 3 {Car #1, Car #2, Car #3}
n3 = 4 {Delivery point #1, Delivery point #2, Delivery point #3, Delivery point #4}
Thus, there are a total of n1 × n2 × n3 = 24 possible experimental outcomes (i.e., different routes).
Factorials (!)
Factorials can be thought of as a special case of multi-step experiments in which each step has one less
possible outcome than the previous step, and all sample points are used.
On the calculator: n! or x!
Some examples on the calculation of factorials:
1. 6! = 6 × 5 × 4 × 3 × 2 × 1 = 720
2. 10! = 3 628 800
©Copyright reserved
61
4
INTRODUCTION TO PROBABILITY THEORY
4.1 Experiments, counting rules and
assigning probabilities
Example 4.5. There are 3 people at a bus stop. How many different ways can the 3 people be arranged?
From the above, there are 3 steps in the arrangement of the people waiting at the bus stop, where the
number of outcomes (people) in each step (arrangement) is:
n1 = 3 (3 people can be arranged in the first step)
n2 = 2 (after one person is already arranged, 2 people can be arranged in the second step)
n3 = 1 (after two people are already arranged, 1 person can be arranged in the second step)
Thus, applying the formal definition of the multiple-step experiment counting rule, the total number of
outcomes can be calculated as follows:
3! = 3 × 2 × 1 = 6
Combinations
The rule for combinations allows one to count the number of experimental outcomes when the
experiment entails the selection of n objects from a set of N objects. That is, the number of
combinations of N objects taken n at a time is:
N!
N
N
=
Cn =
n
n!(N − n)!
Order of selection is NOT important
Example 4.6. Consider a quality control process in which an inspector selects 2 of 5 parts to inspect for
defects. In a group of 5 parts, how many combinations of 2 parts can be selected?
5!
5!
5
5
=
C2 =
=
= 10
2
2!(5 − 2)!
2!3!
Example 4.7. Consider the LOTTO game in which a participant must select a group of 6 numbers from
numbers 1 to 49. How many experimental outcomes are there?
C649 = 13 983 816
On the calculator: Cnr or n Cr
More examples on the calculation of combinations:
1. C26 = 15
2. C 61 = 6
3. C56 = 6
©Copyright reserved
62
4
INTRODUCTION TO PROBABILITY THEORY
4.1 Experiments, counting rules and
assigning probabilities
Permutations
The rule for permutations allows one to count the number of experimental outcomes when n objects
are selected from a set of N objects where the order of selection is important. That is, the number
of permutations of N objects taken n at a time is:
N!
N
N
Pn = n!
=
n
(N − n)!
Order of selection is important
Remark 25. It is interesting to note that factorials are merely a special case of permutations with n = N .
Example 4.8. Consider a quality control process in which an inspector selects 2 of 5 parts to inspect for
defects. How many arrangements may be selected?
5!
5!
5
5
=
P2 = 2!
=
= 20
2
(5 − 2)!
3!
On the calculator: Pnr or n Pr
4.1.2
Assigning probabilities
The three approaches most frequently used to assign probabilities to experimental outcomes are as follows:
1. Classical method
2. Relative frequency method
3. Subjective method
Regardless of the method used, the two basic requirements for assigning probabilities must be met,
namely:
1. All probabilities must be between 0 and 1, inclusively. That is, for Ei denoting the ith experimental
outcome, we have
0 ≤ P (Ei ) ≤ 1
for all values of i.
2. The sum of probabilities for all experimental outcomes must equal 1. That is, for n experimental
outcomes, we have
P (E1 ) + P (E2 ) + . . . + P (En ) = 1.
©Copyright reserved
63
4
INTRODUCTION TO PROBABILITY THEORY
4.1 Experiments, counting rules and
assigning probabilities
Classical method
The classical method of assigning probabilities is appropriate when all the experimental outcomes are
equally likely. Thus, if n experimental outcomes are possible, a probability of n1 is assigned to each
experimental outcome.
Example 4.9. When rolling a die, you can observe the values 1, 2, 3, 4, 5, or 6.
• The number of experimental outcomes: 6
• Define the events:
E1 = Value on the die is a 1
E2 = Value on the die is a 2
E3 = Value on the die is a 3
E4 = Value on the die is a 4
E5 = Value on the die is a 5
E6 = Value on the die is a 6
• Assigning the probabilities of the events:
P (E1 ) = 61
P (E2 ) = 16
P (E3 ) = 16
P (E4 ) = 61
P (E5 ) = 61
P (E6 ) = 16
Note: P (E1 ) + P (E2 ) + · · · + P (E6 ) = 61 + 16 + 16 + 61 + 16 + 61 = 66 = 1
Relative frequency method
The relative frequency method is appropriate when data are available to estimate the proportion of time
the experimental outcome will occur if the experiment is repeated a large number of times.
Remark 26. The larger your sample, the closer your probabilities will be to the “true” probabilities.
©Copyright reserved
64
4
INTRODUCTION TO PROBABILITY THEORY
4.2
Basic relationships of probability
Example 4.10. Consider a study of waiting times in the X-ray department for a local hospital. The
number of patients waiting for service at 9am was recorded for 20 successive days. The following results
were obtained:
Number waiting
Frequency
0
2
1
5
2
6
3
4
4
3
20
Then:
P (0) =
P (1) =
P (2) =
P (3) =
P (4) =
2
20 = 0.1 = probability of 0 patients waiting for service
5
20 = 0.25 = probability of 1 patient waiting for service
6
20 = 0.3 = probability of 2 patients waiting for service
4
20 = 0.2 = probability of 3 patients waiting for service
3
20 = 0.15 = probability of 4 patients waiting for service
Subjective method
The subjective method is most appropriate when it is unrealistic to assume that the experimental outcomes
are equally likely (i.e., cannot use the classical method), or when little relevant data are available (i.e.,
cannot use relative frequency method).
Example 4.11. A ranger thinks that the probability of seeing a lion is 0.3. Then, the probability of not
seeing a lion is 0.7.
4.2
4.2.1
Basic relationships of probability
Complement of an event
Given an event A, the complement of A is defined to be the event consisting of all sample points that are
not in A, denoted by Ac or A. This concept is illustrated in the Venn diagram on the following page.
Remark 27. P (A) + P (A) = 1, thus the probability of event A can be calculated as P (A) = 1 − P (A).
©Copyright reserved
65
4
INTRODUCTION TO PROBABILITY THEORY
4.2.2
4.2
Basic relationships of probability
Union of two events
The union of events A and B is the event containing all sample points belonging to A or B, or both. This
union is denoted by A ∪ B, and illustrated by the shaded region in the Venn diagram below.
4.2.3
Intersection of two events
The intersection of events A and B is the event containing the sample points belonging to both A and B.
This intersection is denoted by A ∩ B, and illustrated by the shaded region in the Venn diagram below.
©Copyright reserved
66
4
INTRODUCTION TO PROBABILITY THEORY
4.2.4
4.2
Basic relationships of probability
Addition law
The addition law is helpful when we are interested in knowing the probability that at least one of two
events occurs. That is, given events A and B, we might be interested in knowing the probability that event
A or event B or both occur. Given the above, the addition law is used to calculate the probability of the
union of two events, such that
P (A ∪ B) = P (A) + P (B) − P (A ∩ B) .
Remark 28. Note that the first two terms in the addition law, P (A) + P (B), account for all the sample
points in A ∪ B. However, because the sample points within the intersection are in both A and B, we are
in effect counting each of the sample points in A ∩ B twice when we calculate P (A) + P (B). Thus, we need
to subtract P (A ∩ B) to correct for this overcounting.
4.2.5
Mutually exclusive events
Two events are said to be mutually exclusive if the events have no sample points in common – that is, if
there is no intersection such that P (A ∩ B) = 0. This concept is illustrated in the Venn diagram below.
Note that for mutually exclusive events the addition law is defined such that
P (A ∪ B) = P (A) + P (B) .
4.2.6
Other probability laws
Commutative laws
• A∪B =B∪A
• A∩B =B∩A
• A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
• A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
©Copyright reserved
67
4
4.3
INTRODUCTION TO PROBABILITY THEORY
Conditional probability
Associative laws
• (A ∪ B) ∪ C = A ∪ (B ∪ C)
• (A ∩ B) ∩ C = A ∩ (B ∩ C)
DeMorgan’s laws
• (A ∩ B) = A ∪ B
• (A ∪ B) = A ∩ B
4.3
Conditional probability
The conditional probability of event A occurring, given that event B has taken place, is defined as
P (A|B) =
P (A ∩ B)
.
P (B)
The above reads as “the probability of A given B”.
Example 4.12. Consider the number of employees summarised according to gender and whether they have
been promoted or not in the table below.
Gender
Promoted
Male
Female
Total
Yes
288
36
324
No
672
204
876
Total
960
240
1200
Define the events:
A = Promoted
M = Male
Then:
A = Not promoted
M = Female
1. Calculate the probability that an employee is promoted.
P (A) =
324
= 0.27
1200
Note: This is a marginal probability.
©Copyright reserved
68
4
INTRODUCTION TO PROBABILITY THEORY
4.3
Conditional probability
2. Calculate the probability that an employee is not promoted.
P (A) =
876
= 0.73
1200
or
P (A) = 1 − P (A) = 1 − 0.27 = 0.73
Note: This is a marginal probability.
3. Calculate the probability that an employee is male.
P (M ) =
960
= 0.8
1200
Note: This is a marginal probability.
4. Calculate the probability that an employee is female.
P (M ) =
240
= 0.2
1200
or
P (M ) = 1 − P (M ) = 1 − 0.8 = 0.2
Note: This is a marginal probability.
5. Calculate the probability that a randomly selected employee is male and promoted.
P (M ∩ A =
288
= 0.24
1200
Note: This is a joint probability.
6. Calculate the probability that a randomly selected employee is female and promoted.
P (M ∩ A =
36
= 0.03
1200
Note: This is a joint probability.
7. Calculate the probability of getting a promotion, given that the employee is male.
P (A|M ) =
288
P (A ∩ M )
288
= 1200
=
= 0.3
960
P (M )
960
1200
Note: This is a conditional probability, and male is the given event. Thus, you can work
with the column total for males.
©Copyright reserved
69
4
4.3
INTRODUCTION TO PROBABILITY THEORY
Conditional probability
8. Calculate the probability of getting a promotion, given the employee is female.
P (A|M ) =
36
P (A ∩ M )
36
= 1200
240 = 240 = 0.15
P (M )
1200
Note: This is a conditional probability, and female is the given event. Thus, you can work
with the column total for females.
9. Calculate the probability of being male, given that the employee was promoted.
P (M |A) =
288
P (M ∩ A)
288
= 1200
=
= 0.8889
324
P (A)
324
1200
Note: This is a conditional probability, and promoted is the given event. Thus, you can
work with the column total for promoted.
10. Calculate the probability that an employee who was not promoted, is female.
P (M |A) =
204
P (M ∩ A)
204
= 1200
876 = 876 = 0.2329
P (A)
1200
Note: This is a conditional probability, and not promoted is the given event (since we are
specifically focusing on an employee who was not promoted). Thus, you can work with the
column total for not promoted.
Note that the joint probability table if given below, where the joint probabilities can be found inside
the body of the table (intersections of events), and the marginal probabilities can be found in the margins
of the table. Also note that all probabilities add up to 1.
Gender
4.3.1
Promoted
Male
Female
Total
Yes
0.24
0.03
0.27
No
0.56
0.17
0.73
Total
0.8
0.2
1
Independent events
Two events A and B are independent if
P (A|B) = P (A)
or
P (B|A) = P (B) .
This definition is used to test for dependence/independence.
©Copyright reserved
70
4
INTRODUCTION TO PROBABILITY THEORY
4.3
Conditional probability
Example 4.12 (continued). We have already calculated all the appropriate marginal and conditional probabilities. In order to test for dependence/independence between gender and whether or not an employee is
promoted, any one of the following marginal and conditional probabilities may be compared to one another:
Option 1:
P (M ) = 0.8
P (M | A) = 0.8889
P (M |A) ̸= P (M )
∴ The two events are dependent.
Option 2:
P (M ) = 0.2
P (M |A) = 0.2329
P (M |A) ̸= P (M )
∴ The two events are dependent.
Option 3:
P (A) = 0.27
P (A | M ) = 0.15
P (A |M ) ̸= P (A)
∴ The two events are dependent.
Remark 29. There are other options, for example, comparing P (A) to P (A|M ), etc. Here we’ve only
shown 3 possible ways to test for dependence/independence between gender and whether or not an employee
gets promoted.
4.3.2
Multiplication law
Whereas the addition law is used to calculate the probability of a union of two events, the multiplication law
is used to calculate the probability of the intersection of two events. Based on the definition of conditional
probability, the multiplication law is defined such that
P (A ∩ B) = P (B)P (A|B)
or
P (A ∩ B) = P (A)P (B|A).
Two events A and B are independent if
P (A ∩ B) = P (A)P (B)
since we know that P (A|B) = P (A) or P (B|A) = P (B) for independent events.
©Copyright reserved
71
4
4.3
INTRODUCTION TO PROBABILITY THEORY
Conditional probability
Example 4.12 (continued). We have already calculated all the appropriate marginal and joint probabilities.
In order to test for dependence/independence between gender and whether or not an employee is promoted,
any one of the following marginal and joint probabilities may be compared to one another:
Option 1: P (M ) = 0.8; P (A) = 0.27; P (M ∩ A) = 0.24
P (M )P (A) = 0.216
P (M ∩ A) ̸= P (M )P (A)
∴ The two events are dependent.
Option 2: P (M ) = 0.2; P (A) = 0.27; P (M ∩ A) = 0.03
P (M )P (A) = 0.054
P (M ∩ A) ̸= P (M )P (A)
∴ The two events are dependent.
There are other options. Here we’ve only shown 2 possible ways to test for dependence/independence
between gender and whether or not an employee gets promoted.
Example 4.13 (Independent events). Consider P (L) = 0.3 and P (C) = 0.08. Suppose the two events L
and C are independent. Calculate P (L ∪ C).
It is given that events L and C are independent, therefore P (L ∩ C) = P (L)P (C).
∴ P (L ∪ C) = P (L) + P (C) − P (L ∩ C)
= P (L) + P (C) − P (L)P (C)
(addition law)
(because of independence)
= 0.356
Chapter 5:
©Copyright reserved
72
5
DISCRETE PROBABILITY DISTRIBUTIONS
5
Discrete probability distributions
In this chapter, we extend the study on probability theory by introducing the concepts of random variables
and probability distributions, with specific focus on discrete probability distributions.
Terminology:
• At least → X ≥ a
• Less than → X < a
• At most → X ≤ a
• More than → X > a
5.1
Random variables
In Chapter 4 the concept of an experiment and its associated experimental outcomes were defined. A
random variable is a numerical description of an outcome in the sample space of a random experiment.
A random variable is denoted by an uppercase letter such as X, with a particular numerical (observed)
value of the random variable X is denoted by a lowercase, x. A random variable is classified as being either
discrete or continuous.
If a random variable consists of finite or countable infinite set of outcomes (i.e., if the possible values change
by steps or jumps), it is referred to as discrete random variable.
Example 5.1. Suppose we flip a coin 5 times and count the number of tails observed. The number of tails
could be 0, 1, 2, 3, 4 or 5. Therefore, it can be any integer value from 0 to 5. However, it could not be
any number between 0 and 5. We could not, for example, observe 2.5 tails. Therefore, the number of tails
must be discrete. Here, we define the random variable X = number of tails, where the possible values are
x = 0, 1, . . . , 5.
Example 5.2. Consider the sales of automobiles. If it is of interest to study the gender of customers,
we define the random variable X = gender of customer, where the possible values are x = 0 if female and
x = 1 if male. Take note that a numerical value is used to describe a specific outcome within the experiment
– in this case, we observe again integers, thus a discrete random variable is referred.
If a random variable has values that can take any value within an interval (finite or infinite) or range (i.e.,
if it takes on values on a continuous scale), it is referred to as a continuous random variable.
Example 5.3. The height of trees is an example of a continuous random variable. Is it possible for a
tree to be 2.105 meters tall? Sure. How about 2.10567 meters? Yes. Here, we define the random variable
X = tree height, where the possible values are x ≥ 0.
In most practical problems, discrete random variables represent count data, whereas continuous random
variables represent measured data.
©Copyright reserved
73
5
5.2
DISCRETE PROBABILITY DISTRIBUTIONS
5.2
Discrete probability distributions
Discrete probability distributions
The probability distribution of a random variable, X, is a description of how probabilities are distributed
over the possible values of the random variable. The probability mass function P (X = x) = f (x)
provides the probability for each value of the random variable. For a function to be a valid probability
mass function, it needs to meet the following two requirements (introduced in Chapter 4):
1. 0 ≤ f (x) ≤ 1 for all f (x)
P
2.
f (x) = 1
Using the methods discussed in Chapter 4 (i.e., classical method, subjective method and relative frequency
method), one can assign probabilities to each of the possible values for a specified random variable. If the
relative frequency method is used to develop discrete probability distributions (applicable when reasonably
large amounts of data are available), an empirical discrete distribution is referred.
Example 5.4. Consider the sales of cars at a car dealership over the past 300 days.
Frequency distribution:
Number of cars sold per day
0
1
2
3
4
5
Number of days (frequency)
54
117
72
42
12
3
300
Note: We make the assumption that no more than 5 cars are sold per day.
• Define the random variable:
X = the number of cars sold during a day.
• Sample space: S = {0, 1, 2, 3, 4, 5}
• Assigning probabilities using the relative frequency method:
P (X = 0) = f (0) = probability of 0 cars sold
P (X = 1) = f (1) = probability of 1 car sold
P (X = 2) = f (2) = probability of 2 cars sold
P (X = 3) = f (3) = probability of 3 cars sold
P (X = 4) = f (4) = probability of 4 cars sold
P (X = 5) = f (5) = probability of 5 cars sold
©Copyright reserved
74
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.2
Discrete probability distributions
• Probability distribution for the number of cars sold per day at a car dealership:
x
0
1
2
3
4
5
Number of days (frequency)
54
117
72
42
12
3
300
f (x)
54
300 = 0.18
0.39
0.24
0.14
0.04
0.01
1
Does the above-mentioned probability function fulfill the required conditions for a discrete probability function?
There are two required conditions:
1. 0 ≤ f (x) ≤ 1 for all f (x)
P
2.
f (x) = 1
Yes, both requirements are fulfilled.
Answer the questions below:
a) What is the probability that 2 cars are sold per day?
P (X = 2) = f (2) = 0.24
b) What is the probability that at most 2 cars are sold per day?
P (X ≤ 2) = f (0) + f (1) + f (2) = 0.81
©Copyright reserved
75
5
5.2
DISCRETE PROBABILITY DISTRIBUTIONS
Discrete probability distributions
c) The probability that more than 2 cars are sold per day?
P (X > 2) = f (3) + f (4) + f (5) = 0.19
or
P (X > 2) = 1 − P (X ≤ 2) = 0.19
Note that that sum of all probabilities must add to 1.
d) The probability that at least 2 cars are sold per day?
P (X ≥ 2) = f (2) + f (3) + f (4) + f (5) = 0.43
or
P (X ≥ 2) = 1 − P (X < 2) = 1 − [f (0) + f (1)] = 0.43
Note that that sum of all probabilities must add to 1.
e) The probability that more than 1 but less than 4 cars are sold per day?
Hint: draw your number line → 0 1 2 3 4 5
P (1 < X < 4) = f (2) + f (3) = 0.63
or
P (1 < X < 4) = P (X ≤ 3) − P (X ≤ 1)
= [f (0) + f (1) + f (2) + f (3)] − [f (0) + f (1)]
= 0.63
Example 5.5. A random variable X has the following discrete probability distribution:
x
f (x) =
, for x = 1, 2, 3, 4
10
Calculate the probabilities for all possible values of x below.
x
1
2
3
4
f (x)
0.1
0.2
0.3
0.4
Does the above-mentioned probability function fulfill the required conditions for a discrete probability function?
There are two required conditions:
1. 0 ≤ f (x) ≤ 1 for all f (x)
P
2.
f (x) = 1
Yes, both requirements are fulfilled.
©Copyright reserved
76
5
5.2
DISCRETE PROBABILITY DISTRIBUTIONS
5.2.1
Discrete probability distributions
Discrete uniform probability distribution
The simplest example of a discrete random variable is one that assumes only a finite number of possible
values, each with equal probability.
A random variable has a discrete uniform distribution if for each of the n observations
x1 , x2 , . . . , xn we have
1
f (x) =
n
where n is the number of values the random variable may assume.
Example 5.6. Consider the experiment of rolling a die. Define the random variable X to be the number
of dots facing upwards.
For this experiment, n = 6 values are possible to observe for the random variable X, and since all outcomes
are equally likely, the discrete uniform probability distribution applies.
∴ f (x) =
1
6
for
x = 1, 2, 3, 4, 5, 6
x
f (x)
1
1
6
1
6
1
6
1
6
1
6
1
6
2
3
4
5
6
Does the above-mentioned probability function fulfill the required conditions for a discrete probability function?
There are two required conditions:
1. 0 ≤ f (x) ≤ 1 for all f (x)
P
2.
f (x) = 1
Yes, both requirements are fulfilled.
©Copyright reserved
77
5
5.3
DISCRETE PROBABILITY DISTRIBUTIONS
5.3
Expected value and variance
Expected value and variance
• The expected value, or mean, of a random variable is a weighted average of the values of the
random variable where the weights are the probabilities. It is simply a measure of central location
for the random variable.
• The variance is a weighted average of the squared deviations of a random variable from its mean
where the weights are the probabilities.
• Standard deviation is the square root of variance.
The expected value, variance and standard deviation of a discrete random variable can be calculated
using the following formulae:
E(X) = µ =
V ar(X) = σ 2 =
X
X
√
σ=
x f (x)
(x − µ)2 f (x)
σ2
Example 5.7. Consider the probability distribution for sales of cars at a particular car dealership, and
calculate the expected value, variance and standard deviation for the random variable X = number of cars
sold per day.
Expected Value:
E(X) = µ
X
=
x f (x)
= 0(0.18) + 1(0.39) + 2(0.24) + . . . + 5(0.01)
= 1.5
©Copyright reserved
78
5
5.3
DISCRETE PROBABILITY DISTRIBUTIONS
Expected value and variance
Variance:
V ar(X) = σ 2
X
=
(x − µ)2 f (x)
= (0 − 1.5)2 (0.18) + (1 − 1.5)2 (0.39) + . . . + (5 − 1.5)2 (0.01)
= 1.25
Standard deviation:
√
σ =
σ 2 = 1.118
Using a table:
x
0
1
2
3
4
5
f (x)
0.18
0.39
0.24
0.14
0.04
0.01
x f (x)
0
0.39
0.48
0.42
0.16
0.05
µ = 1.5
(x − µ)2 f (x)
0.4050
0.0975
0.0600
0.3150
0.2500
0.1225
σ 2 = 1.25
Note that the expected value and standard deviation can be obtained using STAT mode on your
calculator, with the probabilities f (x) as frequencies (i.e., weights) for the specified x-values.
Example 5.8. A psychologist has determined that the number of hours required to obtain the trust of a
new patient is either 1, 2 or 3 hours.
Let X = time in hours required to gain the patient’s trust.
The following probability function has been proposed:
f (x) =
x
6
for
x = 1, 2, 3
a) Set up the probability mass function of X.
x
f (x)
1
1
6 = 0.1667
2
6 = 0.3333
3
6 = 0.5
2
3
©Copyright reserved
79
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.3
Expected value and variance
b) Is this a valid probability function? Explain.
There are two required conditions:
1. 0 ≤ f (x) ≤ 1 for all f (x)
P
2.
f (x) = 1
Yes, both requirements are fulfilled.
c) What is the probability that it takes exactly 2 hours to gain the patient’s trust?
P (X = 2) = f (2) = 0.3333
d) What is the probability that it takes at least 2 hours to gain the patient’s trust?
P (X ≥ 2) = f (2) + f (3) = 0.8333
or
P (X ≥ 2) = 1 − P (X < 2) = 1 − f (1) = 0.8333
e) Calculate the expected value, variance and standard deviation.
E(X) = µ
X
=
x f (x)
== 1(0.1667) + 2(0.3333) + 3(0.5)
= 2.3333
V ar(X) = σ 2
X
=
(x − µ)2 f (x)
= (1 − 2.3333)2 (0.1667) + (2 − 2.3333)2 (0.3333) + (3 − 2.3333)2 (0.5)
= 0.5556
√
∴σ =
σ 2 = 0.7454
Remark 30. Note that the expected value and standard deviation can be obtained using STAT mode on
your calculator, with the probabilities p(x) as frequencies (i.e., weights) for the specified x-values.
©Copyright reserved
80
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.4
5.4
Binomial distribution
Binomial distribution
The binomial probability distribution is a discrete probability distribution that is associated with a
multiple-step experiment which is referred to as the binomial experiment.
The four properties of a binomial experiment:
1. The experiment consists of a sequence of n identical trials.
2. Two outcomes are possible on each trial, namely, success or failure.
3. The probability of a success, denoted by p does not change from trial to trial. Consequently,
the probability of a failure, denoted by 1 – p, does not change from trial to trial.
4. The trials are independent.
In a binomial experiment our interest is always in the number of successes occurring in the n trials (hence
the binomial probability distribution is discrete in nature). In general:
• Let X = the number of successes.
• Then X has a binomial distribution of n trials, and the probability of a success for each trial is p
(where 0 ≤ p ≤ 1).
The binomial probability mass function is given by:
n x
p (1 − p)n−x
f (x) =
x
where
x = number of successes
p = probability of success on one trial
n = number of trials
f (x) = probability of x successes in n trials
Here, we denote that X ∼ Bin(n, p) – that is, X follows a binomial distribution with n and p. The
expected value (µ) and variance (σ 2 ) for the binomial probability distribution are defined as
follows:
E(X) = µ = np
V ar(X) = σ 2 = np(1 − p)
Remark 31. Note that the possible values for X always start at 0 (i.e., if none of the trials are successes)
and end at n (i.e., if all trials are successes). Values outside x ∈ [o, n] are not possible to observe for any
binomial experiment.
©Copyright reserved
81
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.4
Binomial distribution
Shape of the binomial distribution:
©Copyright reserved
82
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.4
Binomial distribution
Example 5.9. Let us consider the purchase decisions of the next 3 customers who enter a particular
clothing store. On the basis of past experience, the store manager estimates the probability that any one
customer will make a purchase is 0.3.
Let:
S = customer makes a purchase (success)
F = customer does not make a purchase (failure)
The above mentioned is a binomial experiment, because:
1. n = 3 identical trials
2. Two possible outcomes.
• customer makes a purchase (success)
• customer does not make a purchase (failure)
3. Probability of a success p = 0.3 and a failure 1 – p = 0.7
4. The trials are independent.
Let X = number of customers that make a purchase (i.e., successes).
Tree diagram:
©Copyright reserved
83
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.4
Binomial distribution
Total number of experimental outcomes:
Using the tree diagram, we count 8 experimental outcomes.
Using the counting rule for multiple-step experiments we get (n1 )(n2 )(n3 ) = (2)(2)(2) =
8.
In general, since the binomial distribution only has two possible outcomes on each step (success
or failure), we can use the formula 2n which in this case equals 23 = 8, where n denotes the
number of trials in the binomial experiment.
Calculating binomial probabilities: f (x) =
n x
p (1 − p)n−x
x
a) Calculate the probability that 2 out of the 3 customers make a purchase.
3
0.32 0.71 = 0.189
P (X = 2) = f (2) =
2
b) Calculate the probability that 1 out of the 3 customers make a purchase.
3
0.31 0.72 = 0.441
P (X = 1) = f (1) =
1
c) Calculate the probability that 3 out of the 3 customers make a purchase.
3
0.33 0.70 = 0.027
P (X = 3) = f (3) =
3
d) Calculate the probability that 0 out of the 3 customers make a purchase.
3
P (X = 0) = f (0) =
0.30 0.73 = 0.343
0
©Copyright reserved
84
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.4
Binomial distribution
e) The probability distribution for the number of customers making a purchase:
x
0
1
2
3
f (x)
0.343
0.441
0.189
0.027
1
Does it fulfill the basic requirements for a discrete probability function?
There are two required conditions:
1. 0 ≤ f (x) ≤ 1 for all f (x)
P
2.
f (x) = 1
Yes, both requirements are fulfilled.
f ) Calculate the expected value, variance and standard deviation of X (i.e., the number of successes).
E(X) = µ = np = 0.9
V ar(X) = σ 2 = np(1 − p) = 0.63
Stdev(X) =
√
0.63 = 0.794
Example 5.10. Suppose 10 customers go into a particular store to make a purchase. It is known that the
probability of making a purchase is 0.3.
Let X = number of customers that make a purchase.
Answer the questions below:
1. Define the distribution of X.
X ∼ Bin(10, 0.3)
2. Calculate the expected value, variance and standard deviation of X.
E(X) = µ = np = 3
V ar(X) = σ 2 = np(1 − p) = 2.1
Stdev(X) = σ =
©Copyright reserved
√
2.1 = 1.449
85
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.4
Binomial distribution
3. Calculate the probability distribution of X.
x
f (x)
10
f (0) =
(0.3)0 (0.7)10−0 = 0.0282
0
10
f (1) =
(0.3)1 (0.7)10−1 = 0.1211
1
0.2335
0.2668
0.2001
0.1029
0.0368
0.0090
0.0014
0.0001
0.0000
0
1
2
3
4
5
6
7
8
9
10
4. Give a graphical representation of the probability distribution of X.
©Copyright reserved
86
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.4
Binomial distribution
5. Calculate the cumulative distribution of X, P (X ≤ x), in Excel.
Binomial distribution in Excel – see your Excel Guide (Section 5.2.2) for more
details.
Formula worksheet:
Note that the last argument in the BINOM.DIST function refers to whether a cumulative
probability is calculated (i.e., TRUE), or not (i.e., FALSE).
Value worksheet:
©Copyright reserved
87
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.4
Binomial distribution
6. Use the Excel output above to calculate the following probabilities:
(a) At most 3 clients purchase something:
Using marginal probabilities:
P (X ≤ 3) = f (0) + f (1) + f (2) + f (3) = 0.0282 + · · · + 0.2668 = 0.6496
Using cumulative probabilities:
P (X ≤ 3) = 0.6496
(b) Only 3 clients purchase something:
Using marginal probabilities:
P (X = 3) = 0.2668
Using cumulative probabilities: Consider number line → 0 1 2 3 4 . . . 10
P (X = 3) = P (X ≤ 3) − P (X ≤ 2) = 0.6496 − 0.3828 = 0.2668
(c) More than 1 client purchase something:
Consider number line → 0 1 2 3 4 . . . 10
Using cumulative probabilities (suggested):
P (X > 1) = 1 − P (X ≤ 1) = 1 − 0.1493 = 0.8507
(d) More than 2 but less than 5 clients purchase something:
Consider number line → 0 1 2 3 4 5 . . . 10
Using marginal probabilities:
P (2 < X < 5) = f (3) + f (4) = 0.2668 + 0.2001 = 0.4669
Using cumulative probabilities:
P (2 < X < 5) = P (X ≤ 4) − P (X ≤ 2) = 0.8497 − 0.3828 = 0.4669
(e) Less than 5 clients purchase something:
Using marginal probabilities:
P (X < 5) = f (0) + f (1) + f (2) + f (3) + f (4) = 0.8497
Using cumulative probabilities:
P (X < 5) = P (X ≤ 4) = 0.8497
©Copyright reserved
88
5
DISCRETE PROBABILITY DISTRIBUTIONS
5.4
Binomial distribution
(f ) At least 4 clients purchase something:
Consider number line → 0 1 2 3 4 . . . 10
Using cumulative probabilities (suggested):
P (X ≥ 4) = 1 − P (X ≤ 3) = 1 − 0.6496 = 0.3504
(g) Exactly 6 clients do not purchase anything:
If 6 clients do not purchase anything (out of 10 clients), then 4 clients did purchase something.
Using marginal probabilities:
P (X = 4) = 0.2001
Using cumulative probabilities: Consider number line → 0 1 2 3 4 . . . 10
P (X = 4) = P (X ≤ 4) − P (X ≤ 3) = 0.8497 − 0.6496 = 0.2001
(h) Calculate the probability that the first three clients make a purchase:
Remember from Chapter 4 that having independent events A and B, we have
P (A ∩ B) = P (A)P (B).
Thus, the probability that the first three clients make a purchase (and the last 7 not) is calculated
as follows:
0.3 × 0.3 × 0.3 × 0.7 × 0.7 × 0.7 × 0.7 × 0.7 × 0.7 × 0.7 = 0.33 × 0.77 = 0.0022
Additional exercise (to try yourself )
A university found that 20% of its students withdraw without completing the introductory statistics course.
Assume: That 20 students have registered for the course this quarter.
Let: X = number of students withdrawing from the course.
Answer the questions below:
a) Calculate the probability that 2 or less will withdraw.
b) Calculate the probability that exactly 4 will withdraw.
c) Calculate the probability that more than 3 will withdraw.
d) What is the expected number of withdrawals?
e) What is the expected number of students that will not withdraw?
f) Calculate the probability that 15 will not withdraw.
Chapter 6:
©Copyright reserved
89
6
CONTINUOUS RANDOM VARIABLE
6
Continuous random variable
• A continuous random variable can take on any value within a certain range or interval.
• Examples include the height of a person, the depth measurements at randomly chosen locations of a
lake, or the time it takes to complete a task.
• A random variable X is continuous if possible values comprise either a single interval on the
number line, or a union of disjoint intervals (the latter being beyond the scope of this chapter).
• The range for X is the minimum possible value to the maximum possible value.
6.1
Continuous probability distribution
• Let X be a continuous random variable with cumulative distribution function F (x). Suppose that
F (x) is differentiable so that
f (x) =
dF (x)
′
= F (x)
dx
• The function f (x) is called the probability density function (pdf), or simply density of X.
• The pdf does not directly provide probabilities. However, the area under the graph of f (x) corresponding to a given interval does provide the probability that a continuous random variable X
assumes a value x in that range or interval.
• Let X be a continuous random variable. Then the pdf of X is a function f (x) such that for any two
numbers a and b with a ≤ b, we have
Z b
P (a ≤ x ≤ b) =
f (x) dx
a
That is, the probability that X is in the interval [a, b] can be calculated by integrating the pdf of the
random variable X.
• The pdf f (x) is used to calculate various statistical measures, e.g., mean, variance, and cumulative
distribution function (CDF) of the random variable X.
6.1.1
Properties of a probability density function (pdf )
• If X is a continuous random variable with pdf f (x), then
i. f (x) > 0,
f or all values of x.
R
ii. P (x ∈ A) = A f (x) dx
Rb
iii. P (a ≤ x ≤ b) = a f (x) dx
iv. P (X ≤ x) = P (X < x) because P (X = x) = 0
R∞
v. −∞ f (x) dx = 1
• A pdf is a legitimate pdf if the following important properties are satisfied:
i. f (x) > 0, i.e., non-negative for all values of x∈ R. This ensures that probabilities are always
positive.
R∞
ii. −∞ f (x) dx = 1 → i.e., the total probability is 1.
©Copyright reserved
90
6
6.2 Continuous uniform probability
distribution
CONTINUOUS RANDOM VARIABLE
6.1.2
Comparison between discrete and continuous probability distributions
Discrete probability distribution
Continuous probability distribution
The probability
mass
function
p(x) provides the probability that the
random variable assumes a particular
value.
P
0 ≤ p(x) ≤ 1 for all x x p(x) = 1
The probability density function f (x)
does NOT directly provide probabilities.
f (x) ≥ 0 for all x, −∞ < x < ∞ The
AREA under the probability density function f (x) for all values
R ∞ of X : −∞ < x <
∞ equals one, i.e., −∞ f (x) dx = 1
Table 1: Converted Table
• Some of the common continuous random variables used in practice include:
• Continuous uniform distribution
• Normal distribution
• Exponential distribution
• Gamma distribution
We now demonstrate the concepts of a continuous random variable using the uniform and normal
distributions in this chapter.
6.2
Continuous uniform probability distribution
If a < b, a random variable X is said to have a continuous uniform probability distribution on the
interval (a, b) if and only if the density function (or pdf) of X is:
1
for a ≤ x ≤ b
f (x) = b−a
0
elsewhere
“Short hand”-notation: X ∼ U ni(a, b).
The expected value (mean) and variance is given by:
E(X) =
a+b
2
V ar(X) =
(b − a)2
12
Example:
The flight time from Johannesburg to Cape Town is uniformly distributed between 120 and 140.
Let X = the flight time of an airplane traveling from Johannesburg to Cape Town.
∴ X ∼ U ni(120, 140)
f (x) =
©Copyright reserved
1
1
140−120 = 20
0
for 120 ≤ x ≤ 140
elsewhere
91
6
6.2 Continuous uniform probability
distribution
CONTINUOUS RANDOM VARIABLE
Note: f (x) is called the probability density function.
Questions:
1. Calculate the probability that the flight time will be between 120 and 130 minutes.
130
P (120 < X < 130) =
1
(130 − 120) = 0.5
20
Note that the shaded area under the density function can simply be calculated as the area of
a rectangle (i.e., height × width).
2. Calculate the probability that the flight time will be 125 minutes.
P (X = 125) = 0
Note that the area under the density function at 125 minutes is 0.
Note 1: P (X = a) = 0 for any value of a if X
is a continuous random variable.
Note 2: P (a ≤ X ≤ b)
= P (X = a) + P (a < X < b) + P (X = b)
= 0 + P (a < X < b) + 0 = P (a < X < b)
Therefore, P (a ≤ X ≤ b) = P (a < X < b).
Table 2: Converted Table
3. Calculate the probability that the flight time will be between 125 and 150 minutes.
P (125 < X < 150)
= P (125 < X < 140) + P (140 < X < 150)
= P (125 < X < 140) + 0=
1
(140 − 125)
20
= 0.75
Note that X cannot be observed beyond 140, thus P (125 < X < 150) = P (125 < X < 140).
4. The 75th percentile of X is:
Note that 75% of the data is less than P75 .
P75
©Copyright reserved
92
6
6.2 Continuous uniform probability
distribution
CONTINUOUS RANDOM VARIABLE
P (X < P75 ) = 0.75
1
(P75 − 120) = 0.75
20
∴
∴ P75 − 120 = (0.75)(20)
∴ P75 = (0.75)(20) + 120 = 135
5. Calculate the expected value, variance and standard deviation of X:
E(X) =
a+b
120 + 140
=
= 130
2
2
(140 − 120)2
(b − a)2
=
= 33.3333
12
12
p
Stdev(X) = V ar(X) = 5.7735
V ar(X) =
Example:
A random variable X is uniformly distributed between 10 and 20.
∴ X ∼ U ni(10, 20)
a. P (X < 15) = 0.1(15 − 10) = 0.5
b. P (12 < X < 18) = 0.1(18 − 12) = 0.6
c. E(X) = 10+20
= 15
2
2
d. V ar(X) = (20−10)
= 8.3333
12
p
e. Stdev(X) = V ar(X) = 2.8868
FORMULA LIST
f (x) =
E(X) = a+b
2
©Copyright reserved
0
1
, a ≤x ≤ b
b−a
, elsewhere
n
X=
1X
Xi
n
i=1
2
var(X) = (b−a)
12
93
6
6.3
CONTINUOUS RANDOM VARIABLE
6.3
Normal Probability Distribution
Normal Probability Distribution
A random variable X is said to have a normal probability distribution if and only if, for σ > 0 and
−∞ < x < ∞, the density function of X is given by
−(x−µ)
1
f (x) = √ e (2σ2 )
σ 2π
2
where µ = mean and σ 2 = variance.
”Short-hand” notation: X ∼ N (µ, σ 2 )
Characteristics of the normal distribution:
1. The entire family for normal probability distributions can be told apart by their means and standard
deviations/variances.
2. The normal distribution is symmetric around its mean µ, and the tails of the curve extend to infinity
in both directions and theoretically never touch the horizontal axis.
3. The highest point on the normal curve is at the:
(i) Mean (µ) (ii) Median (P50 ) (iii) Mode
4. The mean µ can be any numerical value:
5. Larger σ =⇒ larger variability =⇒ flatter curves.
6. a. The total area under the curve is 1.
b. The total area under the curve to the left of µ is always 0.5.
c. The total area under the curve to the right of µ is always 0.5.
If Z is normally distributed with µ = 0 and σ = 1, then Z is said to have a standard normal distribution.
X −µ
∼ N (0, 1)
σ
The standard normal distribution provides an exactly normal distribution to variables that are nearly
normal. We will use the standard normal distribution to model data as well as probability distributions.
Remark: Probability tables for the standard normal probability distribution are available
in Appendix B.
Z=
6.3.1
Using normal probability distributions
• Many variables are nearly normal, but none are exactly normal. The normal distribution, while never
perfect, provides very close approximations for a variety of scenarios.
• We often want to convert data (X) from a variety of scenarios to a standardised scale (Z-scores;
refer to Section 3.4.2), which can make comparisons more reasonable.
©Copyright reserved
94
6
6.3
CONTINUOUS RANDOM VARIABLE
Normal Probability Distribution
Tutorial
Practical
Mean (µ)
1100
21
Standard deviation (σ)
200
6
Table 3: Converted Table
Example: Consider the distribution of tutorial and practical scores that are both nearly normal.
However, the two distributions differ in their centered location (i.e., mean) and spread (i.e., standard
deviation).
Suppose Ann scored 1300 on her tutorial exercises and Tom scored 24 on his practical test. Who
performed better?
To answer this question, we can use Z-scores (standardisation) to compare observations from different
distributions.
x−µ
σ
Using Ann’s tutorial score (1300), and Tom’s practical score (24) along with the respective means and
standard deviations, we can calculate both of their Z-scores:
z=
ZAnn =
1300 − 1100
=1
200
24 − 21
= 0.5
6
Because Ann’s score was 1 standard deviation above the mean, while Tom’s score was 0.5 standard deviations above the mean, we can say that Ann performed better than Tom.
ZTom =
6.3.2
Using Excel to compute standard normal probabilities
Syntax: NORM.S.DIST(z, cumulative) where z is the z-score for which you would like to calculate
the probability to the left (if cumulative = “True”). Note that this function only applies to the standard
normal distribution.
Note that cumulative = “False” provides the value of the density function, and not a probability.
Examples:
1. P (Z < 1) = P (Z ≤ 1) = 0.8413 (read from the tables in Appendix B)
=NORM.S.DIST(1,TRUE) Answer: 0.8413
2. P (0 < Z < 1) = P (0 ≤ Z ≤ 1) = P (Z < 1)–P (Z < 0) = 0.8413 − 0.5 = 0.3413
• Note that cumulative probabilities can be read from the tables in Appendix B.
• Since the mean for the standard normal distribution is 0, it means 50% of the distribution is to the
left of 0, i.e., P (Z < 0) = 0.5.
=NORM.S.DIST(1,TRUE)-NORM.S.DIST(0.TRUE) Answer: 0.3413
3. P (−1 < Z < 1) = P (−1 ≤ Z ≤ 1) = P (Z < 1)–P (Z < −1) = 0.8413 − 0.1587 = 0.6826
©Copyright reserved
95
6
CONTINUOUS RANDOM VARIABLE
6.3
Normal Probability Distribution
(cumulative probabilities are read from the tables in Appendix B)
=NORM.S.DIST(1,TRUE)-NORM.S.DIST(-1,TRUE) Answer: 0.6827
4. P (Z > 1.58) = P (Z ≥ 1.58) = 1–P (Z < 1.58) = 1 − 0.9429 = 0.0571 (read from Appendix B)
=1-NORM.S.DIST(1.58,TRUE) Answer: 0.0571
5. P (Z < −0.498) = P (Z < −0.50) = 0.3085 (read from the tables in Appendix B)
Note: The tables provided in Appendix B only works with z-scores rounded to 2 decimals. Thus,
-0.498 is rounded to -0.50, but -0.492, for example, would be rounded to -0.49.
=NORM.S.DIST(-0.498,TRUE) Answer: 0.3092
6. P (Z > 1.47) = 1–P (Z < 1.47) = 1 − 0.9292 = 0.0708 (read from the tables in Appendix B)
=1-NORM.S.DIST(1.47,TRUE) Answer: 0.0708
7. P (Z < −1.47) = 0.0708
Note: Answer is the same as question 6 due to symmetry around 0. That is, P (Z < −1.47) = P (Z >
1.47).
=NORM.S.DIST(-1.47,TRUE) Answer: 0.0708
8. P (Z < −3.3) = P (Z ≤ −3.3) ≈ 0
Note that since z = −3.3 is not on the tables, and the normal distribution is bell-shaped, the
empirical rule can be applied, stating that ±100% of the data lies within 3 standard deviations
above the mean, it means that approximately no data is less than 3 standard deviations below
the mean. Thus, we have P (Z < −3.3) ≈ 0.
=NORM.S.DIST(-3.3,TRUE) Answer: 0.000483
6.3.3
6.2.3 Computing the inverse of the standard normal distribution
Given: The area under the curve
Calculate: z-value
Syntax: NORM.S.INV(probability ) where the probability that is given to the function is the area
under the curve to the left of the required z-score. Note that this function returns a value (i.e., z-score)
from the standard normal distribution.
Examples:
1. The area to the left of z is 0.6331. Determine the value of z.
We have P (Z < z) = 0.34.
From the tables in Appendix B, the z-score for a cumulative probability of 0.6331 is 0.34.
=NORM.S.INV(0.6331) Answer: 0.3401
2. Determine the z-score so that the probability to get a larger z-score is 0.1.
We have P (Z > z) = 0.1. Thus, P (Z < z) = 0.9.
From the tables in Appendix B, the z-score for a cumulative probability closest to 0.9 is 1.28.
©Copyright reserved
96
6
6.3
CONTINUOUS RANDOM VARIABLE
Normal Probability Distribution
=NORM.S.INV(0.9) Answer: 1.28155
3. The area to the right of z is 0.119. Determine the value of z.
We have P (Z > z) = 0.119. Thus, P (Z < z) = 0.881.
From the tables in Appendix B, the z-score for a cumulative probability of 0.881 is 1.18.
=NORM.S.INV(1-0.119) OR =NORM.S.INV(0.881) Answer: 1.1800
4. The area to the left of z is 0.33. Determine the value of z.
We have P (Z < z) = 0.33.
From the tables in Appendix B, the z-score for a cumulative probability of 0.33 is -0.44.
=NORM.S.INV(0.33) Answer: -0.4399
6.3.4
6.2.4 Percentiles
Recall that in Section 3.2.4 we calculated the pth percentile for a sample of size n by first calculating the
position index (i) of the percentile. The ith position for the pth percentile in an ordered data set is given
by the formula:
p i=
n
100
When finding percentiles of a random variable from a normal distribution we will, however, follow a
different procedure. If we refer to the 5th percentile, for example, then we know that the area to the left
of the point is 0.05. If we refer to the 95th percentile, for example, then we know that the area to the left
of the point is 0.95. Knowing the area to the left of a point, we can get the corresponding z-score.
We can then calculate the percentile for X using z = x−µ
σ .
The corresponding z-score to the 5th percentile:
The corresponding z-score to the 95th percentile:
Example: Suppose X is normally distributed with µ = 100 and σ = 5.
For the 5th percentile: Substitute z, µ and σ into z = x−µ
σ to solve for the percentile of X.
−1.645 =
x − 100
5
→ ∴ x = 91.775
For the 95th percentile: Substitute z, µ and σ into z = x−µ
σ to solve for the percentile of X.
x − 100
→ ∴ x = 108.225
5
Example: Suppose X = number of miles a tire will last. It is known that X is normally distributed
with a mean of 36 500 miles and a standard deviation of σ = 5 000 miles.
1.645 =
1. Calculate the probability that a rear tire will not last more than 20 000 miles:
500
P (X < 20 000) = P Z < 20 000−36
= P (Z < −3.3) ≈ 0
5 000
Using Excel: =NORM.DIST(20000, 36500, 5000, TRUE)
Answer: 0.0005
©Copyright reserved
97
6
6.3
CONTINUOUS RANDOM VARIABLE
Normal Probability Distribution
2. What percentage of the tires can be expected to last more than 40 000 miles?
40 000 − 36 500
P (X > 40 000) = P Z >
= 1 − P (Z < 0.7) = 1 − 0.758 = 0.242
5 000
Using Excel: = 1 – NORM.DIST(40000, 36500, 5000, TRUE)
Answer: 0.24196
3. Calculate the probability that a tire’s lifetime is between 20 000 and 40 000 miles.
P (20 000 < X < 40 000) = P (−3.3 < Z < 0.7) = P (Z < 0.7) − P (Z < −3.3)≈ 0.758 − 0 = 0.758
Using Excel:
= NORM.DIST(40000,36500,5000,TRUE) – NORM.DIST(20000,36500,5000,TRUE)
Answer: 0.7576
4. How long must the guarantee period be so that less than 2.5% of the tires that are under guarantee
will be replaced?
If we know the area to the left of z equals 0.025, we can find the corresponding z -value:
P (Z < z) = 0.025
From the tables in Appendix B, the z-score for a cumulative probability of 0.025 is -1.96.
Now we solve for x:
−1.96 =
x − 36 500
5 000
→ ∴ x = 26 700
Using Excel: =NORM.INV(0.025, 36500, 5000)
Answer: 26700.19
5. Compute the minimum tire mileage for the top 2.5% of tires.
If we know the area to the right is 0.025, it means that the area to the right of z equals 0.975,
and we can find the corresponding z-value as follows: P (Z < z) = 0.975
From the tables in Appendix B, the z-score for a cumulative probability of 0.975 is 1.96.
Now we solve for x:
1.96 =
x − 36 500
5 000
→ ∴ x = 46 300
Using Excel: =NORM.INV(0.975,36500,5000)
Answer: 46299.81
©Copyright reserved
98
6
6.3
CONTINUOUS RANDOM VARIABLE
Normal Probability Distribution
Cumulative probabilities for the standard normal distribution
.00
.01
.02
.03
.04
.05
.06
.07
.08
.09
-3.0
.0013
.0013
.0013
.0012
.0012
.0011
.0011
.0011
.0010
.0010
-2.9
.0019
.0018
.0018
.0017
.0016
.0016
.0015
.0015
.0014
.0014
-2.8
.0026
.0025
.0024
.0023
.0023
.0022
.0021
.0021
.0020
.0019
-2.7
.0035
.0034
.0033
.0032
.0031
.0030
.0029
.0028
.0027
.0026
-2.6
.0047
.0045
.0044
.0043
.0041
.0040
.0039
.0038
.0037
.0036
-2.5
.0062
.0060
.0059
.0057
.0055
.0054
.0052
.0051
.0049
.0048
-2.4
.0082
.0080
.0078
.0075
.0073
.0071
.0069
.0068
.0066
.0064
-2.3
.0107
.0104
.0102
.0099
.0096
.0094
.0091
.0089
.0087
.0084
-2.2
.0139
.0136
.0132
.0129
.0125
.0122
.0119
.0116
.0113
.0110
-2.1
.0179
.0174
.0170
.0166
.0162
.0158
.0154
.0150
.0146
.0143
-2.0
.0228
.0222
.0217
.0212
.0207
.0202
.0197
.0192
.0188
.0183
-1.9
.0287
.0281
.0274
.0268
.0262
.0256
.0250
.0244
.0239
.0233
-1.8
.0359
.0351
.0344
.0336
.0329
.0322
.0314
.0307
.0301
.0294
-1.7
.0446
.0436
.0427
.0418
.0409
.0401
.0392
.0384
.0375
.0367
-1.6
.0548
.0537
.0526
.0516
.0505
.0495
.0485
.0475
.0465
.0455
-1.5
.0668
.0655
.0643
.0630
.0618
.0606
.0594
.0582
.0571
.0559
-1.4
.0808
.0793
.0778
.0764
.0749
.0735
.0721
.0708
.0694
.0681
-1.3
.0968
.0951
.0934
.0918
.0901
.0885
.0869
.0853
.0838
.0823
-1.2
.1151
.1131
.1112
.1093
.1075
.1056
.1038
.1020
.1003
.0985
-1.1
.1357
.1335
.1314
.1292
.1271
.1251
.1230
.1210
.1190
.1170
-1.0
.1587
.1562
.1539
.1515
.1492
.1469
.1446
.1423
.1401
.1379
-0.9
.1841
.1814
.1788
.1762
.1736
.1711
.1685
.1660
.1635
.1611
-0.8
.2119
.2090
.2061
.2033
.2005
.1977
.1949
.1922
.1894
.1867
-0.7
.2420
.2389
.2358
.2327
.2296
.2266
.2236
.2206
.2177
.2148
-0.6
.2743
.2709
.2676
.2643
.2611
.2578
.2546
.2514
.2483
.2451
-0.5
.3085
.3050
.3015
.2981
.2946
.2912
.2877
.2843
.2810
.2776
-0.4
.3446
.3409
.3372
.3336
.3300
.3264
.3228
.3192
.3156
.3121
-0.3
.3821
.3783
.3745
.3707
.3669
.3632
.3594
.3557
.3520
.3483
-0.2
.4207
.4168
.4129
.4090
.4052
.4013
.3974
.3936
.3897
.3859
-0.1
.4602
.4562
.4522
.4483
.4443
.4404
.4364
.4325
.4286
.4247
-0.0
.5000
.4960
.4920
.4880
.4840
.4801
.4761
.4721
.4681
.4641
©Copyright reserved
99
6
6.3
CONTINUOUS RANDOM VARIABLE
Normal Probability Distribution
Cumulative probabilities for the standard normal distribution
.00
.01
.02
.03
.04
.05
.06
.07
.08
.09
.0
.5000
.5040
.5080
.5120
.5160
.5199
.5239
.5279
.5319
.5359
.1
.5398
.5438
.5478
.5517
.5557
.5596
.5636
.5675
.5714
.5753
.2
.5793
.5832
.5871
.5910
.5948
.5987
.6026
.6064
.6103
.6141
.3
.6179
.6217
.6255
.6293
.6331
.6368
.6406
.6443
.6480
.6517
.4
.6554
.6591
.6628
.6664
.6700
.6736
.6772
.6808
.6844
.6879
.5
.6915
.6950
.6985
.7019
.7054
.7088
.7123
.7157
.7190
.7224
.6
.7257
.7291
.7324
.7357
.7389
.7422
.7454
.7486
.7517
.7549
.7
.7580
.7611
.7642
.7673
.7704
.7734
.7764
.7794
.7823
.7852
.8
.7881
.7910
.7939
.7967
.7995
.8023
.8051
.8078
.8106
.8133
.9
.8159
.8186
.8212
.8238
.8264
.8289
.8315
.8340
.8365
.8389
1.0
.8413
.8438
.8461
.8485
.8508
.8531
.8554
.8577
.8599
.8621
1.1
.8643
.8665
.8686
.8708
.8729
.8749
.8770
.8790
.8810
.8830
1.2
.8849
.8869
.8888
.8907
.8925
.8944
.8962
.8980
.8997
.9015
1.3
.9032
.9049
.9066
.9082
.9099
.9115
.9131
.9147
.9162
.9177
1.4
.9192
.9207
.9222
.9236
.9251
.9265
.9279
.9292
.9306
.9319
1.5
.9332
.9345
.9357
.9370
.9382
.9394
.9406
.9418
.9429
.9441
1.6
.9452
.9463
.9474
.9484
.9495
.9505
.9515
.9525
.9535
.9545
1.7
.9554
.9564
.9573
.9582
.9591
.9599
.9608
.9616
.9625
.9633
1.8
.9641
.9649
.9656
.9664
.9671
.9678
.9686
.9693
.9699
.9706
1.9
.9713
.9719
.9726
.9732
.9738
.9744
.9750
.9756
.9761
.9767
2.0
.9772
.9778
.9783
.9788
.9793
.9798
.9803
.9808
.9812
.9817
2.1
.9821
.9826
.9830
.9834
.9838
.9842
.9846
.9850
.9854
.9857
2.2
.9861
.9864
.9868
.9871
.9875
.9878
.9881
.9884
.9887
.9890
2.3
.9893
.9896
.9898
.9901
.9904
.9906
.9909
.9911
.9913
.9916
2.4
.9918
.9920
.9922
.9925
.9927
.9929
.9931
.9932
.9934
.9936
2.5
.9938
.9940
.9941
.9943
.9945
.9946
.9948
.9949
.9951
.9952
2.6
.9953
.9955
.9956
.9957
.9959
.9960
.9961
.9962
.9963
.9964
2.7
.9965
.9966
.9967
.9968
.9969
.9970
.9971
.9972
.9973
.9974
2.8
.9974
.9975
.9976
.9977
.9977
.9978
.9979
.9979
.9980
.9981
2.9
.9981
.9982
.9982
.9983
.9984
.9984
.9985
.9985
.9986
.9986
3.0
.9987
.9987
.9987
.9988
.9988
.9989
.9989
.9989
.9990
.9990
©Copyright reserved
100
A
A
FORMULAE SHEET
Formulae Sheet
n
1X
x=
xi
n i=1
p
× (n + 1)
i = 100
Pn
w i xi
x = Pi=1
n
i=1 wi
s2 =
Pn
i=1 fi M i
x=
cv =
2
n
1 X
(xi − x)2
n − 1 i=1
2
i=1 fi (Mi − x)
Pn
s =
n
n−1
√
s
(100)
x
s=
s2
LL = Q1 − 1.5 (Q3 − Q1 )
U L = Q3 + 1.5 (Q3 − Q1 )
IQR = Q1 − Q3
zi =
xi − x
s
sxy =
n
1 X
(xi − x) (yi − y)
n − 1 i=1
rxy =
sxy
sx sy
PnN =
N!
(N − n)!
CnN =
N!
n!(N − n)!
E(X) = µ =
X
xf (x)
n x
f (x) =
p (1 − p)n−x
x
V ar(X) = σ 2 =
X
(x − µ)2 f (x)
E(X) = np
V ar(X) = np(1 − p)
©Copyright reserved
101
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )