0% found this document useful (0 votes)
50 views261 pages

Advanced Level Statistics Guide

aaaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views261 pages

Advanced Level Statistics Guide

aaaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

BASIC STATISTICS

FOR ADVANCED LEVEL

Jonathan Kalani
[Link]. B. Ed. Dip E.d

A Simplified Approach
This page is intentionally Left Blank
BASIC STATISTICS FOR ADVANCED

LEVEL MATHEMATICS

By

Kalani Jonathan, [Link]., [Link]., Dip. Ed.

A Simplified Approach
ABOUT THE AUTHOR

The author was born to Pastor and Mrs. Yowasi Mukirania in December 1965. He
studied at Mitandi Primary school starting Primary one in 1973. He joined Mitandi
Secondary school, Saad Secondary school and later Nyakasura School for his A levels.
He later enrolled for a Diploma in Education at the Institute of Teacher Education
(now Kyambogo University) , a [Link] degree(1997) and [Link] (Mathematics) degree in
0ctober 2005 respectively, at Makerere University.

He has taught at Rwenzori High School and Kilembe Secondary School between 1990
and now. He is a former examiner of Uganda National Examinations Board (marked
for thirteen years). He has held various responsibilities some of which are being Games
Master in charge of Net ball, patron of the Mathematics and Wildlife Clubs, Heading
the Mathematics Department and caretaking the school administration as Head teacher
and Deputy Head teacher.

He is a member of the Uganda Mathematical Society and has always presented his
students for the National Mathematics Contest at O and A level since 1999. As a
student, he participated in the contest at primary level in 1979 and university level
in 1996 where he achieved the first position. He has consistently attended the annual
conferences of the Uganda Mathematical Society at Makerere University.

Currently, he is training secondary school teachers in Rwanda.


ACKNOWLEDGEMENTS

I want to thank the members of the Mathematics department of Kilembe Secondary


school especially Mr. Ndeghe Joshua for encouraging me in my endeavour to write this
book and all my former students on whom the material was tested.

I want to give special thanks to Mr. M. Magino (formerly, Chair of the Secondary
School Mathematics panel, National Curriculum Development Center, Uganda) for ac-
cepting to proof read my work and also find publishers for this book. However, all
errors and omissions are entirely mine. I will be very happy if the users respond to
anomalies through the publishers.

I am grateful to Mr. Herbert Oundo who accepted to typeset my work without which
I would have taken much longer to produce the manuscript.

Lastly I want to thank my wife Christine and children Musoki, Biira and Kambale
for the patience whenever I missed their company while working on the text. I did
not get leave to author this book and had to utilize long hours at night and during
weekends hence minimum socialization with the family.

Finally, I want to thank the publishers for accepting to publish my work.

J. Kalani
PREFACE

I have written this book purposely to meet the requirements for those students offering
Mathematics at advanced level throughout the commonwealth countries. This book
could be useful to university students who are doing social sciences, business adminis-
tration or education with a requirement of doing probability and statistics which they
utilize in research or measurement and evaluation.

I was prompted to write this text upon discovering that there were few text books
that broadly covered the requirements for A Level statistics section of Mathematics as
examined by Uganda National Examinations Board and since these change periodically
(as syllabi are reviewed quite often), I decided to write for all possible syllabi for Ad-
vanced Level.

My intention was to write a book for personal and class use. One of the assump-
tions is that students are conversant with the necessary pure mathematics. Numerous
examples have been given because the author believes that this promotes comprehen-
sion and thus encourages the reader to attempt most if not all of the exercises.

Having taught A level Mathematics for twenty years and currently being a trainer of
secondary mathematics teachers, I have found out that there is need for a book which
approaches the subject in an elementary way and assumes that the reader has had little
or no exposure to probability and statistics; which need this book ably satisfies.

Finally I must thank my wife, Christine, for all her help and encouragement, . for
reading the manuscript and checking the arithmetic and Herbert Oundo for Typeset-
ting. Any errors and omissions are entirely mine and I hereby welcome comments and
criticisms from my fellow teachers.
This page is intentionally Left Blank

O
Contents

ABOUT THE AUTHOR................................................................................................. ii


ACKNOWLEDGEMENTS ........................................................................................... iii
PREFACE....................................................................................................................... iv

1 DESCRIPTIVE STATISTICS 1
1.1 Introduction............................................................................................................. 1
1.2 Definition of common terms................................................................................... 1
1.2.1 Population:.................................................................................................. 1
1.2.2 Sample:....................................................................................................... 1
1.2.3 Variable:..................................................................................................... 2
1.2.4 Statistic:...................................................................................................... 2
1.3 Data Representation: .............................................................................................. 2
1.3.1 Bar Graph................................................................................................... 2
1.3.2 Histogram:.................................................................................................. 2
1.3.3 Frequency Polygons................................................................................... 7
1.3.4 The Cummulative Frequency Curve.......................................................... 9
1.4 Measures of Central Tendency.............................................................................. 12
1.4.1 Mean......................................................................................................... 12
1.4.2 Median ..................................................................................................... 16
1.4.3 Mode......................................................................................................... 19
1.4.4 Index Numbers......................................................................................... 23
1.4.5 Moving Averages..................................................................................... 28
1.5 Measures of Dispersion......................................................................................... 32
1.5.1 Range........................................................................................................ 32
1.5.2 Mean Deviation ....................................................................................... 32
1.5.3 Variance and Standard Deviation ............................................................ 33
1.5.4 Percentiles, Deciles and Quartiles............................................................ 39

2 PROBABILITY 50
2.1 Introduction........................................................................................................... 50
2.2 Theoretical Probability.......................................................................................... 50
2.3 Addition Rule........................................................................................................ 53
2.4 Mutually Exclusive Events.................................................................................... 58
2.5 Conditional Probability......................................................................................... 61
2.6 Independent Events............................................................................................... 68
2.7 Baye’s Theorem.................................................................................................... 73
2.8 Permutations and Combinations........................................................................... 76

3 DISCRETE PROBABILITY DISTRIBUTIONS 83


3.1 Introduction........................................................................................................... 83
3.2 Mean...................................................................................................................... 85
3.3 Variance................................................................................................................ 89
3.4 The Cummulative Mass Function (cmf)............................................................... 92
3.5 Median.................................................................................................................. 94

4 THE BINOMIAL DISTRIBUTION 102


4.1 Introduction......................................................................................................... 102
4.2 Mean and Variance of a Binomial Distribution.................................................. 107
4.3 Binomial Recurrence formula ............................................................................ 110

5 THE POISSON DISTRIBUTION 112


5.1 Introduction......................................................................................................... 112
5.2 The Poisson formula .......................................................................................... 112
5.3 Mean and Variance of a Poisson distribution .................................................... 114
5.4 Additive Property of the Poisson distribution .................................................... 116
5.5 The Poisson Approximation to the Binomial Distribution................................. 117

6 CONTINUOUS PROBABILITY DENSITY FUNCTIONS 121


6.1 Introduction......................................................................................................... 121
6.2 Expectation and variance ................................................................................... 125
6.2.1 The Median ............................................................................................ 128
6.3 Mode................................................................................................................... 130
6.3.1 The Cumulative Distribution Function .................................................. 131

7 THE NORMAL DISTRIBUTION 149


7.1 Introduction......................................................................................................... 149
7.2 Standardisation.................................................................................................... 150
7.3 Distribution of a sample mean x from a normal population............................... 155
7.4 Normal Approximation to Binomial Distribution............................................... 156
7.5 Normal Approximation to Poisson distribution.................................................. 158

8 OTHER THEORETICAL DISTRIBUTIONS 162


8.1 Introduction......................................................................................................... 162
8.2 Discrete uniform distribution.............................................................................. 162
8.3 Continuous Uniform distribution ....................................................................... 164
8.4 The Geometric distribution ................................................................................ 169
8.5 The Exponential Distribution.............................................................................. 172
8.6 Moment Generating Functions............................................................................ 174


8.6.1 Mean and Variancefor a discrete distribution................................... 175
8.6.2 Mean and Variancefor the Binomial distribution ............................ 176
8.6.3 Mean and Variancefor the Poisson distribution................................ 177
8.6.4 Mean and Variancefor continous distributions................................. 179

9 ESTIMATION 185
9.1 Introduction......................................................................................................... 185
9.2 Unbiased Estimate of the mean..................................................................... 185
9.3 Unbiased Estimate of the variance................................................................ 186
9.4 The Central Limit Theorem................................................................................ 190
9.5 Confidence intervals........................................................................................... 190

10 SIGNIFICANCE TESTING 200


10.1 SETTING UP A HYPOTHESIS .................................................................... 200
10.2 Tests for small samples (4 unknown) ............................................................ 205
10.2.1 Tests for the Difference between two means for large samples. . 207
10.2.2 Testing if two samples are from the same population ........................ 208
10.2.3 Tests using the Poisson distribution.................................................... 213

11 THE CHI-SQUARED TEST 215


11.1 Calculation of χ 2................................................................................................ 215
11.2 Goodness of fit .................................................................................................. 216

12 CORRELATION ANDREGRESSION 222


12.1 RANK CORRELATION................................................................................... 228
12.1.1 Spearman’s rank correlation ρ ................................................................ 228
12.1.2 Kendall’s Correlation Coefficient.......................................................... 230
12.2 REGRESSION .................................................................................................. 234
12.2.1 Determination of the regression line Equation.................................... 235
Chapter 1

DESCRIPTIVE STATISTICS

1.1 Introduction

• Statistics is a branch of mathematics. It deals with collection, interpretation and


analysis of data. Statistics is so important because it is used in almost all spheres
of life ranging from governments, non-governmental organisations, individual
businesses, e.t.c. It is a subject that cannot be avoided while plannning and
making decisions.
• Statistical data is either qualitative or quantitive.
Attributes like colour, sex altitude, opinion are measured using qualitative data
while numerical quantities like distance, mass height, time e.t.c. are measured
using quantitative data.
• Data may be discrete or continous. Dicrete data is collected by counting and
can only take on integral values while continouous data can take on any value,
integral or not.

1.2 Definition of common terms

1.2.1 Population:
This is a collection of items about which information is required. If there is something
about which information is needed, for instance, ten year olds in a certain town, all ten
year olds comprise the population.

1.2.2 Sample:
This is a finite sub-set of the population. It may not be possible to examine all the ten
year olds in a given town but a certain number of these ten year olds may be examined
and these form the sample of the population.

1
In many cases, we rarely deal with population, but deal with a section of the population
which we have called the sample. An appropriate sample must have all the attributes
of the population about which information is required.

1.2.3 Variable:
This is the observed item and varies between members of the population. A variable
is sometimes called a variate. A variate can be qualitative or quantitative and may be
defined as discrete or continous.

1.2.4 Statistic:
This is a number which characterises the distribution of the variate in the sample. A
statistic represents the parameter. A parameter characterises the distribution of the
variate in the population.
If the value of the statistic is near the value of the parameter, we say that the sample
represents the population. In most cases, the parameter may never be known if the
population is infinite and we are content with the value of the statistic. For instance if
the mean of the population is p, and the mean of the sample is X, x is utilised in place
of the true paramenter value p. It is said to be a good estimator of the population
mean p.

1.3 Data Representation:

Data may be presented diagrammatically or visually by use of bar graphs, histograms,


frequency polygon, Ogive or Pie-chart. These visual diagrams give a visual impression
to the statistician who now goes ahead to analyze and make conclusions about the data.

1.3.1 Bar Graph


This is at times called a bar chart. Class frequencies are plotted against class limits.
Since consecutive classes can never have common limits, the bars have spaces between
them when plotted.

1.3.2 Histogram:
This is a graph where the class frequencies are plotted against class boundaries. The
example below illustrates the difference between a bar graph and a histogram.

Example 1.3.1
The table below gives marks obtained in a test given to Sophomores in the 2019/2020
academic year.

2
Marks Number of students
35 - 39 3
40 - 44 8
45 - 49 16
50 - 54 12
55 - 59 11
60 - 64 6
65 - 69 8
70 - 74 6
Class limits Class boundaries frequency
35 - 39 34.5 - 39.5 3
40 - 44 39.5 - 44.5 8
45 - 49 44.5 - 49.5 16
50 - 54 49.5 - 54.5 12
55 - 59 54.5 - 59.5 11
60 - 64 59.5 - 64.5 6
Use the given data to plot a bar graph and a histogram
65 - 69 64.5 - 69.5 8
70- 74 Solution:
69.5- 74.5 6

3
Class boundaries Frequency
34.5 - 44.5 14
44.5 - 49.5 15
49.5 - 54.5 10
54.5 - 69.5 15
69.5 - 79.4 16
Class boundaries Frequency Frequency density
34.5 - 44.5 14 1.4
44.5 - 49.5 15 3.0
49.5 - 54.5 10 2.0
54.5 - 69.5 15 1.0
69.5 - 79.5 16 1.6

You may be asked to draw a histogram even when the class width is not uniform.
This is done in any of the two ways which utilize frequency density plotted against class
boundaries or standard frequency plotted against class boundaries.
Frequency density is obtained if frequencies of the classes are divided by their widths
while standard frequency is obtained by using the common class width is as the standard
one and then dividing the frequency values by numbers of times the class is the standard
one.
Example 1.3.2
From the information given below, construct a histogram using the two options

Solution:
(i)

4
and 50 - 54.

ffe same visual impression. Whenever the class


tandard frequency or frequency density should be
aries while constructing a histogram.
a collection in terms of inequalities. histograms
nd class boundaries since they are already given
ample shows.

pulation in thousands of different ages in some


listrict in Uganda
Age group Population in thousands
Below 10 3
10 and under 20 4
20 and under 30 10
30 and under 40 12
40 and under 50 10
50 and under 70 4
70 and under 90 2
Class Class width Frequency Frequency density
0-< 10 10 3 0.3
10- < 20 10 4 0.4
20- < 30 10 10 1.0
30- < 40 10 12 1.2
40- < 50 10 10 1.0
50- < 70 20 4 0.2
70- < 90 20Construct a histogram
2 representing
0.1 the above data.
Solution:

The histogram is thus constructed.

Using standard frequency, the frequency table is

6
Class limits No. of times frequency standard frequency
0- < 10 1 3 3
10- < 20 1 4 4
20- < 30 1 10 10
30- < 40 1 12 12
40-<50 1 10 1.0
50- < 70 2 4 2
70- < 90 2 2 1

Once the class widths differ, the histogram should be drawn using either the fre-
quency density or the standard frequency.

1.3.3 Frequency Polygons


When class frequencies are plotted against class marks, the figure obtained is called a
frequency polygon. This polygon is obtained when consecutive points are joined by a
straight line.
Example 1.3.4
The frequency distribution below shows the weights to the nearest kilogram of students
at Kavumu College of Education.

Mass (kg) frequency


50 - 54 6
55 - 59 14
60 - 64 20
65 - 69 30
70 - 74 50
75 - 79 24
80 - 84 12
85 - 89
4

7
Class limits class mark frequency
additional class 47 0
50 - 54 52 6
55 - 59 57 14
60 - 64 62 20
65 - 69 67
Construct a frequency 30 for the above data.
polygon
70 - 74
Solution: 72 50
75 - 79 77 polygon,24
To make a good we shall assume there is a class before the 50 - 54 class that
80 - 84
has frequency82zero. 12
85 - 89 87 4
90 - 94 92 0

Class marks

It may be required that a frequency polygon and a histogram be plotted on the


same graph. This is said to impose a frequency polygon on a histogram.
Example 1.3.5
Using the data below, draw and construct a histogram and on it, super impose a
frequency polygon.

Class limits frequency


10 - 14 6
15 - 19 10
20 - 24 15
25 - 29 20
30 - 34 16
35 - 39 8
40 - 44
5

8
Class limits Class boundaries frequency
Class before 4.5 - 9.5 0
10 - 14 9.5 - 14.5 6
15 - 19 14.5 - 19.5 10
20 - 24 19.5 - 24.5 15
25 - 29Solution: 24.5 - 29.5 20
30 - 34 29.5 - 34.5 16
35 - 39 34.5 - 39.5 8
40 - 44 39.5 - 44.5 5
45 - 49 44.5 - 49.5 0

Note that after constructing a histogram, the midpoints of the tops of the bars are
connected by straight lines.

1.3.4 The Cummulative Frequency Curve


This is also called an Ogive. It is obtained by plotting the cumulative frequency curve
against the Class boundaries.

Example 1.3.6
The table below shows the heights of children measured to the nearest centimetre.

9
Classes Class boundaries frequency cum freq
140 - 144 139.5 - 144.5 6 6
145 - 149 144.5 - 149.5 10 16
150 - 154 149.5 - 154.5 12 28
155 - 159 154.5 - 159.5 18 46
160 - 164 159.5 - 164.5 24 Height 70
(cm) frequency
165 - 169 164.5 - 169.5 15 85
140 - 144 6
170 - 174 169.5 - 174.5 10 145 95
- 149 10
175 - 179 174.5 - 179.5 5 100
150 - 154 12
155 - 159 18
160 - 169 24
165 - 169 15
170 - 174 10
175 - 179 5

Draw a cumulative frequency curve for the data.


Solution:

Example 1.3.7

The frequency distribution below shows the ages in months of goats in the school farm

10
Classes frequency
10 - 19 4
20 - 29 8
30 - 39 10
40 - 49 15
50 - 59 12
60 - 69 6
70 - 79 5
Class limits Class boundaries frequency cum freq
10 - 19 9.5 - 19.5 4 4
20 - 29 19.5 - 29.5 8 12
30 - 39 29.5 - 39.5 10 22
40 - 49 39.5 - 49.5 15 37
50 - 59 49.5 - 59.5 12 49
60 - 69 59.5 - 69.5 6 55
70 - 79 Construct
69.5 - a79.5
cumulative frequency
5 curve60
for the data.
Solution:

Cummulative Frequency curve

Class boundaries

11
Activity A
28 + 35 + 18 + 40 + 62 + 50 + 70
7
Height 150 152 160 162 170 175 180
Frequency 1.4
5 9 Measures
7 5
6of Central 4 2
Tendency

These include the mean, median and mode. These values locate the average value of a
variable in a specific position of the number line with respect to the data.

1.4.1 Mean
This is at times called arithmetic mean. Mean is the average value of the observations,
that is, it is the sum of the observations divided by the number of items observed.
( x + x +…+ x n ) ∑ x i
The mean of the n values x1,x2,x3,... ,xn is x= 1 2 =
n n

Some values may occur in the data ( x 1+ x 2 +…+ x n ) ∑ xi


x= more than once. = If there are n values with respective
frequencies f1,f2,... ,fn, then the mean is givennby n

x=
( f 1 x 1+ f 2 x 2+ …+f n x n )
=
∑ f i xi
f 1+ f 2 +…+ f n ∑ fi

Example 1.4.1
Determine the mean mark of a class test using the data 28, 35,18, 40, 62, 50 and 70.
Solution:

Mean = = 43.3

Example 1.4.2
The data below gives the heights of some students at Kavumu College of Education.
Find the mean height.

Solution:

12
Height Frequency (fx
)
(x)150 (f) 5 750
152 9 136
160 7 1128
162 6 9720
170 5 850
175 4 700
180 2 360
Total 38 612
Mean=
∑ = 6120
fx
∑ f 38
¿ 161.0526316
¿ 161

Weight 200 250 300 450 600 700 900


Frequency 3 4 2 9 10 6 2
Weight (kg) (x) frequency (f) (fx)

200 3 600
250 4 1000
300 2 600
450 9 4050
600 10 6000
700 Example 1.4.36 4200
900 2 1800
TotalThe table below
36 gives the weights of cows in kg that were slaughtered at the city
18250
butchery during the last Christmas season

Find the average weight of the cows.


Solution:

13
20 21 20 22 24 26 30 35
31 32 23 27 28 3440 42
37 45 50 54 49 60 64 63
54 47 46 49 62 61 57 25
26 29 4453 36 48 63 50
Classes Tai 1 ies f X fx
2 0-24 6 22 132 E/x
Me
25-29 7^/ 6 27 162
an f
30-34 /M 4 32 128
35-39 /// 3 37 111 = 18250
= 36
40-44 /// 3 42 126
45-49 6 47 282 = 506.94
50-54 5 52 260 ~ 507kg
55-59 ! 1 57 57
60-64 7^/ may be6need to handle
There 62 data that
372has so many items such that it has to be grouped
so that it is handled appropriately in 1630
Zf=4O a relatively short time without tedious work.

Example 1.4.4
The table below shows the ages of people who attended a rally last week.

Beginning with the 20 - 24 class construct a frequency table and calculate the mean
age.
Solution:
The figures are tallied to find the frequency for each class.

14
Classes f x d fd
20 - 24 6 22 — 20 — 120
25 - 29 6 27 — 15 -90
30 - 34 4 32 — 10 -40
35 - 39 3 37 -5 -15
40 - 44 3 42 0 0
45 - 49 6 47 5 30 Efx
Mean
50 - 54 5 52 10 50 Ef
55 - 59 1 57 15 15 1630
60 - 64 6 62 20 120 EE
40 -50
40.75

Sometimes a working mean is used to solve for the mean, Any x value (midpoint of a
class) can be assumed to be the mean and then the mean is calculated basing on that.
Other x values are handled as deviations from the assumed mean.

Example 1.4.5
Use frequency table in the solution to example 1.4.4 to find the mean using 2 as the
working (assumed) mean.
Solution:

If assumed mean = x, then d = x — x

M - + Efd
Mean = - +
/ ■> J
50
42------
40
40.75

just as before.
If assumed mean is A then d = x — A

15
Efd
mean = A + Ef

Efd
x A + Ef

1.4.2 Median
The median is that value of the variable which divides the distribution into two equal
parts. If the variable is plotted on a number line, the median is the value in the middle.
Example 1.4.6
Determine the median of
(i) 8, 6,10, 9, 9, 7, 5
(ii) 12,15,10,11,16,18,14
(iii) 3, 7, 9,10,13,12, 8
Solution:
The data is arranged in either ascending or descending order
(i) 5, 6, 7, 8, 9, 9, 10
The middle value is 8
Median = 8
(ii) 10,11,12,14,15,10,18
The middle value is 14
Median = 14
(iii) 3, 7, 8, 9, 10, 12, 13, 14
The middle values are 9 and 10

9 + 10
Median 2
9.5

Median for grouped data is found using a frequency table with the formula

Median = L1 + ( 2 'i

where L1 = Lower class boundary of the modal class

16
f
ClassesClass boundaries C.f
35 - 39 34.5 - 39.5 3 3
40 - 44 39.5 - 44.5 8 11
45 - 49 44.5 - 49.5 16 27
50 - 54 49.5 - 54.5 N =12 Total39
of all class frequencies (total no, of observations)
55 - 59 54.5 - 59.5 Cf b = Cummulative
11 50 frequency before the median class
60 - 64 59.5 - 64.5 fm =Frequency
6 56 of the median class.
65 - 69 64.5 - 69.5 i = Class
8 64 width (interval).
70 - 74 69.5 - 74.5 6 70
Example 1.4.7
70
Utilise the table in example 1.4.1 to calculate for the median.
Solution:

The median class is 49.5 — 54.5, (50 — 54)


Li = 49.5,N = 70, [Link] = 27, fm = 12,i = 5
Therefore

(N — f
Median Li + xi
fm

(35 — 27)
= 49.5 + 5
12

= 49.5 + 8X5
12

= 49.5 + 3.33
= 52.8333 - 52.8

Example 1.4.8

Use the data in example 1.4.4 to find the median.


Solution:

17
Classes Class boundaries f C.f
20 - 24 19.5 - 24.5 6 6
25 - 29 24.5 - 29.5 6 12
30 - 34 29.5 - 34.5 4 16
35 - 39 34.5 - 39.5 3 19
40 - 44 39.5 - 44.5 3 22
45 - 49 44.5 - 49.5 6 28
50 - 54 49.5 - 54.5 5 33
55 - 59 54.5 - 59.5 1 34
60 - 64 59.5 - 64.5 6 40

40

In this case L1 = 39.5,N = 40, [Link] = 19, fm = 3,i = 5


Therefore median is

N Cf)
Median = Li + ——---------— x i
fm

(20 - 19)
= 39.5 + x5
3
5
395
= +3
= 41.16666
~ 41.2

Median can be estimated from the cummulative frequency curve. This is done by
reading off a value half way the total frequency on the vertical axis which should tally
with a value on the horizontal axis. The value read off from the horizontal axis gives
the median.
Constructing a cummulative frequency curve for data in this example,

18
The arrow points at the median value, which is 41 according to the graph. This is a
good estimate of 41.2 which we got by calculation.

1.4.3 Mode
This is a value which occurs most frequently. This is got by observation in case of
ungrouped data or by calculation in case of grouped data.
Example 1.4.9

State the mode of the set of data below


(i) (2, 3, 4, 4, 4, 5, 6, 6, 7, 8, 9)
(ii) 1,1, 2, 3, 3, 3, 3, 7, 7, 8, 9, 9
Solution:

(i) Mode is 4
(ii) Mode is 3
In case of grouped data, the mode is given as

Mode = L1 + —xi

19
Classes Class boundaries f
35 - 39 34.5 - 39.5 3
40 - 44 39.5 - 44.5 8
45 - 49 44.5 - 49.5 16
50 - 54 Example
49.5 -1.4.10
54.5 12
55 - 59 Use 54.5 - 59.5of example
the data 11 1.4.1 to find the mode.
60 - 64 59.5
Solution: - 64.5 6
65 - 69 64.5 - 69.5 8
70 - 74 69.5 - 74.5 6
72 43 36 57 47 68 75 79 82 31
52 47 7452 29 72 57 72 87 73
32 52 62 55 42 47 37 57 22 81
27 53 3764 62 32 47 3752 88
55 25 30 67 70 52 67 36 38 76

Mode
= Li + (*+£ ) x i
where
Li = lower boundary of modal class
d1 = difference between modal frequency and frequency of the class before it.
d2 = difference between modal frequency and frequency of class after it
i = class interval.
Therefore

16-
Mo 44. 5
(16 8
de 5+
-
8
8)+
= 8 (16
+4 5
44.
5+ -
4012)
=
12
44.
= 47.83. 5+

Example 1.4.11
The data below shows marks obtained in an aptitude test by candidates who wished to
get admitted to University through Mature Age entry scheme.

20
Classes Tallies f X fx Cf
20-29 //// 4 24.5 98 4
30-39 10 34.5 345 14
40-49 MH 6 44.5 267 20
UH Illi
50-59 iflt Tffl 11 54.5 599.5 31
60-69 W 6 64.5 387 37
70-79 ttH //// 9 74.5 670.5 46
80-89 //// 4 84.5 338 50
50 2705
Beginning with the 20 - 29 class, construct a frequency table for the data. Using the
frequency table
(a) Calculate the mean, median and mode.
(b) construct a cummulative frequency curve and use it to estimate the median
(c) Construct a histogram and use it to estimate the mode.

(a) (i)

E/x
Mean
f
2705
EE
54.1

(ii)

(NN - cf x i
Median Li +
fm

49.5 + 10

50
49.5 +
11
54.05

21
(iii)

r T d-
Mode = L1 + - xi
d- + d-2
5
= 49.5 + x 10
5+5
= 54.5

Note that in this particular case, the modal class is the same as the median
class.

(b)

From the graph, median is 54

22
(c)

From the graph, mode = 54.5

Activity B

1.4.4 Index Numbers

If a set of data is reduced to relative values by comparing it with a fixed number


(base), the relative values are called index numbers or percentage relatives. If
they refer to wages they are called wage relatives. If they refer to prices, they
are called price relatives. The period against which the corresponding values are
compared is called the base period. Examples of index numbers include price
index, wage index, quantity index, e.t.c. A sample quantity index is given by

x 100
qo

23
Example 1.4.12

One kilogram of maize cost shs.800 in 2006 and sh.1200 in 2009. Taking 2006 as
the base year, find the price index in 2009.
Solution:
1200
Price Index =--------x 100 = 150
800
This implies that from 2006 to 2009, the price of maize has gone up by 50%

Example 1.4.13

Broilers on Fred’s farm consumed 2000kg of feeds in January and consumed


3200kg of feeds in March. Using January as the base period, calculate the quan-
tity index for March.
Solution:

3200
Quantity index
y
= -----------x 100
2000
= 160
The quantity of feeds consumed in March was 60% above that of January.

Example 1.4.14

The wage of a porter per day was 1000 in 1999 but in 2009 it was 2500. Using
1999 as the base year, calculate the wage index for 2009.
Solution:
2500
Wage index = x 100 = 250
6
1000
The wage increased by 150% in 2009.

Note 1.4.1

Items are often grouped so that the total price for that group is compared with
the total for that group in a previous (base) period. The index from such a
consideration is called the simple aggregate price index.
This is given by

EPn
EPo

where Pn is the period under consideration and Po is the base period price.

24
Item 2005 amount in shs 2008 amount in shs
Rent 144,000 180,000
Clothing 45,000 65,000
Power 35,000 48,000
Water 8000 9000
Food 150,000
Example 1.4.15 170,000
Transport 60,000 75,000
Musoki spent on the following
442000 547,000items per month in the years 2005 and 2008.

Using 2005 as the base year, calculate the simple aggregate experience index for
2008.
Solution:
The totals for 2005 and 2008 are 442000 and 547000 respectively.
The simple aggregate expenditure index is

547, 000
= 442,000

= 1.237556561
~ 1.2376

The expenditure rose by 23.76% in 2008.

Activity D

Note 1.4.2

There are situations which have many contributory factors which warrant more
complicated index numbers. These are found by use of weighted averages of
the percentage relatives of the contributory factors. If the percentage relatives
are r1,r2,r3 .. .rn having respective weights w1,w2,w3,. ..rn, then the weighted
index is

Example 1.4.16

25
Item Price index Weight
Rent 130 180
Clothing 129 150
Power 140 130
Water 115 210
Food 110 190
Transport 150 200
Item Price index (A) Weight(W) WA
Rent 130 180 23400
Clothing 129 150 19350
Power 140 130 18200
Water 115 210 24150
Food 110 190 20900
Transport 150 200 30000
Total Solution: 1060 136000

Cost of living index

136000
= 1060
= 128.3018868
~ 128.3

This is a composite index number because we need price indices and their weights
to arrive at one resultant figure.
Economists and government planners normally use composite index numbers when
assessing the cost of living and other issues which are influenced by many con-
tributing factors.

Example 1.4.17

In a manufacturing process, five different raw materials are used . The masses
required are in the ratio 1 : 2 : 2 : 5 : 6. The table below shows the cost per unit
of these materials in 2001 and in 2009. Calculate the price index for the cost of
the process in 2009 taking 2001 as the base year.
Solution:
Let the raw materials be A,B,C,D and E

26
Material A B C D E
Cost in 2001 2000 3500 1500 1000 800
Cost in 2009 2400 4300 1800 1400 1100
Item Weight Price 2004 Price 2009
Cement 130 14,000 24000
Bricks 80 50 80
Iron bars 110 8000 16000
Iron sheets 120 10000 15000
Timber 125 1200 2000
Aggregate 90 find 9000
We first 15000
Murramthe weighted
70 6000 8000
Nails average 115of 2000 2300 1 x 2000 + 2 x 3500 + 2 x 1500 + 5 x 1000 + 6 x 800
Sand the cost Weighted
140per 9000 2001
11000
average for 1+2+2+5+6
unit for each
year. 21800
16
21,800
16
1 x 2400 + 2 x 4300 + 2 x 1800 + 5 x 1400 + 6 x 1100
Weighted 2009
average for 1+2+2+5+6
28200
16

28200/16
Therefore, 100
price index 21800/16
for 2009 = 129.3577982
~ 129.4
NB:
Composite
Example
index =
1.4.18
weighted
A building contractor bought various materials for building two houses of the
aggregate
same size and quality in 2004 and 2009. The corresponding prices with their
index.
weights are given in the table below. Using 2004 as the base year, calculate the
weighted average relative price index.

27
Item Weight Price 2004 Price 2009 ~PT xw
Po —LZ
Cement 130 14,000 24000 12 222.86
Bricks 80 50 80 8 128.0
Iron bars 110 8000 16000 25 220.0
Iron sheets 120 10000 15000 3 180.0
Timber 125
Soluti 1200 2000 10 2 208.33
Aggregate on:
90 9000 15000 65 150.0
Murram 70 6000 8000 43 93.33
Nails 115 2000 2300 23 132.25
Sand 140 9000 11000 20 171.11
11
Total 980 9 1505.88

Weighted average relative price index

1505.88
---------x 100
980
152.6612245
153.66

The commodity prices increased by 53.66%

Activity C

Activity E

1.4.5 Moving Averages

For a set of numbers X^X2,..., the moving average of order n is given by the
following set of arithmetic means

Xi + X2 + ... + xn X2 + X3 + ... + Xn+i X3 + X4 .. .Xn+2


, , , . ..
n n n

If the data is quarterly, then the average is n quarterly moving average. If it is


monthly average, the average is known as a monthly moving average.
28
8 + 12 + 14+15 12 + 14 + 15 + 16 14+15 + 16 + 19
, , ,
4 4 4

15 + 16 + 19 + 25 16 + 19 + 21 + 23 19 + 21 + 23 + 25
, 1
4 4 4
Year Month Number admitted
2007 July Solution:
120
October For order
140 4:
2008 January 168
April 130
July 150
October 145
2009 January 152
April 135
July 148 = 12.25,14.25,16,17.75,19.75 and 22
October 146
2010 January For order
154 6:

8 + 12 + 14+15+16 + 19 12 + 14 + 15 + 16 + 19 + 21
6,6,
14 + 15 + 16 + 19 + 21 + 23 15 + 16 + 19 + 21 + 23 + 25
66
= 14,16.5,18 and 19.83

Example 1.4.20

University ABC made quarterly admission for evening computer courses as shown
in the table below:

Plot the row data and four quarterly moving averages on the same graph.

29
Month Admitted Differenc Moving
2007 July 120-^
Octobe 140-.^> 10 2.5 139.5
2008 Januar 108 Oz 10 2.5 147
April 130 -23 -5.75 148.25
July 22 5.5 144.25
OctobeS145 -15 -3.75 145.25
2009 Januaryol152<5>> 3 0.75 145
April utl35/><. -6 -1.5 145.25
July io148/Z^ 19 4.55 145.75
Octobern:146
2010 January 154^

The line connecting 4 point moving averages is the trendline. The discrepancies
between the trend line and the individual points enable us to estimate the seasonal
effects. The trendline and the estimates of the seasonal effects considered together
make it possible to predict future figures.

30
Sun Mon TueWed Thur Fri Sat
Week 1 100 130 125 110 138 130 128
Week 2 92 126 120 108 130 124 122
Wee Day No. 7-Day Moving
1 Sunday lOOx
Monday 130^/X.
Wednes Example
110
1.4.21
>• 123
Thursda 138--^ ^Xl >•
2 Friday The out >•
patient 121.29
department of a hospital, open seven days a week attended to
Sunday 92 120.57
Saturda the following numbers
,120.86 of patients
Monday 126X/Xv
Tuesday 120 / >•119.14
118.29
W ed 108 '// / >• 117.43
nesd ay 130 w//
124 X/
Thursda

Calculate seven day moving averages for the out patient attendances. Plot both
on the same graph. Use your graph to estimate attendance on sunday of the third
week.
Solution:

Attendence on Sunday of week 3 will be 82 patients.

31
Ex
Mean =
n
82 + 93 + 99 + 108 + 112
5
Activity F
= 98.8
1.5 Measures|82of—Dispersion
98.8| + |93 — 98.8| + |99 — 98.8| + 1108 — 98.8| + 1112 —
Mean deviation = 98.8|
These measures are used to find the spread5 of the observation from the mean or about
the mean. They include range, mean deviation, quartiles, percentiles, deciles, variance
and standard deviation.

1.5.1 Range
This is the difference between the highest and the lowest value in the set.
Example 1.5.1
For the set S below, find the range
(i) S = {12,17, 21,14, 23,19}
(ii) S = {43, 50, 64, 74, 85, 67, 79, 38}
Solution:

(i) The range of S is 23 — 12 = 11


(ii) The range of S is 85 — 38 = 47

1.5.2 Mean Deviation


For a set of numbers, the mean deviation is given by

E \xi — M|
n

where M is the mean


Example 1.5.2
Find the mean deviation for the set of numbers 82, 93, 99, 108, 112.
Solution:

32
Classes 10 - 14 15 - 19 20 - 24 25 - 29 30 - 34
freq 2 3 6 4 2
Classes f x fx |x - x| f |x - x
10 - 14 2 12 24 10.3 20.6
15 - 19 3 17 51 5.3 15.9
20 - 24 6 22 132 0.3 (16.8
1.8 + 5.8 + 0.2 + 9.2 + 13.2)
25 - 29 4 27 108 4.7 18.8 5
30 - 34 2 32 64 9.7 19.4
9.04
17 379 76.5
Example 1.5.3
Using the frequency table displayed below, calculate the mean deviation

Solu
tion:

YJx
Mean x
Ef
379
_ 17
22.29411765
22.3
Ef|x - x|
Mean deviation
Ef
76.5
4.5
17

1.5.3 Variance and Standard Deviation


Variance is the sum of the squares of the mean deviation divided by the numbers of
observations, and standard deviation is the positive square root of the variance.

33
x (x — x) (x — x)‘
43 -8.66 74.9956
46 -5.66 32.0356
50 -1.66 2.7556
53 1.34 1.7956
57 5.34 28.5156
Fo
61 9.34 87.2356
r
un
E:= 2
gr var I n
ou ian
pe (Xi
ce - x)
d where x is the mean of the given set of numbers x1,x2,... xn
da
[Link] 1.5.4
Find the variance of 43, 46, 50,53,57, 61.
Solution:

227.3336

A 43 + 46 + 50 + 53 + 57 + 61
Mean x = ----------------------------------------
6
= 310
= E”
= 51.66
Therefore variance = 227.3336 = 37.88 9 3 3 33
It therefore follows that the standard deviation is //37.8893333 = 6.1553395

Note 1.5.1

E(Xi - X)2 x 2
x
n - X2
n

which is a simpler formula used to find the variance, using E — x2 we get


n

34
x x2
43 1849
46 2116
50 2500
53 2809
57 3249
61 3721
Classes 20 — 29 30 — 39 40 — 49 50 — 59 60 — 69 70 — 79
f 3 5 8 6 4 2
2 2
Classes f x x fx fx
20 — 29 3 24.5 600.25 73.5 1800.75
30 — 39 5 34.5 1190.25 172.5 5951.25
40 — 49 8 44.5 1980.25 356 15842 16244
50 — 59 6 54.5 2970.25 327 17821.5
60 — 69 4 64.5 4160.25 258 16641
70 — 79 2 74.5 5550.25 149 11100.5
28 1336 69157 16244 /310\2
Va _
6 VJ
ria
nce
=
37.8888
For 89333
Gr as
ou before.Efx2 (f) 2
ped Varianc
dat e Ef
a.
(f) 2
or f

where d = X — A and A is the assumed (working) mean.


Example 1.5.5
For the distribution given below, find the standard deviation.

Solution
:

35
Classes f x d = (x - A) d2 = (x - A)2 fd fd2
20 - 29 3 24.5 -20 400 -60 1200
30 - 39 5 34.5 -10 100 -50 500
40 - 49 8 44.5 0 0 0 0
50 - 59 6 54.5 10 100 60 600
60 - 69 4 64.5 20 400 80 1600
70 - 79 2 74.5 30 900 60 1800
28 90 E x5700 / E/x\
f 2 2
Variance
Ef kEf/

69157 /1336V
_28 EE J

47
193----or 193.2397959
196

Standard y/variance
deviatio
n A/193— orV193.2397959
196
= 13.90107175
13.9

We can still find the standard deviation by using a working mean. Let Assumed/working
mean be A = 44.5

Efd2 / Efd\
Variance
Ef kEf/

5700 / 90V
EE k 28/
193.239759
V193.239759
Standard deviation
13.9010717
13.9

36
Classes f x fx x2 fx2
50 - 54 6 52 312 2704 16224
55 - 59 14 57 798 3249 45486
60 - 64 20 62 1240 3844 76880
65 - 69 30 67 2010 4489 134670
70 - 74 50Example
72 3600 5184 259200
75 - 79 241.5.677 1848 5929 142296
80 - 84 12Use 82
the data
984of example
6724 1.3.4
80688to find the standard deviation.
85 - 89 4 Solution:
87 348 7569 30276
160 11140 785,720
Classes f x d fd d2 fd2
50 - 54 6 52 -15 -90 225 1350
55 - 59 14 57 -10 -140 100 1400
60 - 64 20 62 -5 -100 25 500
65 - 69 30 67 0 0 0 0
70 - 74 50 72 5 250 25 1250
75 - 79 24 77 10 240 100 2400
80 - 84 12 82 15 180 225 2700
85 - 89 4 87 20 80 400 1600
160 420 11200

(f) 2
Efx2
Variance
Ef

785720 /11140 \2
= 160 V 160 J

= 63.109375
.'. S.d = V63.109375
= 7.944149923
7.944.

We get the same answer when we use the method of working mean. For instance let
the working mean be 67.

37
x x2
12 144
15 225
17 289
13 169
20 400
21 441
25 625 2
EM / Efd\
18 324 Varia
196 Ef kEM nce
14
155 2813 11200 / 420V

= 1600 k 1W
63.109375
Standard deviation -\/63.109375
7.944140923
~ 7.944
Variance for a sample
For a sample that has n items, variance is denoted by

S2
/ (Ex2 _( - 21
Example 1.5.7
Find the variance of a sample that has the following data: 12, 15, 17, 13, 20, 21, 25,
18, 14.
Solution:

n_9

2 9(2813 /155\ 21
S
qT _V/

38
x x2
171 29241
180 32400
160 25600
156 24336
158 24964 17
161 25921 17— or 17.94444
18
165 27225
154 23716
Example 1.5.8
174 30276
176 30976
For a sample of heights of students of year I in cm, find the standard deviation
178 31684
171,180,160,156,158,161,165,154,174,176,178.
Solution:
1833 306339

2
2 n [Ex
S n
n—1

11 f 306339 /1833\ 2]
kJ

= 89.4545454545
- 89.5
Standard deviation S = -\/89.454545
= 9.458041319
9.458

Activity G
1.5.4 Percentiles, Deciles and Quartiles
- Percentiles are values which devide the data into 100 equal parts. A value Pi has
one percent of the data falling below it, P 13 has 13% of the data falling below it

39
P25 = 25
120 — 30
100
3 7
D3 — — x 200 D7 — x 200
7
10
— 60 — 140
Example 1.5.9
Note that P25 — Q1 — lower Quartile
P5o — Q2 — If Median the number of observations
(middle quartile)is 120, then
P75 — Q3 — Upper quartile
If the data is arranged on a number line, then
25 c -5
u
c
So 30
observa
tions
are
P
15 — 15
x 120 — 18
below 100
the
So 18of
value observations fall below P15
PIn25 the
and earlier case P25 has a quarter of the observations below it. So P 25 — Q1 —
lower quartile.
- Deciles devide a set of values into ten equal parts. These are values D1,D2, . . .
,D
9.

Example 1.5.10

Let the observations be 200. Find D3 and D7.


Solution:

40
The Interquartile Range

This is at times called quartile range. It is given by Upper quartile - Lower quartile

— Q3 - Q1

Where L3 — Lower class boundary of upper quartile class


N — Total frequency (no. of observation)
Cfb — Cummulative frequency before upper quartile class
fq3 — frequency of the upper quartile class
i — Class interval (width)

Where L1 — Lower class boundary of lower quartile class


N — Total frequency ([Link] observation)
Cfb —Cummulative frequency before lower quartile class
fq1 — frequency of the lower quartile class
i — class interval (width).
The semi-interquartile range — 1 (Q3 — Q1).

Example 1.5.11

The data below is weights of students in lower secondary school at school ABC.

Mass frequency
40 — 8
44 24
45 — 37
49 30
50 — 26
54 18
55 — 10
59 7
60 —
Find the

(i) Median
(ii) Interquartile range

Solution:

41
Class f Cf
40 - 44 8 8
45 - 49 24 32
50 - 54 37 69
55 - 59 30 99
60 - 64 26 125
65 - 69 18 143
70 - 74 10 153
75 - 79 7 160
160

(i)

(N f
Median L2 +
fm

069
54.5 x5
30
11 x 5
54.5 +---------
30
56.33333 - 56.3

Q
3 L3 + f
l3

120 - 99
x45
■+

21
59.5 + — x 5
26

63.53846154 ~ 63.54

Q
1 (N - f,
Li +

(40 - 32)
x5
49.5 + 37

4
49.5 + 37

42
26 — 50 51 — 75 76 — 100 101 — 125 126 — 150 151 — 175 176 — 200
4 18 17 28 22 16 15
f Cf
4 4
18 22
17 39
28 67
22 89
16 105
15 120
50.58108 ~ 50.58.
Interquartile range = Q3 — Qi
= 63.54 — 50.58
= 12.96

Example 1.5.12
For the data given in the table below,

(a) Draw an ogive and use it to estimate


(i) the median
(ii) interquartile range
(iii) 20 - 90 Percentile range
(b) Find by calculation
(i) the median
(ii) interquartile range
(c) Compare (i) and (ii) of (a) and (i) and (ii) of (b) and comment on your results.
Solution:

Class
26 — 50
51 — 75
76 — 100
101 —
125
126 —
150
151 — 120

43
(b)
(i)

Median = 100.5 + ——— x 25


28
= 119.25

(ii)

Qs = 150.5 + (901689) x 25
16
= 152.0625

Qi = 75.5 + (30 ~22) x 25

= 87.26470588 - 87.2647
Interquartile range = Q3 — Q1
= 152.0625 — 87.2647
= 64.7978

(d) The figures are nearly the same. The discrepancy is due to the scale (the decimal
places are not easy to plot if they are very small) and the innacurracy of the hand
drawn ogive.
(e) Aa
Height Frequency
10 - 19 6
- 29 8H
20Activity
- 39 141
30Exercise
40 - 49 20 1. The
50 - 59 221
exerercise table
60 - 69 12 belo
70 - 79 10 w
80-89 8 show
Weight 700s the
850 950 1000 1100 1300
Frequency 3 heigh4 2 9 10 6
15 16 15 ts of
1719 21 25 30
26 28 1822 sticks 23 29 35 37
32 40 45 49 44 to the 55 59 58
49 42 41 44 neare 57 56 62 20
21 24 39 48 st 31 43 5845
centi
meter
2. Draw a cummulative frequency curve and use it to estimate the median
3. Construct a histogram and use it to estimate the median.

4. The table below gives the weights in grams of babies delivered in a hospital on
New years day.

Find the average weight of the babies.


5. The table below shows the marks obtained in a test

6. Form a frequency table with a class interval of 5, the lowest class limit being
15
7. Using a working mean of 32, find the mean.
8. Construct a cummulative frequency curve and use it to estimate the median
(36.17)

45
Class 5 - 9 10 - 14 15 - 19 20 - 24 25 - 29
f 13 15 18 8 6
Item 2007 sh. 2008 sh.
Rent 130, 000 150, 000
Clothing 90, 000 110, 000
Power 60,000
9. Th 68,000
Water 12,000
e 13,000
Food distrib
200,000 230,000 AGE NUMBER
ution
Transport 80,000 90,000 0- < 5 10
Medical table
70,000 100,000 5- < 15 16
below
shows 15- < 30 25
the 30- < 50 29
50- < 70 19
ages
70- < 90 11
of
patien
ts Determine the mean and median age of the patients
admitt
10.
ed atFind
a the variance of the sample data below
clinic(i) 43, 47, 56, 66, 78, 88, 95, 101, 105 and 110
(ii) 21, 30, 38, 45, 50, 56, 71, 82 and 87.
11. Find the standard deviation of the population data below
(i) 60, 63, 69, 71, 78, 80 and 81
(ii) 15, 19, 28, 32, 33 and 35.
12. The table below shows the mistakes per page typed by a learner typist who typed
60 pages.

Calculate the mean, median and mode of the mistakes made.


13. Use the data of question 7 to find the standard deviation using a working mean
of 17.
14. Kambale’s family spent the following money per month on the items shown in the
years 2007 and 2008.

46
Item Price Index Weight
Rent 130 180
Clothing 120 165
Power 160 130
Water 110 190
Food 125 Using 2007 175as the base year, find the simple aggregate experience index for 2008.
Transport 140 200
Medical 15. Find the cost
105 135of living index based on the data below:
22 20 24 22 23 24 23 21 42 43
18 21 27 19 20 21 25 21 35 29
26 23 22 25 21 19 21 23 44 39
20 22 24 26 18 25 19 27 38 44
32 36 31 15 15 39 36 40 17 42
Mass (kg) Frequency
60 - 64 7
65 - 69 16
70 - 74 14
75 - 79 66
80 - 84 35
85 - 89 29
11. The figures below are the yields to the nearest kilogram of cassava obtained from
90 - 94 20
95- 99 13 plots of equal size.

Beginning with the 15 -19 class, construct a frequency table. Using an assumed
mean estimate the mean yield and standard deviation.
12. The following table gives a summary of weights of patients suffering from High
Blood Pressure.

Find the

47
1st quarter 2nd quarter 3rd quarter 4th quarter
2007 110 80 70 100
2008 125 92 78 105
2009 130 98 82 120
Raw material A B C D E F
2008 40000 30000
(i) median 10000 20000 50000 12000
2009 90000 50000 15000 35000 80000 32000
(ii) interquartile range
(iii) mean
(iv) standard deviation
13. The table below gives the quarterly electricity costs for my family during three
successive years. Plot these results on a graph. Calculate the four quarterly
moving averages and plot them on the same graph. Draw straight lines to fit
these averages as closely as possible and use the graph to estimate the rate at
which the costs increasing over the three years.

14. The table


below
of last year
shows the
number of
JanatFeb
births a Mar Apr May Jun Jul Aug Sept. Oct Nov. Dec
64
clinic 61 77 83 79 74 71 70 71 73 71
across all 69
the 12
Find
months the five-monthly moving averages. Plot both the original figures. Estimate
the number of births in the month of January of the following year.
15. A factory uses six raw materials A,B,C,D,E,F to manufacture a toy in the ratios
[Link] respectively. The prices of the materials in shs per tonne
in the years 2008 and 2009 are given as

Taking 2008 as the base year, calculate an index number for the total cost of the
raw materials used in the manufacture of the toy in 2009.

16. The table below gives quarterly sales in millions of shillings at a whole sale store
for the period 2008 to 2010.

48
2008 2009 2010
1st Quarter 170 174 182
2nd Quarter 184 191 194
3rd Quarter 191 196 202
4th Quarter 212 216 222

calculate the 4-point moving averages. Plot on one graph both the original figures
and the moving average values. Estimate the sales in the first quarter of 2011.

49
Chapter 2

PROBABILITY

2.1 Introduction

Probability theory is the foundation of inferential statistics. It originated in games


of chance. In real life we can never be sure of certain events hence the need for the
utilisation of the theory of probability. We are sure of events like, the sun setting
tomorrow, dying at an age less than 150 years, being hungry if one does not eat within
12 hours, e.t.c. On the other hand, we are not sure if it will rain tomorrow, if it rains,
we are not sure that there will not be lightning and thunder, we are not sure if the
pregnant woman will give birth to a baby boy, and many other similar illustrations. An
experiment has a definite number of possible outcomes which comprise the outcome set
S. The set S is the possibility space or sample space.

2.2 Theoretical Probability

It is not possible to derive all values from an experiment. For instance, when a card is
picked from a well shuffled pack of cards, the probability that it is a hearts is

number of ways getting a heart


total number of possible outcomes

13 1
52 4

This does not mean that for every four cards we pick, there is one heart, but if we pick
a card many times with replacement, the chance that it is a hearts is 1.
An event E of an experiment is a subset of the outcome set S. Let E be the event that
“John was born on Monday. There are seven days in a week and Monday is only one

50
of those days.

Therefore P (E) = 7

The outcome set is generated using a table of outcomes, tree diagram or permutations
and combinations.
Example 2.2.1
Give the probabilities of
(i) getting a tail when a fair coin is tossed
(ii) picking a diamond from a pack of 52 cards
(iii) picking a black card from a pack of 52 cards
(iv) tossing an even number with a die
(v) being born in the month of March
Solution:
(i) There are only two possibilities i.e a head and a tail. Picking a tail is one of the
two probabilities. Therefore P(T) = 1
(ii) There are 13 diamonds in a pack of cards

13 = 1
52 = 4

(iii) There are 26 black cards in a pack

26 1
P(Black card) = — = -
52 2

(iv) The sample space is S = {1, 2, 3, 4, 5, 6} There are three even numbers

3 1
P(Even number) = 6 2

(v) There are twelve months in a year. Therefore

1
P(born in march)
12

51
1 2 3 4 5 6
1 2 3 4 5 6 7
2 3 4 5 6 7^AP
3 4 5 6 7/
4 5 6 7> "IWw 10
5 6 7x ^9 10 n
6 7 A) 10 li 12
E
x
aWhat is the probability of throwing a total score of 8 with two dice
mSolution:
pWe find the points of the sample space using a table.
l
e

2
.
2
.
2

All the points in the sample space have equal probability

P(total score 8) = —
J
36

Example 2.2.3

What is the probability of getting two tails and one head when a coin is tossed
three times?
Solution:
We draw a tree diagram as follows.

52
P (E) n(E)
n(S)

Always 0 < P(E) < 1


P (E) = 1 for a sure event
P(Eequally
The eight i or E2) likely
= P(Ei)outcomes
+ P(E2)are— P(Ei and E2)
S = {TTT,TTH,THT,THH,HTT,HTH,HHT,HHH}
S = { outcomes of throwing a coin three times}
n(S) = 8
Let E = {two tails and one head}

n(E) = 3

n(E) 3
P (E) n(S) 8

Note 2.2.1

If an experiment has n(S) equally likely outcomes where n(E) of them are the
event E, then theoretically, the probability of event E occuring is

P(E) = 0 for an impossible event.

2.3 Addition Rule

Let Ei and E2 be two events from the same experiment. Then, the probability of E i or
E2 or both occuring is given by

P(Ei U E2) — P(Ei) + P(E2) — P(Ei D E2)

53
If the events Ei and E2 are mutually exclusive, (have nothing in common) then
P(Ei n E2) = 0
So that

Example 2.3.1

What is the probability of drawing a diamond or a six from a pack of cards?


Solution:

S = { pack of cards}, n(S) = 52


Ei = { diamonds,}
n(Ei) = 13,

P (Ei) = 13
= 52

E
2 = { sixes} ,

n(E2) 4 4,P(E2)
= =52
Ei and E2 = {diamonds and sixes}
= {six of diamonds}
n(Ei and E2) = 1,
=1
P(Ei n E2) = 52

P(Ei orE2) = P(Ei) + P(E2) - P(Ei and E2)


= 13 4 1
= 52 + 52 - 52

54
2 34 5 6 7
3 4 5 6 7 8
4 5 6 7 8 9
5 6 78 9 10
6 7 8 9 1011
7 8 9 10 11 12 16
52
4
= 13

Example 2.3.2
Two dice are tossed. What is the probability of scoring either a double or a sum less
than four.
Solution: We use a table of outcomes to generate the sample space.

First die
" 1,1 1,2 1,3 1,4 1,5 1,6
2.1 2,2 2,3 2,4 2,5 2,6
seconddie
3.1 3,2 3,3 3,4 3,5 3,6
4,1 4,2 4,3 4,4 4,5 4,6
5.1 5,2 5,3 5,4 5,5 5,6
6.1 6,2 6,3 6,4 6,5 ,6,6

T
a
b
le
o
f
S
u
m
s
Let Ei represent a double and E2 a sum less than four.
Ei = {(1,1), (2, 2), (3, 3), (4,4), (5, 5), (6,6)}
E2 = {(1,1),(2,1),(1,2)}
n(Ei) = 6, n(E2) = 3
and n(E1 A E2) = 1
From P(E1 U E2) = P(E1) + P(E2) — P(E1 A E2)

631
P(E1 U E2) = — +----------------
' 36 36 36
=8
= 36

55
2
9

2
P(Double or sum less than four) 9

Example 2.3.3
If three coins are tossed once, what is the probability of obtaining three heads or one
head?
Solution:
Tossing three coins at once is equivalent to tossing one coin three times. From our
earlier example
S = {TTT,TTH,THT,THH,HTT,HTH,HHT,HHH}
n(S) = 8

Let Ei = {three heads are obtained}


E2 = {one head is obtained}
E1 and E2 are exclusive events so that

P(Ei n E2) = 0
P(Ei n E2) = P(Ei) + P(E2)

1 3
But P(Ei) = - and P(E2) = -
88
1 3
P(E n E )
i 2 = 8+8
4
=8
=1
=2

For n mutually exclusive events

P(Ei n E2 U En) = P(Ei) + P(E2) + ... + P(En)

This is the addition law for mutually exclusive events.

Example 2.3.4
If P(A) = 0.5,P(B) = 0.4 and P(A n B) = 0.2, find
(i) P(A U B)

56
n diagram to have a visual impression of the situation, though it
ry thing to do in this case.

ion law

P(A U B) = P(A) + P(B) - P(A n B)


= 0.5+ 0.4 - 0.2
= 0.7

P[(A U B)'] = 1 - P(A U B)


= 1 - 0.7
= 0.3

P(A U B') = P(A) + P(B') - P(A n B')


= 0.5+ 0.6 - 0.3
= 0.8

am P(A' n B) = 0.2

57
n(S)

n(A) + n(B)

n(S)
If A, B and C are events with respective probabilities P(A),P(B) and P(C), the
n(A) + n(B)
respective probabilities of their not occuring is P(A'),P(B') and P(C'). And also
P (A) + P (A') = 1,
P (B) + P (B') = 1
and P(C) + P(C') = 1.

2.4 M
utually
Exclusive
Two or more events of the same experiment are mutually exclusive if they cannot
Events
occur simultaneously.
For instance if a coin is tosses three times, Let A = { Outcomes with three tails }
and B = { Outcomes with one tail }. The events A and B are mutually exclusive.
Both cannot occur at the same time.

Example
2.4.1
If a coin is tossed three times, find the probability of obtaining three tails or one
tail.
Solution:
The sample space is
S = {TTT, TTH, HTH, HTT, THT, THH, HHT, HHH}
Let A = { outcomes with three tails}
B = {outcomes with one tail}

n{A U B}
P(three
tails or one
tail)

n(S) n(S)

= P (A) + P (B)

13
8+8

4
8
1

2
58
Generally P(A U B)= P(A) + P(B) - P(A n B)

3
This confirms
- P(A n B
= 15+1
10
that for
mutually P(A U B) = P(A) + P(B)
1 1 3
P(A exclusive
n B) -
events= 102.4.2
Example + 5(no 10
intersection)
1+2-3
Events A and B are such that P(A) = 10 and P(B) = 1 and P(A U B) = 1..
= 10
Find out whether A and B are mutually exclusive events.
=0
Solution:

Since P(A n B) = 0, A and B are mutually exclusive events.

Note 2.4.1

Two or more events are exhaustive if atleast one of them must happen. If these
events are A,B,C,... K, then P(A n B n C n ... n K) = 1

Example 2.4.3

Ei and E2 are two events such that P(E0) = 0.4,P(E2) = 0.8 and
P(Ei n E2) = 0.2.
Show that E1 and E2 are exhaustive events.
Solution:

P(A U B) = P(A) + P(B) - P(A n B)


So P(Ei U E2) = P(Ei) + P(E2) - P(Ei n E2)
= 0.4+ 0.8 - 0.2
=1

Since P(E0 n E2) = 1, the events E0 and E2 are exhaustive.

Example 2.4.4

59
A and B are two events such that P(A) = 0.7,P(B) = 0.4 and P(A U B) = 0.9. Find
(i) P(A n B)
(ii) P(A' n B)
(iii) P(A or B but not both occur)
(iv) P(A' n B').
Solution:

(i)
P(A U B) = P(A) + P(B) - P(A n B)
0.9 = 0.7+ 0.4 - P(A n B)
P(A n B) = 0.2

(ii) P(A' n B) = P(B) - P(A n B)


= 0.4 - 0.2
= 0.2

(iii)

From the diagram


P(A or B but not both) = 0.5+ 0.2
= 0.7

(iv)
P(A' n B') = 1 - P(A U B)
= 1 - 0.9
= 0.1

60
Activity A1
2.5 Conditional Probability

Activity A3

If A and B are two events (they dont have to be from the same experiment), then the

P(Aand B)
P (A/B)
P (B)

n(A n B)
n(B)

Example 2.5.1
If A and B are two events such that P(A) = 4, P(B) = 1 and P(A/B) = |, find
(i) P(A n B) (ii) P(A U B) (iii) P(B/A')
Solution:
(i)

P(A n B)
P (A/B)
P (B)

2 P (A n B)
5 1
|
P(A n B) 1
5

(ii)

P(A U B) = P(A) + P(B) - P(A n B)

= 111
= 4 + 2-5
= 11
= 20

(iii)

61
P(A' n B)
P (B/A')
P (A')
P(B) - P(A n B)
P(A)
1/2 - 1/5
3/4
2
P (B/A') 5

Example 2.5.2

A and B are events such that P(B) = |, P(A and B) = 1 and P(B/A) = 1. Find
(i) P(A) (ii) P(A/B) (iii) P(B/A') (iv) P(A/B')
Solution:
(i)

1= 1/4
3 = P (A)

P A
( )=3-

62
P(B n A')
P (B/A') =
P (A')
(ii)
P(B) - P(A n B)
P (A') P (A n B)
P (A/B) P (B)
2/5 - 1/4
1/4 1/4
2/5
3
P (B/A') = 5 ’ 5
P (A/B) 8
(iv)
(iii)
P(A n B')
P(A/B') = P (B')
P(A) - P(A n B)
P (B')

3/4 - 1/4
3/5

5
P(A/B') = 6

Example 2.5.3

63
Two cards are dealt from a well shuffled pack of 52 cards without replacement. If the
first card is a heart, what is the probability that the second card is also a heart?
Solution:
Let Ai = {first card drawn is a heart}
A2 = {second card drawn is a heart}

P (Ai) = H 1 P (A2/A i) = 12 4
4 17

Example 2.5.4
A bag contains six white and 14 black beads. What is the probability that if three
beads are chosen randomly, they are all black.
Solution:
Let An be the event “the nth ball drawn is black
We require A1 n A2 n A3.
P(Ai n A2 n A3) = P(Ai) • P(A2/A1) • P(A3/A1 n A2)
14 13 12
= —x—x—
20 19 18
= 91
= 285

Example 2.5.5
Two cards are drawn from a well shuffled pack of 52 cards without replacement. What
is the probability that
(i) they are both Qs
(ii) neither is a Q
(iii) atleast one is a Q,
(iv) either one but not both is a Q.
Solution:
1. (i) Let Ai = { first card is a Q}, A2 = { second card is a Q }

43
P(
AI) = 52 and P(A2/Ai) = 51

P(Ai n A2)
P(A2/Ai)
P (Ai)

64
P(Al) • P(A2/A1) = P(Al n A2)
4 3
52 X 51 p(Al n A2)

4 3
P(Ai n A2) X
52 51
1
221

(ii)

P(Al n A2) = P(Al) • P(A2/A1)


48 47
=52 X 51
188
221

(iii) P(atleast one is a Q) 1 — P(neither is a Q)

1 188

= 221
=33
= 221

(iv)

A2 can occur with or without Al occuring.

P (A2) = P (Al)P (A2) + P (Al)P (A2)

65
4 3 48 4
52 ’ 51 + 52 ’ 51
17
221
17 1
P(A-2 A Al) -
24 221
16
221
16 16
Therefore P(A- orA2but not both) 221 + 221
32
221

Example 2.5.6
A disease affects 2% of the population. A trainee laboratory technician can detect
the disease if it is present in the person with a probability of -9 and if the person
does not suffer from the disease there is a probability of 2-0 that he will still say
the person has the disease. Find the probability that
(i) a person has the disease and the technician correctly detects it.
(ii) the test indicates the person has the disease
(iii) the person has the disease given that the test indicates so.
Solution:
Let A = { a person has the disease } B = { a person tests positive }

66
9
500
67
1000
9/500
(i) We need 67/1000

18 P(A n B) = P(A) x P(B/A)

2 9
x
= 100 10

= _9_
= 500

(ii) Either a person has the disease or he does not have it. A and B are mutually
exclusive events. We need to find P(B).

P(B) = P(A n B) + P(A' n B)


= P(A) • P(B/A) + P(A') • P(B/A')

=2 9 98 1
= 100 10 + 100 X 20
X

= 18+98
= 1000 + 2000
= 67
= 1000

(iii)

P (A/B) = ■
P(A n B)
P (B)
Utilising (i) and (ii),

P(A n B) =

and P(B) =

P(A/B) =

67

67
3
P(one head) = 8
3
P(an even number) =
6
The probability that a person has no disease when the technician says he has it
is i _ is = 49 i
° ± gy 67’
2 on. He needs a lot more training in laboratory
The trainees findings cant be relied
work. 3i
P(one head and an even number) = - x -
82
Activity A32
3
16
2.6 Independent Events
Activity A2

Events are independent if the occurence of one event does not influence or affect the
occurance of another. If the events are A and B

P(A) = P(A/B) and


P(B) = P(B/A).

In that case P(A n B) = P(A) • P(B).

Example 2.6.1
A coin is tossed three times and a die is tossed once. What is probability of obtaining

Example 2.6.2
Alfred, Bright and Charles are each given one shot. Their probabilities of hitting the
target are |, 5 and 4 respectively. Find the probability that if they all fire at the target,
only one shot will hit the target.
Solution:
Let A = {Alfred hits the target}
B = { Bright hits the target}

68
Then P(A) = 2 3
and P(A') = -
’5 5
4 and P(B') = 1
P (B) = 5
’5
1 3
C = {Charles
P (C) ’4 hits P(C')
and the target}
=4
2 1 3 D =3 {only
4 one3 shot
3 hits1 the 1target
- X —x - + - X — x -+ - x — x -
5 5 4 5 5 4 5 5 4
6 36 3
666
— x—x—
15 15 15
216
3375
444
— x—x—
15 15 They
15 hit or miss the target independent of each other.
64 If only one is to hit the target, we need P(D)
3375 P(D) = P(A n B' n C') + P(A' n B n C') + P(A' n B' n C)
555
— x—x—

6 36 3
100 + 100 + 100

45 = 9
P (D) 100 = 20

Example 2.6.3
A box contains 6 red, 4 white and 5 black balls. Three balls have to be removed
randomly, with replacement. What is the probability that they have the same colour?
Solution:
There are three possible joint events

P(all red)

P(all white)

P(all black)
15 15 15
69
125
3375

216 + 64 + 125
P(all are the same colour) 3375 + 3375 + 3375
3
25
0.12

Example 2.6.4
Alfred has a probability of 1 of solving a mathematics problem while Ben has a proba-
bility of 3 to do so.
Find the probability that the problem will be solved if both Alfred and Ben solve it
independently.
Solution:
Let A = {Alfred solves the problem}
B = {Ben solves the problem }
and P(A) = 2, P(B) = 1
We require P(A U B).

P(A U B) = P(A) + P(B) - P(A n B)

But for independent events

P(A n B) = P(A) • P(B).


P(A U B) = P(A) + P(B) - P(A) • P(B)

= 1111
=2+3-23
=5 1
=6-6
=2
=3

Example 2.6.5
If A and B are independent, show that A and B' are also independent.
Solution:
For independent events

P(A n B) = P(A) • P(B)


But P(A) = P(A n B) + P(A n B')

70
So that P(A n B') = P(A) - P(A n B)
P(A n B) = P(A) - P(A) • P(B)
= P(A)[1 - P(B)]
= P(A)P(BZ)
Hence P(A n B') = P(A)P(B'). A and B' are also independent events.
Example 2.6.6
Events A, B and C are such that P(A) = 1, P(B) = 3 and P(C) = | and P(BnC) = |.
If A and B are independent, A and C are mutually exclusive find
(i) P(A U B)
(ii) P(C/B)
(iii) P(B/A U C)
(iv) P(B/C).
Solution:

(i)

P(A U B) = P(A) + P(B) - P(A n B)

= 1111

= 2 + 3- 2 3
(P(A n B) = P(A) • P(B) for independence)

=5 1
=6-6
=2
=3

71
P (B n (A U C))
P(B/A U C) =
- P(A U C)

P{(B n A) U (B n C)}

P (C/B) = PJ^

1/5
1/3
3
5

(iii)

P (A) + P (C)

Since A and C are mutually exclusive.

1
but P(B n A)
6
1
and P(B n C)
5
P (B n A) + P (B n C)
P(B/A U C)
P (A) + P (C)

1/6 + 1/5
1/2 + 2/5

11/30
9/10

P(B/A U C) 17

(iv)

P (B n C)
P (B/C)
P (C)

72
P (A nB)
P (A / B ) =
P(B)

P(A) • P(B/A)
= 1/5 P (Bk )P (A/Bk)
H=1 P(Bn)P(A/Bn) 2/5

1
=2

2.7 Baye's Theorem

This theorem is a result of the extension of the theory of conditional probability. If an


outcome set S is composed of subsets Bn and A is also a subset of S with
intersections with any of BI,B2, - ,Bn. Then

P (B)

The probability of event A is given by

P (A) = P (BI n A) + P
(B2 n A) +... + P (Bn n
A) P(Bk n A)
So that P(Bk/A)
P (A)

____________P (Bk )P (A/Bk)_____________


P(BI n A) + P(B2 n A) +... + P(B„ n A)

P (Bk/A) for k = 1, 2, ...n

Activity A4
Example 2.7.1
73
A machine operator buys a particular size of ball bearing from three manufactures A, B
and C. He buys 25% of the ball bearings from A, 40% from B and 35% from C. Earlier
on he had found that 1% of As ball bearings are faulty whereas 2% of Bs and 3% of Cs
are. If he chooses a bearing and finds it faulty, what is the probability that it was one
of Cs ball bearings?
Solution:
From the informatioon P(A) = 0.25,P(B) = 0.4 and P(C) = 0.35. The probability
will be greater than P(C) = 0.35 since C produces a greater proportion of faulty ball
bearings than A and B. Let F be the event that the ball bearing is faulty. We require
P(C/F).
We also have P(F/A) = 0.01,P(F/B) = 0.02 and P(F/C) = 0.03
Drawing a probability tree diagram

P(F n C) = P(F/C)P(C) = P(C/F) • P(F)

Rearranging, the probability we require is

( , ) = P (F/C) •P (C)
P C F
P(C/F)
= P(F)

But P(F) = P(F n A) + P(F n B) + P(F n C)


= P(F/A) • P(A) + P(F/B) • P(B) + P(F/C) • P(C)
= 0.01 x 0.25 + 0.02 x 0.4 + 0.03 x 0.35

74
= 0.0025 + 0.008 + 0.0105
= 0.021
0.03 x 0.35
P (C/F) = “ 0.021
= 0.5
P(F/A) • P(A)
= P(F/A) • P(A) + P(F/B) • P(B) + P(F/C) • P(C)

0.01 x 0.25
= 0.01 x 0.25 + 0.02 x 0.4 + 0.03 x 0.35
The probability that a faulty ball bearing was produced by C is 0.5.
0.0025
Using a similar argument,
= 0.0025 + 0.008 the probability that a faulty ball bearing was supplied by A
+ 0.0105
is given by
= 0.119047619
~ 0.119.
P (A/F)P(F/A) • P(A)
P(F/A) • P(A) + P(F/B) • P(B) + P(F/C) • P(C)
0.5 x 0.45
0.5 x 0.45 + 0.3 x 0.25 + 0.2 x 0.3
0.225
0.36

Example 2.7.2
Three Cooks Annet, Brenda and Cathy sort rice for cooking. Annet sorts 45% of,
Brenda sorts 25% and Cathy sorts 30%. The probability that what Annet sorted
contains stones is 0.5 and the respective probabilities for Brenda and Cathy are 0.3
and 0.2. What is the probability that a rice container with stones found by a quality
assurance person was sorted by Annet?
Solution:
Let P(A), P(B) and P(C) denote the probabilities of quantities sorted by Annet, Brenda
and Cathy respectively. Then P(A) = 0.45,P(B) = 0.25 and P(C) = 0.3
If F is the event “a container of rice has stones
Then P(F/A) = 0.5, P(F/B) = 0.3, P(F/C) = 0.2
We require P(A/F).

Now P(A/F)

75
n! = n(n — 1)(n — 2)... 3 x 2 x 1
6! = 6 x 5 x 4 x 3 x 2 x 1
1! =1
0! =1
and nCr x r! = nPr0.625
= n(n — 1)(n — 2)... (n — r + 1)
2.8 Permutations and
n(n — 1)(n — 2) ...(n — r + 1)
Combinations
Therefore nCr
Assume that we have boys A,B,C,D and E, how many r! groups of two can we have?
These are AB, AC, AD, AE, BC, BD, BE, CD, CE, DE. There are ten possible groups.
n!
If we are concerned with the arrangements of the five boys taken two at a time, this
and nCr
r!(n
can be done in twenty different — r)!
ways i.e
AB, AC, AD, AE, BC, BD, BE, CD, CE, DE
BA, CA, DA, EA, CB, DB, EB, DC, EC, ED
Each selection is a combination and each arrangement is a permutation. The number
of permutations which can be made from n unlike objects taken r at a time is given by

nPr = n(n — 1)(n — 2)... (n — r + 1)

In our illustration of 5 objects taken 2 at time nPr = 5P2 = 5(4) = 20


Similarly, the number of combinations which can be made from n unlike objects taken
r at a time is nCr.
Conventionally it is taken that

This also implies that nCr = nCn-r


Example 2.8.1
How many numbers can be formed by using three out of the seven digits 1, 2, 3,4,5, 6, 7?
Solution:
We need the number of permutations of seven things taken three at a time
7Ps = 7 x 6 x 5 = 210
Example 2.8.2

76
26C7 657800
52C7 = 133784560

= 0.004916860361
0.004917
In how many ways can a committee of five people be selected from 10 people?
Example 2.8.5
Solution:
In how many ways can a netball team of seven girls be picked from 18 possible players?
We need 10C5
Solution:
We need
= 20.
18! = 5!5!
7!11!
= 252
31824
Example 2.8.3
How many different arrangments of letters can be made by using all the letters of the
word “appropriate?
Solution:
We have eleven letters including three P’s, two a‘s and two r‘s. The required number
of arrangements is

11! 11 x 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1
3!2!2! = 3x2x1x2x1x2x1
= 1663200.
Example 2.8.4
Find the probability that a hand of 7 cards dealt from a pack of playing cards contains
only black cards.
Solution:
The total number of possible hands is 52C7 and the total number of black cards in a
hand is 26C7 because the selections of the seven black cards have to be made from 26
black cards.
The required probability is

18C7

77
8C3 56 28
1363 = 286 =143
8C3 =
P(all three are men) 13C3 ’ 0.195804195
Example 2.8.6
0.1958
From a group of 8 men and 5 women, a committee of three is selected at random.
(a) What is the probability that all the committeee members are men?
(b) What is the probability that there is one woman on the committe.
Solution:

(a) The total number of people is 13.A committee of three people can be selected in
136*3 ways.
If the three committee members are all men, then the three men are chosen from
among the men in 8C3 ways

(b) If there is one woman on the committee, then there are two men on the committe.
These are respectively selected in 5C*1 and 8C2 ways. The probability of a woman
on the committee is

5Ci x 8C2 = 5 x 28 = 140 = 70


13C3 286 = 286 = 143
0.489510489
- 0.4895

Example 2.8.7

A box contains 10 red, 6 blue and 4 green balls.


If 5 balls are picked at random, determine the probability that
(i) all balls are red
(ii) exactly three are blue
(iii) atleast one red ball
(iv) no green ball
Solution:

78
IOC5 x 6C0 x 4Co
2OC5
21
1292
6C3 x 14C2 (i)
20C5
455 P(all balls are red)
3876

(ii) If three are blue, then two are not blue

P(three blue balls)

(iii)
P(atleast one red ball) 1 — P(no red ball)

1 10C0 x 10C5
20C5
1 252

15504

1271
1292

(iv)

4C0 x 16C5
P(no green ball)
20C5
4368
15504
91
323

Example 2.8.8
A box contains 3 white, 7 red and 5 blue balls. If three balls are selected at random,
find the probabililty that they are

79
(i) all blue
(ii) of different colours
(iii) of one colour
Solution:
(i)

5C3
P(all blue)
15Cs
10 _ 2
455 = 91

(ii)

P(different colours)

3x7x5 105
455 = 455

13

(iii)

3C3 + 7C3 + 5C3


P(all balls are one colour)
15C3
1 + 35 + 10
455
46
455

n!
Note that nCr = r!(n-
r)!

80
Example 2.8.9

A committe of 4 people is to be chosen from a group of 18 men and 12 women. What


is the probability that
(i) all 4 are men
(ii) there are 2 men and 2 women.
Solution:

(i)

P(all men)

68
609

(ii)

P(2 men and 2 women)

374
1015

Exercise 2

1. Given that A and B are independent events such that P(A) = | and P(A U B) =
15, find
(i) P(B) (ii) P(A' U B')
(ii)In Kampala, the probability that a person owns an autombile is A. Given that
the probability that a person who owns an automobile is Hiv positive is 4, find
the probability that a person selected at random owns an automobile and is HIV
positive.

(iii) If a die is tossed once, what is the probability of a number less or equal to two
showing up?

81
2. Given that A and B are two events such that P(A) = -6,P(B) = -0 and
P(A U B) = 4, find
(i) P(A n B) (ii) P(A n B')
3. A and B are mutually exclusive events such that P(A) = | and P(A U B) = -7.
Find
(i) P(A' U B) (ii) P(A' n B')
4. Two dice are thrown together. Find the probability of scoring a double or a sum
greater than 6.
5. Four balls are drawn at random one after the other without replacement from
a bag containing 15 white, 10 blue, 8 green and 7 yellow balls. Determine the
probability that
(i) the first is white, the second is blue, the third is green and the fourth is
yellow
(ii) there are two white balls
(iii) there is one ball of each colour
(iv) all balls are of one colour.
6. Three men A,B and C have probabilities |, - and -0 of hitting a target. If each
of them is allowed one shot at the target, find the probability that
(i) one and only one shot will be on target
(ii) the target will be hit
(iii) all will miss target.
7. A and B are events such that P(A) = |, P(A n B) = - and P(A/B) = -. Find
(i) P(B) (ii) P(B/A) (iii) P(A/B')
8. Show that P(C/A) + P(C'/A) = 1.
9. A box contains 6 white marbles and five green marbles. Two marbles are drawn
at random one at a time without replacement. Find the probability that
(i) all are white
(ii) the second marble is white
(iii) the first marble is white given that the second is white
(iv) none of the marbles are white.

82
duction

sity function (pdf), P(X = x) is discrete if its domain is countable. If


! of an experiment is devided into n mutually exclusive and exhaustive
, En, then a variable, X which can take (assume) exactly n numerical
ich corresponds to only one of events is called a random variable.
rete random variable X is a function which allocates probabilities to
s that X can take. If P(X = x) is the pdf for a random variable X
screte values of X, ilien V p(X = x) = 1.

) blue and 6 red marbles. Three marbles are drawn at random without
d the probability distribution for the number of red marbles drawn.

triable X be “the number of red marbles drawn”

= 0) (no red marbles) = P(B1 • B2 • B3)


= 0) P(Bi) x P(B2/Bi)P(B3/B2 and Bi)

10 9 8
x 15 X 14
16
3
14

= 1) P (Ri • B2 • B3or Bi • R2 • B3 or Bi • B2 • R3)


6 10 9 10 6 9 10 9 6
— x X
10 15 14 + +
16 15 14 16 15 14
P (X = 2) = = (Ri •R2 •B3 or Ri • B2 • R3 or Bi • R2 • R3)
6 5 10 6 10 5 10 6 5
= — x — x-----1----x — x------1----x — x —
16 15 14 16 15 14 16 15 14
9 9 9
5 5 5 56 + 56 + 56
’ 56 + 56 + 56
27
15
56
’ 56
= P(Ri • R2 • R3)
P (X = 3) =
654
= — x — x —
16 15 14
1

x 0 1 2 3
P(X = x) 3 27 15 1
14
(a) (i) none 56 56 28
(ii)one
(iii)two
(iv)three are defective

28

hence the
probability
distribution
of X is

Note that the sum of the probabilities is 1.

Example 3.1.2
In a packet of eight bulbs, three are known to be defective. If three bulbs are chosen
at random find the probabilities that

(b) Hence give the probability distribution for defective bulbs drawn.
Solution:

84
x 0 1 2 3
P (X = x) 10 30 15 i
56 56 56

(a) (i)

10
P(none defective)
56
=

(ii)

30
P(One defective)
= 56

(iii)

15
P(two defective)
= 56

(iv)

1
P(three defective)
56
=

(b)

NB: The “number of defective bulbs” is variable because it can take different
numerical values between zero and three inclusive; it is random because it it
not easy to predict the outcome of counting the number of defective bulbs in a
particular packet and it is discrete since it can take only certain specific values in
a given range rather than all the values in that range.

3.2 Mean

Mean is also called expection. For a discrete random variable X with pdf
P(X = x), the mean of x is E(X) = xP(X = x).
E(x) is the mean value of x. E(x) has the following properties

85
x 0 1 2 3
P (X = x) 10 30 15 1
E(x2) = £x56
2 56= x)
P (X 56

2 10 2 30 2 15 2 1
= 02 x — + 12— + 22 x — + 32 x —
56 56 56 56
(i) E(a) = a a constant
n 30 E(ax)
60 = aE(x)
9
— 0 +(ii)
—+—+—
56 E[G(x)]
(iii) 56 56 = £ G(x)P(X = x)
= 143 (iv) If F(x) and G(x) are any two functions of X,
E [F (x) + G(x)] = E [F (x)] + E [G(x)].

Example 3.2.1

Use the probability distribution found in the example 3.1.2 to find (i) E(x) (ii)
E (x2).
Solution:

(i)

E (x) =
xP (x)
10 30 15 1
0 x-------+1 x------+2 x------+3 x —
56 56 56 56
30 30 3
0 •-------1-----1---
56 56 56
1
1-
8
(ii)

56

86
x 0 1 2 3
P(X = x) 1 3 3 1
8 8 8

Activity B1

Example 3.2.2

A fair coin is tossed three times. Let x represent the number of heads which show up.
Find the probability distribution of x and hence E(x) and E(x2).
Solution:
O G) X I)
n=3

(i)(2t'(2) ■ 1
P (X = 0) 8

<n«) ■( t2
3
P (X = 1)
8

d)(2) 2( a1 3
P (X = 2)
8

P (X = 3) (3) (2) '(2) 0 1


8

The probability
distribution of X is

E (x) J^rP (X = x)

1331
0 x- + 1x - + 2 x —+3 x —
8888

E(x2) = x2P (x = x)

= 02x G + 12x 3 + 22 x 3 + 32 x 1
888
8
=3

87
x 0 1 2 3 4
P(X = x) 0.1 0.2 0.4 0.1 0.2

Example 3.2.3
A random variable x has a probability density function shown below:

Calculate
(i) P(0 < x < 2)
(ii) P(X < 2)
(iii) E(x)
(iv) E(x2)
Solution:
(i)
P(0 < x < 2) = P(X = 1) (this is discrete)
= 0.2

(ii)
P(X > 2) = P(X = 3) + P(X = 4)
= 0.1+ 0.2
= 0.3

(iii)

E (x) = xP (X = x)
= 0 x 0.1 + 1 x 0.2 + 2 x 0.4 + 3 x 0.1 + 4 x 0.2
= 0.2+ 0.8+ 0.3+ 0.8
= 2.1

(iv)

E (x2) = x2P (X = x)

= 02 x 0.1 + 12 x 0.2 + 22 x 0.4 + 32 x 0.1 + 42 x 0.2


= 0 + 0.2+ 1.6+ 0.9+ 3.2
= 5.9.

88
x 0 1 2 3 4
P(X = x) 1 3 3 i 3
8 8 16 8 1i

3.3 Variance

The variance of a probability distribution associated with a random variable X is


V(X) = E[(X - p)2] where p = E(x).
V(X) = E[(X - p)2]
= E [X2 — 2px + p2]
= E (X2) — 2pE (x) + p2
but E (X) = p
V(X) = E(x2) — 2p2 + p2
= E(X2) — p2 or
E (X2) — [E (X )]2
Example 3.3.1
The discrete random variable X has the following probability distribution.

Find the mean and variance of X.


Solution:

E (x) = xP (X = x)

13 3 13
= 0 x- + 1 x- + 2 x--------------+3 x- + 4 x —
8 8 16 8 16
3 6 3 12
0
+8+ 16 + 8+ 16 16

= 15
= "8"
V (x) = E (x2) — [E (x)]2

E—
(p

{02 x 1 + 12 x 3 + 2’ x - + 32 x 1 + 42 x -}— ( -V
’ 8 8 16 8 16J V 8 J

—(p

89
x x2 P (X = x) xP (X = x) x2P (X = x)
1 1 k k k
2 4 2k 4k 8k
3 9 3k 9k 27k
4 16 4k 16k 64k21- 225
= T ~64
5 25 3k 15k 75k
6 36 2k 12k 72k336 - 225
7 49 k 7k 49k 64
16k 64k 296k
111
£P (X = x) = 1 _ ~64
16k _ 1 1.734375.
1 Activity B2
k_
" 16
Example 3.3.2
A random variable X has pdf given by P(X x) kx, x 1, 2, 3, 4 and
P(X = x) = k(8 — x), for x = 5, 6, 7. Determine
(i) the constant k
(ii) Expectation of X
(iii) Variance of X.
Solution:

(i)

90
E (x) = = J^xP (X = x) = 64k

= 64 x —
16
(ii)
4

(iii)
V(x) = E(x2) - (E(x))2

= x2P(X = x) - [E(x)]2

= 296k- 42
296
16
= 2.5

Note that if a and b are constants


(i) Var(a) = 0
(ii) Var(ax) = a2V(X)
(iii) V(ax + b) = Var(ax) + V(b) = a2V(x) + 0 = a2V(x)
(iv) V(ax + by) = V(ax) + V(by) = a2V(x) + b2V(Y)
(v) V (X + Y) = V (X - Y) = V (X) + V (Y)

Example 3.3.3

If X and Y are two independent random variable with E(X) = 0.8, E(Y) = 0.9,
V(X) = 0.4 and V(Y) = 0.5 find
(i) E[2X + 3Y]
(ii) V(X + Y)
Solution:

91
x 0 1 2 3
P(X = x) 1 3 3 1
8 8 8

(i)
E (2X + 2Y] = E (2X) + E (3Y)
= 2E (X ) + 3E (Y)
= 2 x 0.8 + 3 x 0.9
= 1.6+ 2.7
= 4.3

(ii)
V (X + Y) = V (X) + V (Y)
= 0.4+ 0.5
= 0.9

3.4 The Cummulative Mass Function (cmf)

The cummulative mass function of a discrete pdf is given by F(x) = P(X < x). The
pdf of a discrete random variable is often called the probability mass function pmf.
Example 3.4.1

From the probability distribution table below, determine the cummulative mass function

Solution:

F (0) = P(X < 0) = 1

F (1) = P (X < 1)
= P (X = 0) + (X = 1)

13
8+8

1
2
F (2) P(X < 2)
P (X = 0) + P (X = 1) + P (X = 1) + P (X = 2)

92
1 3 3
=8+8+8
7
=8

F (3) = P(X < 3)


= P (x = 0) + P (x = 1) + P (X = 2) + P (x = 3)
13 3 1
= 8+8+8+8
=1

x 1 2 3 4
F(X) 1 2 3 4
k k k k

Example 3.4.2
A discrete random variable X has the cummulative mass function
F(x) = X for x =1, 2, 3, 4.
Find the probability distribution of X, E(X) and V(X)
Solution:

k=4

P (X =1) = F (1) = 1

P(X = 2) = F(2) = F(2) - F(1)

=21
=4-4
=1
=4
P(X = 3) = F(3) - F(2)

= 32
=4-4
=1
=4
P(X = 4) = F(4) - F(3)

93
x 1 2 3 4
P(X = x) 1 1 1 1

43
4-4
1
4

The
probability
distribution
is

E (X) xP (x)

1111
1x-+2x-+3x-+4x-
4444

2.5
V (x) E (x2) — p2

£x2P(X = x) - //2

12 x 1 + 22 x 1 + 32 x 1 + 42 x 1 - (2.5)2
4444

1 25
7
2-T

14

3.5 Median

The median of a probability distribution of a random variable X is the smallest value


for which P(X = x) > 0.5. If the median is m, F(m) > 0.5 or 1 — F(m — 1) > 0.5.
Example 3.5.1
A discrete variable X has the distribution P(X = 1) = 0.2,P(X = 2) = 0.3
P(X = 3) = 0.3 P(X = 4) = 0.1 P(X = 5) = 0.1. Find
(i) the cummulative mass function
(ii) the median
(iii) sketch the graphs of f (x) and F(x).
Solution:

94
X P(X = x) P(X < x) = F(x)
1 0.2 0.2
2 0.3 0.5
3 0.3 0.8
4 0.1 0.9
5 0.1 1.0
(i)

F(x) = P(X < x)


F (1) = 0.2, F (2) = 0.5,
F (3) = 0.8, F (4) = 0.9,
F (5) = 1.0

(ii) F(2) = 0.5 median = 2


(iii)

F(x) .

1.0--
0.8--
0.6 —

0 1 2 3 4 5
Graph of F(x)

95
x 0 1 2 3 4
P (X = x) i 2 4 8 16
31 31 31 31 31

Example 3.5.2

A random variable X has the probability function

P (X = x) = k • 2x x = 0,1, 2, 3, 4
{ 0, elsewhere

Determine

(i) the value of k


(ii) E(x)
(iii) V(x)
(iv) median of x
Solution:
(i)

P (X = x) = k • 2x x = 0,1, 2, 3, 4
{ 0, elsewhere

k(20 + 21 + 22 + 23 + 24) = 1
K (1 + 2 + 4 + 8 + 16) = 1

1
k
3
1

E(X) yP xP(X = x)

12448 16
0 x------+1 x------+2 x------+2 x------+3 x------+4 x 31
31 31 31 31 31
98
31

96
31 31 31
7 8 15

(iii)
V
(x)
=E =
(x2) ^2
— x2p(x 4 ., 8 16
1 2 4 - - -■ 2 32 x -I2 2 x — ®2
p2 = 02 x------+ 12 x------■ 22 x------■ 22 x -31-
2 2 2 2
31 31
x) 31 31 31
— 2
p2 346 /98\
IF V 31/
1122 = 161
FF = 196T

(iv)
F(
m) 1
> F (0) 31
0.5
for 1 2=3
me F (1) 31 + 31 = 31
dia
n 3+
F (2) £=
7
F (3)
31 31 31
15 16
F (4)
31 + 31

=> Median of x = 4.

Example 3.5.3

A discrete random variable has a probability function

P (X = x) = | k (If , x = 0,1, 2, 3, 4
0, elsewhere

Determine
(i) the constant k

97
x 0 1 2 3 4
P (X = x) 1 1 1 1 1
i 5

(ii) P(x < 2)


(iii) the median of x

Solution:

(i)

k(1)

F)3 (A
(9' 49' (4)’
k 1

25
k 6
34
(ii)

P(X < 2) = P(X = 0) + P(x = 1) + P(x = 2)

= 256 64 16
+ +
= 341 341 341
= 336
= 341

(iii) F(0) = since this exceeds ' the median is 0.


NB: I have not bothered with ways of finding the mode because it is the
value of x with the highest probability. If one has a probability distribution
of X, then that value of x which has the highest probability is the mode.

Exercise 3

1. A discrete random variable X has the following probability distribution

Find the mean and variance of X

2. A random variable X has the following probability distribution

98
x 1 2 3 4
P (X = x) 0.2 0.1 0.4 0.3
x 0 1 2 3 4 5
P (X = x) i 3 1 i ii ii
Find 5 10 10 8 80 80.

(i) the constant k


(ii) the expectation of X
(iii) median and Find
variance of X(ii) V(x) (iii) P(x = 2/x > 2)
(i) E(X)
x 6 10 12 16 20
P (X) 2 3. iMusoki
i is 4 given
i pocket money using the following condition: Her father rolls a
I5 die
3 and I5 I5her 400/ = ( a hundred shillings) for each sport on the upper most
gives
face of the die. What is her expected pocket money?
4. A random variable X can take the values shown in the table below with the given
probabilities

5. Calculate the expected value and variance of X


6. Calculate the expected value and variance of X2.

7. A bag contains 4 green and 6 black marbles. A sample of three marbles is drawn
at random from the bag without replacement.
8. Find the probability of obtaining exactly two green marbles in the sample.
9. Find the probability of obtain exactly two black marbles in the sample
10. Find the expected numbers of green marbles in the sample.
11. A discrete random variable X has the probability mass function

(x x = 0,1,2,3,4
P (X = x) = | 0 elsewhere

(i) P(x = 3/X > 3)


12. A random variable x has the probability distribution given in the table below.

99
x 0 1 2
P (X = x) i 1 i
2 4

(i) Find E(X) and V(X)


(ii) If 2Y = X + 5, find E(Y) and V(Y)
13. If X and Y are two independent random variables with E(X) = 0.3,E(Y) =
0.9,V(X) = 0.15 and V(Y) = 0.4,
find
(i) E(3X + 5Y)
(ii) V(X + Y)
(iii) V(X - Y)
(iv) V (2X + 4Y)
14. The discrete random variable X has the following probability distribution

(i) find the mean and variance of X


(ii) If two independent random variables X1 and X2 have the same distribution
as X, find the distribution of X1 — X2. Solve for its mean and variance.
15. (i) A couple plans to have four children. Construct the probability distribution
table for the number of boys they give birth to.
(ii) Find the expected number of boys
16. A random variable X has the probability mass function

P(X = f C.3x, x = 0,1, 2, 3


( )
[ 0, elsewhere

Find
(i) the value of the constant C
(ii) E(x) and V(x)
(iii) P(x < 2)
17. A discrete randaom variable X has probability function

2+x
P (X = x) = { x = 0,1, 2, 3, 4, 5
kx
0, otherwise

Determine

100
(i) the value of k
(ii) the expectation of X
(iii) the variance of X
(iv) P(X > 3/X < 5)
18. A bag contains 7 blue and 5 red marbles. Four marbles are drawn at random and
not replaced.
Find the probabilities that
(i) no red marble is drawn
(ii) exactly two red marbles are drawn
(iii) three blue marbles are drawn
(iv) no blue marble is drawn

101
Chapter 4

THE BINOMIAL DISTRIBUTION

4.1 Introduction

A dicrete random variable X having a probability density function of the form

P (X = x) = ( n )pV'= 0.1.2,...,n

where q =1 — p is said to have a binomial distribution. The properties of a binomial


distribution are that

1. A single trial has only two possible mutually exclusive and exhaustive results.
These results are either a “success” or a “failure”.
2. the values of p and q are constant through out all the trials

3. the result of each trial is independent of previous trials

4. the number of trials n is constant.

Activity B3

Example 4.1.1

The probability of winning a game is |. Eight games are played. What is the probability
of

(i) four success

(ii) atleast two successes.


Solution:

102
(i)

4 4
P (X = 4)

81 x 16
= 70 x 5

= 0.2322432
~ 0.2322

(ii)
P(X > 2) 1 -{P (X = 0) + P (X = 1)}
(5) 1 T 1 7

= 1 -{0.00065536 + 0.00786432}
= 1 - 0.00851968
= 0.99148032
0.9915.

Example 4.1.2

The probability that a patient recovers from the Ebola disease is 0.2. If 6 people
are known to have contracted the disease, what is the probability that
(i) atleast 2 survive
(ii) atmost 4 will survive
(iii) between 2 and 4 survive.
Solution:
Here n = 6, p = 0.2 and q = 0.8
(i)

P(atleast 2) = P(X > 2)


= 1 -{P (X = 0) + P (X = 1)}

(t •( 5

103
1 -{0.262144 +0.393216}
0.34464
0.3446

(ii)
P(atmost 4) P (X < 4)
1 - P(X > 5)
1 -{P (X = 5) + P (X = 6)}
(1) 1+
0

= 1 -{0.001526 + 0.000064}
= 1 - 0.0016
= 0.9984

(iii)
P(2 < x < 4) = 1 -{P(x < 2) + P(x > 4)}
= 1 -{P (x = 0) + P (x = 1) + P (x = 5) + P (x =
6)}
= 1 -{0.262144 + 0.393216 + 0.001536 + 0.000064}
= 1 - 0.65696
= 0.34304.

Example 4.1.3

A coin is tossed four times. Find the probability that


(i) three heads are obtained
(ii) no head is obtained
(iii) atleast one head is obtained.
Solution:
Here P = 1 ,q = 1 ,n = 4
Let X be the event “a head is obtained”
(i)

i
P (X = 3)

104
4x—
16
1
4

(ii)

P (X = 0)

D 4

1
16

(iii)

P(X > 1) = 1 - P(x = 0)


=1
= - 16
= 15
= 16 ’

Note 4.1.1

( n ) prq
Values of r = 0,1,. ..n

Can be obtained from tables if p is a common fraction. Try to read off the
probabilities we have so far got from the binomial distribution tables at the end
of the book.

105
Example 4.1.4

In Musoki’s family, the probability of having a girl is 0.3. If there are 6 children,
determine the probability that
(i) they are all boys
(ii) there is atleast two girls
(iii) there are three girls

(iv) all are girls.

Solution:
Here n = 6,p = 0.3,q = 0.7
Let x be the event of having a girl
(i) P(they are all boys) = P(no girl)

P(x =0) = ( 6 ) (0.3)°(0.7)«

= 0.1176 (from tables).

(ii)

P(X > 2) = 1 -{P(x < 2)}


= 1 -{P (x = 0) + P (x = 1)}
= 1 -{0.1176 + 0.3025} (from tables)
= 1 - 0.4201
= 0.5799.

(iii)

P(x = 3) = ( 6 ) (0.3)3(0.7)3
= 0.1852.

(iv)

P(all girls) = P(x = 6) = 0.0007. (from tables) or 0.000729 (from calculator).

106
E [x(x.1)] = n(n — 1) 2 n 2 n(n — 1)(n — 2) 3 n 3
= 2x1 2 x 1 +3 x 2 x . ! ' p3 q"-3

4.2 Mean and Variance of a Binomial Distribu-


tion

For a binomial distribution of n trials and probability of success p, mean = np


and variance =52 = npq.
To determine the mean, it is known that

E (X) xP (X = x)

E x ( n ) pxqn-x
x=0 ' '

Stating the
series term
by term (n - 1) -
p = 0 x qn + x --------p2 2n q2 2
E (X) 2-1
1 x npqn 1 +
2
n(n - 1)(n - 2) 3 3 n
+3 x —---------- ------L p3q4 n 3 + ... + np
3x2x1
npqn-1 + n(n - 1)p2qn 2 + —2)p3qn-3 + ... + n x pn
21

np [qn-1 + (n - 1)pqn-2 + (n 1)(™ 2)


p2qn-3 + ... + pn-1
P 21

but what is in the square bracket is the binomial expansion of (p + q)n-1 and
p + q =1. so that what is in the square bracket sums to 1.
Therefore p = np.
To get the variance, recall that V(x) = E(x2) - [E(x)]2 which can be expressed
as
c2 = E(x2) - (E(X))2 = E[x(x - 1)]
So for the Binomial distribution
n
1)] = ^52 x(x - n-x
E [x(x x=0 px q

Stating the series term by term, first two terms are each zero. beginning with the
third term

107
E (x) = np = 12

-\/Var(x) = = ynpq = 2
npq = 4
1 „ n(n — 1)(n — 2)(n — 3) 4 n 4 . .n
q =’ 3 +4 X 3 X ( 4x3x2x1 )p4
'' ' n(n — '

2 n(n — 1)p2 q”-2 + n(n — 1)(n — 2)p3 q”-3 + n(n 1)(n 2)(n 3)
p4q”-4
p =’ 3 21

+... +
n(n
(n — 2)(n — 3)
1)p” p2qn-4
E[x(x — 1)] n(n — 1)p2 2x1 P q + ... + p”-2
qn 2 + (n —
2)pqn 3 +
(after taking out the factor n(n — 1)p2)
The terms in the square bracket sum to 1 since they are the expansion of ‘
(p + q)(”-2) and p + q = 1.
So E[x(x — 1)] = E(x2) — E(x) = n(n — 1)p2
Isolating E(x2),
E (x2) = n(n — 1)p2 + E (x)
but E(x) = np
E(x2) = n(n — 1)p2 + np
and variance = E(x2) — [E(x)]2
Var(X) = n(n — 1)p2 + np — [E(x)]2
= n(n — 1)p2 + np — (np)2
2 2np
= np — 2 2+2np — np
= np - np2
= np(1 — p) but 1 — p = q
Var(x) = npq

Example 4.2.1

If the binomial distribution B(n,p) has mean 12 and standard deviation 2, find
n and p.
Solution:

108
np 12

2
n
'3 12

n 18
2
Therefore n 18 and p1 = -.
3

Example 4.2.2

For a random variable X having a binomial distribution B(10,1). Determine


(i) the mean
(ii) the variance
(iii) P(x = 4)
(iv) P(X> 0)
(v) P(2 < x < 9).
Solution:
(i) n = 10,p = 4,q = 3
mean = p = np =10 x 1 = 2.5
(ii) variance = npq =10 x 4 x 3 = 30 = 1.875
(iii)

P X 4
( =)=

= = 0.1460 (from tables)


SS
Example 4.2.3
Peter found that 25% of the people who accept invitations to a party do not
come. For a party that he is going to hold next week he has 16 chairs for
guests but has invited 20 people. What is the probability that there is no
chair for every one who will come to the party.
Solution:
Let X be the event, “invited guest has come for the party”. There will not
be a chair for every guest if the guests exceed 16. So we require
P(X > 16) = P(X > 17)
P(X > 17) = P(x = 17) + P(x = 18) + P(x = 19) + P(x = 20)
= 0.1339 + 0.0669 + 0.0211 +0.0032
109
4.3 Binomial Recurrence formula

The Binomial recurrence formula is

P(X = x + 1) = -—- • —^P(X = x)


x+1 1—p

This enables successive probabilities to be more easily calculated once the initial prob-
ability is known.
Example 4.3.1
For B(5, 5), use the recurrence formula to solve for all the individual probabilities.
Solution:

p (-=°>4^(l)0(5)5=°-07776

By the binomial recurrence formula

- — x _P P (X = x)
P (X = x + 1) x +1 1 —p

5 2/5
P (X = 1) X 0.0776 = 0.2592
1 • —T
3/5

4 •2/5
—X 0.2592 = 0.3456
P (X = 2)
2 3/5

3 2/5
P (X = 3) X 0.3456 = 0.2304
3 • —T
3/5

P (X = 4) 1 2/5
• —T X 0.2304 = 0.0768
2 3/5

P (X = 5) 1 2/5
5 X 0.0768 = 0.01024
3/5

Clearly, these probabilities add up to 1 since a binomial distribution has exhaustive


events.
Exercise 4

1. One in five people in Kampala City is employed. What is the probability that in
a random sample of 8 people

110
(i) none is employed
(ii) all are employed
(iii) atleast two are unemployed
(iv) atmost two are employed.
2. In a hospital ward of thirty patients, 15 are of blood group A+. What is the
probability that in a sample of 9 patients picked at random
(i) three are of blood group A+
(ii) none is of blood group A+
(iii) all are of blood group A+
(iv) atleast one is of blood group A+.
3. It is known that 80% of seeds of maize if planted in good soil will germinate

(i) If John planted 10 seeds, what is the expected number of seeds that will
germinate?
(ii) How many seeds should he plant so that 10 of them germinate?

4. It is established that one in four men is left handed. What is the probability that
in a sample of 15 men,
(i) 5 are left handed
(ii) none is left handed
(iii) 13 are left handed
5. The probability that a marksman will hit a target is -.
He fires 4 shots. Calculate the probability that he will hit the target
(i) twice
(ii) four times,
(iii) exactly once.
(iv) how many shots at the target should he be allowed so that his probability of
hitting the target atleast once improves to -9
6. A rifle mans probability of hitting a target is |
(i) Find the probability that he will hit the target atleast once in 6 trials
(ii) Find the probability that all shots miss the target
(iii) Find the minimum number of shots that he must be allowed in order to have
a probability of atleast 0.8 for atleast one shot to hit the target.

111
Chapter 5

THE POISSON DISTRIBUTION

5.1 Introduction

This distribution was first used by a French mathematician, Simeon Poisson and is used
to determine the probability that a particular event will take place a certain number of
times over a specified period of time or interval. For instance, the number of patients
arriving per hour at a hospital is a random variable with a Poisson distribution. Other
examples of random variables that exhibit a Poisson distribution are:
1. The number of days in a given month on which a worker reports late for work.
2. The number of defects detected each day by a quality control inspector of a spare
parts plant.
3. The number of breakdowns per year that a bus on a given route experiences
4. The number of accidents that occur per month at a manufacturing plant.
5. Telephone calls arriving at a switch board in given time intervals
6. Insurance claims per month/year, e.t.c.

5.2 The Poisson formula

A dicrete random variable X having a probability density function of the form

e~xXx
P(X = x) =--------:— where x = 0,1, 2,...
x!
is said to have a Poisson distribution, where X represents the discrete Poisson random
variable x represents the number of rare events in a unit of time, space or volume
A is the mean value of x

112
e is the base of the natural logarithm and is equal to 2.71828
For the Poisson formula to be applicable, two or more events should not occur sumul-
taneously, the events should be independent and the mean number of events in a given
interval is constant.

Activity B4

Example 5.2.1
The number of lorries per hour crossing a bridge is Poisson distributed with mean 6.
Find
(a) the probability that 6 lorries cross in one hour
(b) the probability that 12 lorries pass in two hours.
Solution:
(a) The mean number of lorries in an hour is 6 So that

66e-6
6!
0.160623141
0.1606
P (X = 6) =
(b) The mean members of lorries in two hours is 12 So that

1212
12!
0.114367915
0.1144.
P (X = 12) =

Example 5.2.2

Telephone calls arrive at a switch board at the rate of 10 per 5—minute period. Find
the probabilities of 0,1 or 2 calls arriving in any 5 minute period.
Solution:

e~x • Ax
P (X = x) and A = 10
x!
e-10 • 100
P (X = 0)
0
0.000045399927
6
113
e-10 • 101
1
0.004539992976
0.000454
e-10 • 102 0.0000454
2!
0.002269996488 P (X =1) =
0.00227

P (X = 2) =

NB: Tables may be used to find probabilities for given values of A, the mean.

Activity B5
5.3 Mean and Variance of a Poisson distribution
Example 5.3.1

Prove that for the Poisson distribution E(x) = V(x) = A.


Solution:
The Poisson formula is

e-xAx
P (X = x)
x!

Mean E (x) = xP (X = x)
x=0

A x
E xe A
x= x!
0

0 x e-AA0 1 x e AA2 2e-AA2 3e AA2 (x + 1)e AA AA(x+1)


+ +
0! 1! '2! —+...+...+' ) (x + 1)!

-A
A2e-A A3e-A A(x+1)e-A
0 + Ae ! + + ...+ ------;------+ ...
x!
-A Ae A A2e A Axe A
Ae + _■! '... + —
^T +

114
but the bracketed terms are those of the probabilities of a Poisson distribution which
sum to unity.

Therefore E(x) A[1] = A.


Variance is given by E {(x — ^)2} and

E {(x —
h)2 ,,—x\x
where = A
E(x — A)2 • e x!
A

[x(x — 1) + x(1 — 2A) + e—xAx


A2] x!
x=0

The expression x(x — 1) cancels with the first two terms of x!, so that
E {(x —
Variance h)2

oc x\x x\x x\x


E. . e xAx 2A A
xe xAx A ,2\- e xAx
x(x — 1) -i- + (1 — )E —f- + *E —
x=0 x=0 x=0

Of the three summations, the second summation is E(x) which has been seen to be A

and the third summation is ^2 = 1. In the first sum, the first two terms are both zero,
x=0
so that

~ —xAx
e
2 x 1 x e—x • A2 3 x 2 x e—x • A3 4 x 3e—x • A4
+ '
Zx(x—1) .A 2! 3! + 4!
!
x=0
x x+2
+ + (x + 2)(x(x+ +1)e
2)! A
A4e-x Ax+2e—x
A2e-x + A3e-x + -----:-----+ ...
“1T +... +
x!
2 —x
A2 e—x + Ae—x + A e Axe—xl
~2T +... + x!

= A2

Because the terms in the bracket sum to 1. Substituting for the three summations
Variance = E( (x — ^)2}

115
E + I is Po(0.5 + 1.5)= Po(2)
P(E + I > 2)= 1 - P(X < 2)
P(E + I > 2)= 1 -{P (E + I = 0) + P (E + I = 1) + P (E + I = 2)}

But P(E + I = 0) • 2o
= 0! = A2 + (1 - 2A)A + A2
= A2 + A - 2A2 + A2
= - 2 = 0.135335283 = A.
2
• 2!
So mean equal evariance.
P (E + I = 1)
= 1!
5.3 Additive
= 2e-2Property of the Poisson distribution
= 0.270670566

If X is Po(x) and Y is P0•(y),


22 then X + Y = P0(x + y).
P (E + I = 2)
Example 5.4.1= 2!
Telephone calls= 2ereach
-2 a switch board independently and randomly. External calls reach
= 0.270670566
at a mean rate of 1 in any 4 minute
So that P(E + I > 2)= 1 -{0.135335283 period while
+ 0.270670566 internal ones reach at a mean rate
+ 0.270670566}
of 3 in any 4 minute period. Calculate the probability that there will be more than 2
= 1 - 0.676676416
calls in any period of 2 minutes
Solution: = 0.323323583
0.3233 E represent the number of external calls per period of two
Let the random variable
minutes. So E is Po(2 x 1) = Po(0.5)
Let the random variable I represent the number of internal calls per period of two
minutes. So I is Po (1.5)
Using the additive property of the Poisson distribution

116
(iii)
P(X < 1) = P(X = 0) + P(X = 1)
= 0.2774 + 0.365
= 0.6424

(iv)
P(X > 1) = 1 - P(X = 0)
= 1 - 0.2774
= 0.7226
And using the Poisson distribution A = np = 25 x 0.05 = 1.25

e np(np)x e-L25(1.25)x
P (X = x) = x!
x!

(i)

e-1'25 x 1
P (X = 0) 0!
0.2865

(ii)

e-1'25 x 1.25
P (X = 1) 1
0.358

(iii)

P(X < 1) = P(x = 0) + P(x = 1)


= 0.2865 + 0.358
= 0.6445

(iv)

P(X < 1) = 1 - P(X = 0)


= 1 - 0.2865
= 0.7135

118
(i)no call in 1 hour
(ii)one call in one hour
(iii)one call in 2 hours
(iv)two calls in two hours
(i)none died Observe that the answers got due to using the Poisson distribution do not differ so
much from those got using the binomial distribution. If the value of P was 0.02 or
(ii)exactly two died
0.01, the answers would be even closer to each other. The Poisson approximation
(iii)atmost two died
to the binomial distribution is so handy and better as n gets larger and P tends
to zero.
(iv)atleast three died.

Exercise 5

1. The number of demands for special hire cars from a rental firm is Poisson dis-
tributed with a mean of 6 demands in 1 hour. Find the probabilities of

2. The mean number of patients arriving at a clinic in two hour intervals is 5. Cal-
culate the probabilities of 0, 2, 4, 7 arrivals per two hour interval.
3. The number of emergency calls at a police station each day is found to have a
Poisson distribution with mean 2.5
(i) Calculate the probability that on a particular day there will be no emergency
calls
(ii) On a given day, there are six cars available for response to emergency calls.
Calculate the probability that the six cars will surfice
4. The probability that a brand of pen is faulty is 0.02. The pens are packed in
boxes of 200. If a box is randomly chosen find the probability that
(i) there are no faulty pens
(ii) there is one faulty pen
(iii) there are atleast three faulty pens.
5. It is known that 2% of patients who contract malaria in Uganda die if they dont
reach at a hospital within one day of contracting the disease. On a particular day,
150 people contracted the disease. If these people never reached a hospital, what
is the probability that

119
6. The circumised men in a given district are 3%. What is the probability that in a
sample of 10, 000 men
(i) none is circumised
(ii) 30 are circumcised
(iii) exactly 40 men are circumcised
(iv) exactly 15 men are circumcised.

120
Chapter 6

CONTINUOUS PROBABILITY
DENSITY FUNCTIONS

6.1 Introduction

A continuous random variable theoretically represents quantities like time, weight, tem-
perature, height, distance, mass, etc. A probability density function f (x) of a random
variable X is said to be continuous since it has a continuous domain. The probabil-
ity density function of a continuous random variable X is a function which allocates
probabilities to all values in certain intervals that X can take.

Properties of f(x):
(i) f (x) > 0 for all values of X.

(ii) If a < x < b, then f (x) = 1.


(iii) The probability of a < x < x1 where x1 < b is given by f (x)dx

Activity C1

121
.J \~ ) 4—“—2
0,
otherwise

f the constant k

-)
3
n
6

k(/ — cos x)dx + k sin xdx 1


Jo
4
n 1

n 1
4

k 4 — ~7 + “7 1
4
22

nk 1
4k
4
k n

/.273239545
/.27324
(b)

n\ n
P(z - x
- 3) k sin xdx

4 n
n cos
1 n3
xi
4
4 (2
n

4 (V2 - 2)
n 2\.'"2

n
= 0.263696543
= 0.2637

(c)

/ n n
P0-x-- k(1 - cos x)dx
6

n
— (x — sin 6
x)
n 0
4 f n I)—(0—0)
n\6

4 4
6 2n
0.030046894 = 0.03

123
x2 5 x2
k + k 10x ——
2 0 2

J IV
r
.J < J
J
(x) \ L
1
= J-
0, elsewhere \J
U

co
ns
ta
nt
k

5 110
kxdx + k (10 0— x)dx 1
0
05 5
10
1
5
25 25
—k + k (100 — 50) — (50 1
~2

25 25,
k+k 1
2 2

25k 1
1
k
25

P(0 < x < 3) = kxdx


0
1 x2 5 1 x28
— + 10x
25 T 4 25 2 5
15 3
25 ’ = - = 0.6
5
1 x2 19
25 2 25 ’ 2

9
— = 0.18
50

(c)

P(2
<x
< 2
4) 1 x “I 4
25 2
2
1
25 • (8
- 2)
6
=
25 0.2
4
(d)

5 y8
P(4 < x < 8) kxdx + / (10 — x)dx

ill4 — 4 — - (50— SI

1
— x 15
25

6.2 Expectation and variance

For a continuous random variable X with a probability density function f (x), the
expectation is given by

E (x)

125
This is also called the mean value of X, p. The properties of expectation are
(i) E(a) = a, a constant.
(ii) E(ax) = aE(x)
(iii) E [G(x)] = f G(x)f (x)dx
Example 6.2.1
A probability density function of a random variable X is given by

' 4x, 0<x<1


f(x)
= < 5(3 - xL 1<x<2

0, otherwise

Find the mean of X.


Solution:

E (x)

4
2 /'2
2
-x
5
dx + - 5
(3x — x2)dx
Ji
lx3' 2 32 x 31 2
o+ 5
2x 3
i

4 2 3) (2 — 3)
15 + 5

The variance of any probability distribution is given by Var(x) = E(x2) — [E(x)]2 where
E(x) is the expectation and E(x2) is given by

x2f(x)dx

Example 6.2.2

126
For the probability density function below, find the variance of X.

'2x, 0<x<2

f(x) = < k, 2<x<4

0, otherwise

Solution:
We first have to find the value of the constant k.

fk f4.,
> I —xdx + kdx 1
Jo 2 J2
21 2 - x "1
k x ■ +k 4 1
4-o

k(1) + k(4 - 2) 1
3k 1
1
k
3

Var(x) E(x2) - [E(x)]2

But E(x)

1 2 x2 1 4
- —dx +— xdx
3 Jo 2 3J2

i £2 i rx^n4
3 Mo+3 ¥2

3IP - ') -8 - 2.)

1 22 = 22
3xT=¥

127
and E (x2) / x2f(x)dx
J all x
k 2
f 3J , y4 2J

2 x dx + k / x dx
Jo J2

i r 4 “i2 334
x
k x 4 -I o+ k 3
J2
-
k / 64 I)
= 2(4 - 0) + k V

i(4) + 1 56 \
6' ' 3

4 56 _ 62
6+¥_¥

62 (22\2
Var(x)
¥ V "9/

62 484
¥ - IT

74
8l 0.913580246

0.9136

6.2.1 The Median


The median divides the area under the curve of a probability density function into two
equal parts. Therefore for a random variable X which varies over the interval [a, b], that
is, a < x < b , the median is given by

1
2

Example
A continuous random variable X has a probability density function given by

( k(x — x3), 0<x<2


f (x) = {
0, elsewhere

128
2 4
m
~2 - 4
m

4
m - 2m
2 -4
Let m2
Find its median.
2
Solution:p - 2p -4
We need to first find the value of the constant k. Therefore,
p

x3)d 1
p
x
But 1 \5 is negative. So we take x4’ 2
x2
2 ± V4+16 k 4
1
2 -0

k [(2 - 4) - (0 - 0)] = 1
-2k = 1
1
k 2

The
refo
re 1, 1
- x3)d
me 2(X 2
x
dia
n is 1 31
(x - x )
giv 2 =2
en
by 1 x2 x 4-1 1
2 2 4m 2
0 1
4 m
x2 x
2 4
0

0
p. Then
0

p = 1 + V5 m2 = 1 + V5

129
m v1 +v5
V3.236067977
1.79890744 = 1.799

So median is 1.799.

6.3 Mode

This is the maximum value of the function f (x). It is the value at which maximum
probability is attained. For instance, using the last example, the mode is found thus:

k(x — x3), 0<x<2

0
, elsewhere
{

But k was found to be 1

d 1,
f'(x)
dx

1 2
2 [1 - 3x ]

3x2 1 0

x2 1
3

x ±1
V3

f "(x) — 2 ’ (—6x) = 3x

When x yj the value of f" will be positive hence minimum, but when x = — yj

the value of f" is negative and hence gives a maximum value of f(x). Hence the mode

is — J 1 . But this value is outside the interval for which the function exists. So X has

no mode.

130
6.3.1 The Cumulative Distribution Function
This is defined by

X1
Z f(x)dx

where f (x) is the probability density function. It is denoted by F(x).


f (x)dx = P(x < xi)

F(x) is the cumulative distribution function. If m is the median, then F(m) = 0.5.
Example 6.3.1
A continuous random variable X has probability density function

f 1 x, 0 < x < 2
f (x) = ]
0, elsewhere

Find the distribution function F(x).


Solution:
F (x) P(X < x)

f (t)dt

For x < 0, f (t) 0


F(x) 0 and F(0) = 0

For 0 < x < 2, f (t) 1


2t
X
F (x) 1
F (0) + -tdt
Jo 2
rt^ix
0+
4
o
F(x)

F(2) 4
4=1

131
x 3k x 2
k— + T2x
1 02 2

For x > 2, f (t) = 0 The function does not exist.

F (x) = F (2) + 0=1.

Therefore the distribution function is

0, x < 0

F (x) = < 2
x
, 0<x<2
I 1, x

Example 6.3.2

Given the following probability density function, determine F(x).

k, 0 <
x <
f
(x) 2(2 || <
=< - x <
x),
0, 2
oth
X erw
ise
Solution:
We need to first find the value of k.

3 ,o
1
I. 21. (2 1

x)d
x 2
1
3
2
V + — 2'— (2 — ?))
1

3, 1
1,
2
16
k
25
F (x) P(X < x)

122
■x
f (x)dx

For x < 0, f (t) = 0


F (0) 0
3 x
For 0 < x < 2, f (t) / kdt
Jo
16
k [kt]X = kx 25 x

F
(5) 0 + 16 3x -
25 2

24
25

t < x < 2,
o
F (f) +J f k
F (x) 2 (2 - t)dt
2

24 k x
-----+ - 2t r
24--2 2
3
2
24 ■ ' /(ax- - (3
25 50 H 2 J V

24 16 f x2 151
— + — l2x----------------
25 50 [ 2 8J
24 16 1
F (2) —+—x—
25 50 8
For x > 2, f(t) 0
0 = F (2) + 0 = 1.

133
find (i) the constant a ( ii) the distribution function of X.
Solution:

( ax(1 — x2), 0<x<1


f (x) = {
0, otherwise
Therefore the cumulative
distribution function is
given by 0,
0<x

16 x 0<x< t
f 25 ’ +
(x) = <
24 - 25(4x2 - 16x + 15),
22 < x < 2
1, x> 2
X

Example 6.3.3

For a random variable X with a probability density function

{ax(1 — x2), 0<x<1

(i)

/ ax(1 — x2)dx 1
Jo

a (x — x3)dx 1
Jo
x2 4
a
2 “I4 = 1
o

(I—0
a 1
4
a

134
( 4x(1 — x2), 0<x<1
f (x) =
0, otherwise

For x < 0,f (t) = 0 F(0) = 0


For 0 < x < 1,

px
F (1) = F (0)+ / 4t(1 — t2)dt
Jo
t2 t 4-1 x
=0+4 2 4
0
= 0 + (2x2 — x4) — 0
= 2x2 — x4
F (1) = 0 + 2 — 1 = 1

0, 0 < 0

F(x) = x2(2 — x2), 0 < x < 1

1, x>1

For x > 1, f (t) = 0 F(1) + 0 = 1


Example 6.3.4

A random variable X has a probability density function given by

ax(4 — x2), 0 < x < 2

0, otherwise
{

Find
(i) the value of the constant a
(ii) the mean of X
(iii) the variance of X

135
(iv) the mode of X
(v) the distribution function of X, F(x).
Solution:
(i)

/ ax(4 — x2)dx 1
0

41
a / (4x — x3)dx a 2x2
Jo 240 = 1

a(8 - 4) 1

1
a 4

(ii) Mean of X is

E (x) I xf(x)dx
0
2 4 51
1
1 —3
4 J (4x2 — x4)dx 2
x3
4 3 5
0

1 / 32 5—•
4 V

1 64
-x—
4 15

1—
15

(iii) Var(x)= E(x2) - [E(x)]2


But

E (x2) x2 f(x)dx

1/
E(x2) 4 J (4x3 — x5)dx

136
1 4 x6 2
x
4 M0

1 64 \
16
4 - <r) -0

1 16
-X—
4 3
4
3
2
4_
var(x) 3 - V15 J
44
225

(iv)

1
x(4 — x2)
f (x) 4

1 3
xx

, 3
f '(*) 1 —?x2
4

f '(x) 0
1 — 3 x2 = 0
4

x 2
±-=
73
f'' (x) 3

2x

f''(x) is negative when x = —3 = 1.154700538 ~ 1.155, so this value gives f (x)


the maximum value.
Therefore the mode of X is = 1.154700538
3
~ 1.155.

137
F (x) =
rx 1
= F (0) + J 4t(4 — t2)dt
F (2) = 22(8 — 22)
“ 16 =

(v)

( 4x(4 — x2), 0<x<2


f (x) = {
I 0, otherwise

For x < 0,f (t) = 0 F(0) = 0.


For 0 < x < 2

(t — |dt

rt2
L2
t4ix
2 0x 4
x16J
2 16
x2(8 — x2)
16

For x > 2,f (t) does not exist, i.e. f (0) = 0 F(x > 2) = 1.
Therefore F(x) is given by

0, x<0

F (x) = < x2(8-x2)


0<x<2
16
1, x>2

Example 6.3.5

A random variable X takes on the values of the interval 0 < x < 2 and has a probability
density given by

138
2cx 1.5 x2
+ c (2x—y)
1
0

2c; 0<x
< 1.5
f (x) 1.5 <
=< x<2
c(2
0, -
x)
otherwise ;
(i) Find the value of c
(ii) P(1 < x < 1.8)
(iii) the mean of X
(iv) the variance of X
(v) the cummulative distribution function, F(x).
Solution:
(i)

2cdx — 1
+ x)dx
2
1
1.5
9
3c + c (4 — 2) — (3 — 8) 1

1
3c
+c•8 1

25
¥c 1

8
c
25

(ii)

26 ;0 < x < 1.5


f (x)
25(2 — x); 1.5 < x < 2
otherwise

139
16 1.5
8 x2
-
—x + 7T7 2x -
25 1 25 2_

16 8
P(1 7 — (2 —
25 dx + x)dx
<x< 25
1.8) 1.
8
1.
16 8
= (0.96 — 25) + 25[(3.6 — 1.62) — (3 — 1.125)]
8
= 0.32+ —[0.105]
25
= 0.32 + 0.0336
= 0.3536.

(iii)

mean E (x)

16 8
x2)dx
25xdx + 25
5
1.5 3
5
2
16 2 8 x
—x 2
50 JQ + 25 x 3
J 1.5
8
1 i a (9 ai
2.

36 8 5
X
50 + 25 24

36 1
50 + 15
59
75

(iv)

E(x2)

16 2
—x dx + 8 x3)dx
25 25

140
16 3 4 8 _ 2 ,3 x 4 l2
25 1-5
3 5-----x'
J0 25 3 4 1.5

16 27 0 /16 - 0 /9 81 \
25 X 24 + 25
V - 64/

18 8 67
25 + 25 X 192

499
600

Variance = E (x2) — [E (x)]2

= 499 /59\2
= 600 V75 J
9577
= ---------- = 0.21822222...
45000
= 0.213

(v)

16 0 < x < 1.5


.
f (x)
=
25(2 — x). 1.5 x 2
0, otherwise

For x < 0, f (0) = 0 F(0) = 0.


For 0 < x < 1.5

16 ’16 1x 16
f (t) 25 dt 25 x
.25 J 0
16
F (1.5) = F (0) + — X 1.5
25
= 0 + 0.96 = 0.96

For 1. 5 x 2

8 fx
f (t)
= 25/15(2 — t)dt

141
0, x < -1

k(x + 3)(x + 1), -1 < x < 0

k(3 + 4x), 0<x<1 2"| x


8
2t -
2(10x - x2 + 5), 1<x<3 25 2
-I 1.5

1, x>3 = 2>

8. x2 15.
—V(2x-------------)
25 2 8

- — (2x 5)(2x - 3)
25V
F(2) = F(1.5) - 2.(4 - 5)(4 - 3)

= 0.96 + 0.04
=1

For x > 2, f
(x) = 0
=1
1
°, x<0
F (x)
= < 16 x
I 25^’ 0 < x < 1.5
I 25 (2 - x~ - 1-1875) 1.5 < x < 21, x > 2otherwise

Example 6.3.6

A random variable X has cumulative distribution function given by

F (x) = <

Find
(i) the value of the constant k

142
0, x < —1
—1<x<
k(x + 3)(x + 1),
0
k(3 + 4x), 0<x<1

2 (10x — x2 + 5), 1<x<3


(ii) the probability density function, f(x)

1, x > (iii)
3 the mean and variance of X
T£ (2x + 4), —1 << 0 (iv) P(0.5 < x < 2)

4 0<x<1 (v) the median of X


13 ,
Solution:
i3(5 — x) 1<x<3
(i)
0, elsewhere

F (x) = <

T
a
k k
i 2"(10x — x2 + 5), 1< x < 3
n
g k
2|30 - 9 + 5] 1

|< 1

1
k
1
3

f (x) = F'(x)
=<

143
r4 x2 1
1 5
2 x3
+
13 — +
13 —x2 -
J-1 2 0 2 3
r4 x3
1
1 5
3 x4'
+
13 — +
13 —x3 —
J-1 3 0 3 4_
(iii)

Mean

/*0 1 r1 41 /'3
— (2x 2
+ 4x)dx + —xdx + (5x — x2)dx
J-1 13 Jo 13 Jo

1 23 3
2
X + 2x
13 3
1
1 •-(—H 4 11 (45—■
13 +----x 2 + 13
13
4 2 34

39 + 13 + 39

12
13

Variance
= E (x2)
— [E 1
(x)]2
1
4 2dx
— (2x3 + 4x2)dx + + Ta x3)dx
13
0 13 X

1 1 4 43 3
X
13 2 + 3 X
1
1 (2 4) 4 1_ 1 T)—(5—5)
• +----x 3 + 13 45
13 13
5 4 70
78 + 39 + 39

51
26

51 2
Variance
26
51 144
26 — 169

144
375
338

1—
338

(iv)

r1 4 1r
P(0.5 < x < 2) L 13' -+-3J1 (5 - x)dx

41 21 2
—x +----5x — —x
13 22
1 13 i
2
4 44 1 1
— + 1—V J(10 - 2) - 5 - i)-
13 26
26 13 13 V 2

2_ 1
13 + 77

11
26

(v)
13(2x + 4), 1x0

4 0<x<1
f (x)
= 13 ’
1<x<3
13 (5 - x)
0,
elsewhere

1 3 [x2 + 4x]-1
(2x + 4)dx 1
13
1[O - ' - 4)]

13

145
Find

(i)the value of the constant k


(ii)the mean value of X
(iii)the variance of X
—dx 4 1
(iv)the median of X 13 —x
0
4
13

Since -13 + -3 = 1. > 1, the


median is in the interval 0 <
x < 1. Therefore
1 1
(2x + 4)dx + 13 dx
13 2

3 4 -i 1
13 + 13 4 o 2

3 4m 1
13 + U 2
4m 7
13 26
7
m 8

activity C2
Exercise 6
1. A random variable X has a
probability density function
given by
4kx, 0<x<1
f
(x) = < k(6 — 1<x<2
2x),
elsewhere
0,

146
2. A continuous random variable X has a probability density function given by

f 1X6, 0 < x < 4

f(x) = < a, 4x6

0, elsewhere
7

where a is a constant. Find


(i) the value of a
(ii) the expectation of X
(iii) the median of X
(iv) the cumulative distribution function, F(x).
3. The probability density function of a random variable X is given by

| sin x, 0 < x < 2


f (x) = ]
0, elsewhere

Find

(i) P(x > 4)


(ii) the mean of X
(iii) the median of X
(iv) the cumulative distribution function
4. The probability density function f(x) of a random variable X takes on the form
shown in the diagram below.

147
(i) Determine the expression for f(x). Hence find
(ii) the mean and variance of X
(iii) the cumulative density function, F(x).

5. A random variable X has probability density function

' 2k(x + 1), -1 < x < 0

f (x) = < k(2 - x), 0<x<2

0, elsewhere
X’

where k is a constant.
Determine
(i) the value of k
(ii) the mean of X
(iii) the median of X
(iv) P(-0.5 < x < 1)
(v) cumulative distribution function, F(x).

148
Chapter 7

THE NORMAL DISTRIBUTION

7.1 Introduction

The normal distribution is an important distribution in statistics. It arises in many


situations of nature and social life. If X is a continous random variable following
a normal distribution with mean p and variance 52, then it can be represented by
X ~ N(p, J2). The sketch of $(x) below is plotted from the formula

$(x) = e -(x-M)2/2^2, _(X<X<


y2r • 5

This curve for T(x) is called a normal curve. The curve has the following properties:
1. It is symmetrical about the mean x = p.
2. It never touches the x-axis but approaches it asymptotically. As x — ±TO, T(x) -
0.
3. It has one maximum at x = p (it is unimodal)
4. The area under the curve sums to unity

149
1
/
e
2T

5. The mean, median and mode coincide at the maximum value of the function
6. The area under the normal curve is used to find probabilities P(a < x < b).

So that

P(a < x < b) = T(x)dx = Area


a

7.2 Standardisation

T(x) is a probability density function which does not give the probability of x but gives
the probability that x lies in a certain range. The probability that X < x is given by

fX
P(X < x) = Tdx

1 -(x-p)2
e 262 dx
2T ■ 5

which is evaluated using Mathematics beyond ‘A’ level. To avoid the complicated
integration, we replace the original variable X by a standardized variable Z where

x—p

So that the equation T(x) = i e (x M)2/2^ reduces to


2T-O

—zi 2 /2
y=

150
The shape of the curve does not change except it becomes symmetrical about the y-axis
so that the mean is 0 and standard deviation is 1.
When the variable has been standardised, tables are then used in the evaluation of
areas (probabilities) between X1 and X2.
Activity D2
Example 7.2.1
The weights of a population of women who attend a maternity clinic are Normally
distributed with a mean of 65kg and a standard deviation of 5kg.
What is the probability that the weight of a woman chosen at random is
(i) less than 55kg
(ii) less than 70kg
(iii) between 55kg and 70kg
(iv) greater than 75kg
(v) less than 60kg
Solution:
Here = 65,5 = 5 so that z = x—5
(i) P(X < 55) = P(Z < 55-65) = P(Z < -2)

From tables, P(Z < 2) = 0.5 - 0.4772 = 0.0228.


(ii) P(X < 70) = P(Z < 70-65) = P(Z < 1)
From tables P(Z < 1) = 0.5 + 0.3413 = 0.8413

151
(iii)

P(
55
- 65 70 - 65)
P(55 < x < 70) (
5 Z 5)

P(-2 < z < 1)

From tables

P(-2 < z < 1) = 0.4772 + 0.3413


= 0.8185

(iv)

75 - 65.
P(X > 75) P(Z > 5)

P(Z > 2)

From tables

P(Z > 2) = 0.5 - 0.4772


= 0.0228

152
(v)

P(X< 60) = P(Z< 60 _ 65)

= P(Z < -1)

From tables, P(Z < -1) = 0.5 - 0.3413 = 0.1587.

Example 7.2.2

A given brand of light bulbs has a life time which is normally distributed with mean
1600 hours and standard deviation 40 hours. What should the quaranted life time of
the bulbs be so that only 4% of the bulbs will have to be replaced under quarantee?
Solution:
Let X be the quaranteed life time

X - 1600
Z — ----------------
40

The Z—value which leaves an area of 0.04 to the left is —1.751. Therefore.

153
Using Z =x - p X1 = 60 and X2
5’
60 - p
Zi = -0.842
= 5
p - 0.8425 = 60 - p
p - 0.8425 = 60
....(1)
X - 1600
-1.751
and Z2 =1.036 = 90 - p 40
5
X = 1529.96 ~ 1530
1.0365 = 90 - p
The= guaranteed
p + 1.0365 90 ...(2)
life time should
Example 7.2.3
be 1530 hours.
In an examination 20% of the candidates fail and 15% achieve distinction. If 60 is the
pass mark and the minimum mark required for a distinction is 90, assuming that the
marks are normally distributed estimate the mean mark and standard deviation to the
nearest whole number.
Solution:

The Z value which leaves an area of 0.2 to the left is -0.842 while that which leaves
an area of 0.15 to the right is 1.036.

= 90

Solving equations (1) and (2), 5 = 15.9744 ~ 16 and p = 73.45047923 ~ 73


Therefore the mean mark is 73 and the standard deviation is 16.

154
P(X < 90) = P(Z < 90 100
)
8
= P(Z< -1.25)
From tables,
7.3 Distribution
P(Z<of-1.25)
a sample
= 0.5mean x from a normal
- 0.3944
population = 0.1056
If x1,x2,x3,xn is a randomly chosen sample from a normal population that has mean
X and standard deviation 5, then the distribution of X is also normally distributed with
mean and standard deviation 5/^/n.
Example 7.3.1
A random sample of size 25 is taken from a normal population with mean 100 and
standard deviation 8. Find the probaility that the mean of the sample is less than 90.
Solution:
n = 25,^ = 100. Let the mean of the sample be X

Example 7.3.2
The lengths of snakes at Nairobi snake park are normally distributed with mean 170cm
and standard deviation 10cm. Calculate the probability that the mean length of a
sample of 16 snakes will be between 165cm and 175cm
Solution:

165 - 170 175 - 170


P(165 < x < 175) <Z<
"4 10/4

= P(-2 <z< 2)
= 0.4772 + 0.4772
= 0.9544

155
7.4 Normal Approximation to Binomial Distribu-
tion

The normal distribution is used as an approximation to the binomial distribution in


cases when n is large the probability is not so far from 1. This is done to avoid tedious
calculations.
If X ~ B(n,p), E(x) = np = p and var (x) = npq where q = 1 — p. Then X ~
N(np,npq), so that
v X ± 0.5 — np
Z = --------, —
npq

Since the binomial distribution is discrete, the value ±0.5 is used to make it continuous.

Example 7.4.1
A coin is tossed 150 times. What is the probability that
(a) there will be more than 80 heads?

(b) there will be atleast 70 and atmost 90 heads?


(c) there will be less than 60 heads?

Solution:

Mean p = np = 150 x ^ = 75

1 1
= 37±
52 npq = 150 x x

4 = ±3?±

Let X be the number of heads obtained

(a)

P(X > 80) P (X > 81)

80.5 — 75)
P (X > 81) P (Z > A/37±5 )

P (Z > 0.898)
0.5 - 0.3155
0.1845

156
(b)

P( 69.5 - 75 90.5 - 75)


Z
=-
P(70 - x - 90) = P(69.5 - x - 90.5)
= P(-0.898 - Z - 2.531)
= 0.3155 + 0.4943
= 0.8098

(c)
P(X < 60) P(X - 59.5)

59.5 - 75)
P(Z - +37+ )

= P(Z --2.531)
= 0.5 - 0.4943
= 0.0057

Example 7.4.2

Use the normal approximation to the binomial distribution with n = 600 and
P = 0.5 to find the probability of a value
(i) less than 320
(ii) greater than 280
(iv) lying between 290 and 315 inclusive
Solution:

p = np = 600 x 0.5 = 300 and 4 = y/npq = V600 x 0.5 x 0.5 = V150

(i)
P(X < 320) = P(X > 320.5)

320.5 300 )
= P (Z<
150

P(Z - 1.674)
0.5 + 0.4539
0.9539

157
(ii)
P(X > 280) = P(X > 279.5)

279.5 300 )
= P(Z >
150

= P(Z - 1.674)
= 0.5 + 0.4539
= 0.9539

(iii)
P(290 < X < 315) P(289.5 < x < 315.5)

P(289.5—3OO < Z < 315.5 - 300)


_ _
7150 Tt50 )

P(-0.857 < Z < 1.266)


0.3043 + 0.3973
0.7016.

7.5 Normal Approximation to Poisson distribution

The poisson probabilities may be approximated by the normal distribution when the
sample size is large, i.e, greater than 30. Recall from chapter 5 that for a Poisson
distribution, mean = E(x) = = A and variance = var(x) = 42 = A.
The Z statistic is obtained by substituting for the mean and variance as follows.

XA
Z=
TA

So that the probability of success between a and b inclusive is given as

a A bA )
P(a < x < b) = P(^^-
A
< Z < TA

Activity D3
Example 7.5.1
The average number of customers entering a bank in a 30-minute period is 80. Find
the probability that in a 30-minute period, between 60 and 95 customers inclusive, will
enter the bank.
158
Solution:
For a Poisson distribution

e~x Ax
P(X = x) =--------;— for x = 0,1, 2,... and A > 0
x!

In this case n is large and A is big, so that there would be tedious calculations to solve
this. We are bailed out of the problem by utilising a normal approximation to the
Poisson distribution

P(60 < x < 95) P M<Z< ')


\/8Q \/8Q

P(-2.236 < Z < 1.677)


0.4873 + 0.4542
0.9415
zzzz
Activity D1 activity D1
Exercise 7
1. Use normal distribution tables to evaluate
(a) P(Z > 1.6) (b) P(Z < -2.4) (c) P(Z > 0.5)
(d) P(2.1 < Z < 2.5) (e) P(Z < 1.2)
2. A random variable Z is normally distributed with mean 0 and standard deviation
1. Find the following values of c.
(i) P(Z < c) = 0.4
(ii) P(Z > c) = 0.82
(iii) P(—c < x < c) = 0.8444
(iv) P(0 < z < c) = 0.4099
3. The marks in an examination were normally distributed with mean p and standard
deviation 5. Solve for p and 4, 10% of the candidates scored more than 80 and
20% scored less than 30 .16 candidates were chosen at random from those who
sat for the examination. Find the probability that their average mark exceeds 55.
4. The marks of 1000 candidates in an examination are normally distributed with a
mean of 60 marks and a standard deviation of 25 marks
(i) If the pass mark is 48, estimate the number of candidates who passed the
examination
(ii) If 8% of the candidates obtained distrinction, estimate the minimum mark
for a distinction

159
5. An unbiased coin is tossed 100 times Find
(i) the probability of obtaining 52 heads
(ii) the probability of obtaining more than 38 heads.
6. The life time of bulbs manufactured by an electric company is normally dis-
tributed. Out of 8000 bulbs, 400 have a life time less than 1200 hours and 350
have life time more than 1500 hours.
(i) find the mean and standard deviation of the bulb life time
(ii) find the percentage of the bulbs with lifetime between 1300 and 1400 hours
(iii) If a sample of 36 bulbs is selected at random, find the probability that the
mean of the lifetime exceeds 1350 hours.
7. In a crowd of people at the car park, 80% were supporters of the Democratic party
while 20% were supporters of the Republic party. If 3600 of them are selected
randomly, what is the probability that more than 750 were supporters of the
Republican party?
8. A professor teaches statistics every year. The tests for the course are standardised
so that the test scores have a normal distribution with mean 70 and a standard
deviation of 10. The professor gives 12% A, 20% B, 35%C, 22% D and 11% F.
(i) What letter grade will a student who scores 76 points on the test receive?
(ii) What letter grade will a student who scores 60 points receive?
(iii) How many points does a student need to score to get an A?
(iv) What minimum points does a student need to score to avoid a failure?
9. The manages of Fina bank has found out that customers come to to cash their pay
cheques on Monday. The amount of money drawn on Monday follows a normal
distribution with 15 million as the mean and 3 million as the standard deviation.
The manager wants to ensure that the amount of money in the bank can cover
99% of the Monday withdrawals. What is the minimum amount of of money that
should be at hand to meet the demand?
10. A mobile phone hand set producer claims that the lifetimes of the hand sets
follows a normal distribution with a mean of 84 months and a standard deviation
of 14 months. The producer quarantees that a new hand set will last longer than
70 months or the full price will be refunded. If 1.2 million hand sets are sold, how
many refunds will be claimed? The producer would like to refund not more than
5% of the hand sets sold. What should his quarantee period be?

160
11. A consumer protection body wants to find out whether a beverage company ac-
tually puts 300mls of soda in a can labelled 300mls. Assume the soda put in the
cans follows a normal distribution with a mean of 301mls and standard deviation
of 2mls
(i) What is the probability that a certain can contains more than 300 militres
of soda?
(ii) The consumer protection body bought 196 cans of soda. What is the proba-
bility that among them, it found fewer than 50 cans that do not contain the
stated amount of soda?
12. Using the normal approximation to the Poisson distribution with A = 80, what is
the probability that
(i) there will be a value greater than 60
(ii) there will be a value between 60 and 85 inclusive
(iii) there will be a value less than 70.
13. A bottling company is supposed to pack 500mls of soda in a bottle. it is found that
the amounts packed follow a normal distribution with a mean of 502 mililitres and
standard deviation of 5 mililitres. The control procedures are designed to reject
a bottle with less than 496 mililitres or more than 510 mililitres.
(i) Find the proportion of bottles that will be rejected
(ii) the value to which the standard deviation should be reduced, leaving the
mean at 502 mililitres so that bottles rejected due to being below 496 milil-
itres are 5% or less for the entire production
14. A national examining body gave an examination to a large number of candidates.
The marks they obtained were normally distributed. A quarter of the candidates
scored less than 35 marks and half of the candidates scored more than 60 marks
(i) Determine the mean and standard deviation of the distribution
(ii) 18% of the candidates obtained distinction. Determine the minimum mark
for a distinction
(iii) Find the proportion of the candidates who scored between 70 and 80 marks.

161
Chapter 8

OTHER THEORETICAL
DISTRIBUTIONS

8.1 Introduction

This chapter addresses aspects that we have not looked at before. We have looked
at the normal. binomial and Poisson distribution. We shall look at the uniform dis-
tribution in its dicrete and continous, aspects, Geometric distribution, the exponential
distribution and moment generating functions. Under moment generating functions, we
shall revisit the binomial and Poisson distributions and then generalise for continous
random variables.

8.2 Discrete uniform distribution

This distribution is utilised when handling a discrete random variable. For instance if
a die is tossed, each face has a probability of 6 of showing up. If X can takes values
1, 2, ...n, then P(X = x) is uniformly equal to n because the sum of the probabilities
must be 1.

If P(X = x) = —, then
n
Mean = p = E (x)
n
XI xP(X = x)

i
n
= 1
x•

n
1
162
x

n
V x gives the sum of the first n natural numbers so that
1
11 1
E (x) n 2n(n+1)

1
2(n +1)

Therefore, if X can take on n values and P(X = x) = n• Then E(x) = 1 (n + 1).


Variance is given by
V(X) = E(x2) - [E(x)]2

n
2
But E(x ) = x2P(X = x)
1
n
1
n
1
1n

iy ■■■
n
1

The sum here is for the squares of the first n natural numbers so that

11 1
E (x2) - -n(n + 1)(2n + 1)
n6

|(n + 1)(2n + 1)
6

and as we found earlier. E(x) = 2(n + 1), so that

V (X) = |(n +1)(2n + 1) 1 I2


6 2(n +1)

|(n + 1)(2n + 1) |(n +1)2


6

163
1. X 1/
= (n + 1) 6(2n +1) - 4(n +1)

2(2n + 1) - 3(n + 1)
= (n + 1) 12

= 12(n + 1)(n - 1)

= T2(n - D

The generalised dicrete uniform distribution looks thus.

Activity E1

8.3 Continuous Uniform distribution

This is sometimes called the rectangular distribution. It is a continous random variable

i a<x<b
f (x)
= b-a ,
elsewhere
0,

and it is sketched thus

164
f{
x)

1.

The mean = E (x) = xf (x)dx


a
x
dx
b—
a
x2 b
2(b — a)
a
b* 2 — a2
2(b — a)

(b + a)(b — a)
E (x)
2(b — a)

a+b
2

= E (x2) — [E (x)]2

x2f(x)dx (V)
a

x3 b 4(a + b)2
3(b — a)
a
b3 — a3 1
3(b — a) (a + b)2

165
But b3 — a3 = (b — a)3 + 3ab(b — a), So that

(b — a)3 + 3ab(b — 1(a


+ b)2
V (X)
a)
3(b — a)
(b — a)2 + 3ab (a + b)2
3 4
b2 + a2 + ab (a + b)2
3 4

4(b2 + a2 + ab) — 3(a + b)2


12

4b2 + 4a2 + 4ab — 3(a2 + 2ab + b2)


12
b2 + a2 — 2ab
12
(a — b)2
12

Activity E2
Example 8.3.1
The number of cars that are stopped at a security check point daily is uniformly dis-
tributed between 600 cars and 1100 cars.
(i) find the probability that atleast 800 cars are stopped at the check point.
(ii) what is the expected number of cars that will be stopped on any given day.
Solution:

1
dx
1100 - 600

r x i1100
-500-800

1100 — 300 = 3
500 500 = 5 ’

166
(ii)

b
E (x)

x
dx
1100 —
600
x 2 1100
2(500)
600
11002 - 6002
= 1000
1210000 - 360000
1000

850

Example 8.3.2

Find the mean and variance of a continous random variable X which is uniformly
distributed over the interval
(i) 0 to 2 (ii) 3 to k.
Solution:

(i)

( 1, 0 < x < 2
f (x) = ]
I 0, elsewhere

E (x)

[ 2dx
J0 L2J
0
x2 2 4
4
-0 4=1

[ x2f (x)dx — [E(x)]2


Variance 0

167
2
x
x 3 -|2
—dx — 12 -1
6
0
8—i
6

1
3

(ii)

k-3 , 3 < x < k


f (x)

0, elsewhere

E (x) x dx

x2 k

2(k — 3) J
k3— 32 k + 3
2

2(k — 3) 2

x2
Var(x) dx
k3
x3 k (k + 3)2
4
3(k - 3) 3
k — 33
3
(k + 3)2
3(k — 3) 4

(k — 3)3 + 3(3k)(k — 3) (k + 3)2


3(k — 3) 4

k2 — 2(3k) + 32 (k2 + 6k + 9)
3 4

_ — k)2

(3 — k)2

12
168
8.3 The Geometric distribution

This distribution has a similarity with the binomial distribution because each
trial can have only two possible mutually exclusive and exhaustive outcomes with
constant probabilities. The trials are also independent. The difference is that our
interest is not the number of successful trials (like in the binomial distribution),
but the number of trials required to achieve a success. The number of trials is
not constant so it is the variable we are interested in

Example 8.4.1

A die is tossed until a 4 is obtained. Find the probability function for the number of
throws required to achieve that.
Solution:
Let X be the number of throws required to obtain a 4.

P
<X_1) _ (
P (X 2)
_ _ (6)(I)
_ 5
36

'■(X 3) (5)-(|)
25
216

and so on.
The probability function is given by

(I x—1(I
P (x) P(X x)

Generally, if the probability of success p, then


P(x) P(X x) (1 — p)x—1p for x > 0
The mean is given by E(x) V xP(x) V xP(X x)

_ x(1 — P)X 1P

169
2q
n(n + 1)
2q
n(n + 1)
Putting values of x = 1, 2,...
The mean is given by
1p + 2(1 — p)p + 3(1 — p)2p + 4(1 — p)3p + ...
= p [1 + 2(1 — p) + 3(1 — p)2 + 4(1 — p)3 + ...]

Comparing this expression with

(1 — x)-2 1 +2x + 3x2 + 4x3 + ...

1
E (x) 2
P
pXp

(since [1 — (1 — p)] 2 p-2)

Example 8.4.2
Find the mean and variance of a discrete random variable X which is geometrically
distributed where P(x = q) = kq, q = 1 2,
...n
Solution:
The probabilities sum 1. Therefore

n n
^2P (x = q) kq = 1, so that
1 1
n
^2q - kn(n + 1) = 1
1

Implying that kn(n + 1) = 2


2
k = n(n+1)

So that P(x = q)

n
Now mean E(x) = £ P(X = q)
1
n
X-
q=1

n
2 2
Vq
n(n
v
+ 1)
' q=1
170
2q
n(n + 1)

This is again a sum of the squares of the first n natural numbers. So

21
E (x) —-------- — n(n + 1)(2n + 1)7
n(n +1) 6
1(2n
+ 1)

Variance = E(x2) - [E(x)]2

1
and E (x2) Y^P (X = q)
q=i
n
EE- 1
q=i
n
2
n(n + 1)
v
' q=1
n
This is a sum of the first n cubes of the natural numbers but ^2x3 = 4n2(n + 1)2, so
1
that

21
E(x
v
2
) = --------------- -v -n2(n +1)2
’ n(n + 1) 4 ’
1
2n(n +1)-

Therefore,

1 1 I2
Variance 2n(n +1) 3(2n + 1)

1
1 (2n + 1)(2n + 1)
9
2n(n +1)
1
1( 2
n + n) (4n2 + 4n + 1)
9

9n2 + 9n — 8n2 — 8n — 2
18

171
n2 + n — 2
= 18
n2 + 2n — n — 2
= 18
(n + 2)(n — 1)
= 18

= 18(n + 2)(n — 1).

Activity E3

8.4 The Exponential Distribution

This distribution has a relationship with the Poisson distribution and is actually derived
from the Poisson distribution. Consider a situation where patients arrive at a clinic,
that is the number of patients in a given interval of time has a Poisson distribution.
If the length of time between the arrival of patients is measured, these times form a
continuous distribution. Let the average number of arrivals in unit time be A. If time t
has elapsed since a particular arrival of a patient, the probability that no further arrival
is given by
P (X = 0) = e-Xt.
The probability that one call arrives in the next At is P(X = 1) = AAte -XAt. These are
as for Poisson distribution with mean At and A At, respectively. From the multiplication
law for independent events, P(time elapsing between arrivals is t and t + At) = =
P(arrivals in t) x P(one arrival in At)
= P(X = 0) x P(X = 1)
= e~Xt x AAte-XAt
If the change in time At is so small, e-XAt may be written as a series thus:
(AAt)2
1
— AAt + •••

So that P(X = 0) x P(x = 1) e-Xt x AAt(1 — AAt + + ...

Neglecting the terms in (AAt)2 and higher powers because they are so small.
P(X = 0) x P(X = 1) = e-Xt • AAt.
Let f (t) be the probability density function for the time elapsing between arrivals of
patients. Then f(t)At is the probabililty that the time elapsing between arrivals is
between t and (t + At), so that
f (t) = Ae-Xt.

172
e At, t>0
f( )
x =< J
0, elsewhere
f (t) = = Xe—At, t > 0

Mean So
tf (t)dt
0 the
dist
ribu
te—Atdt
tion
is
giv
en
an
by
d
is
ske
tch
ed
thu
s

Example 8.5.1

Show that for the distribution

( Xe—At, t>0
f(t) = {
0, elsewhere

The mean is equal to the standard deviation which is equal to A


Solution:

= [-te-Ai]“ - [-e—Atdt

1
= 0- Ae —At
0
173
11
standard deviation = \
2
/ A = A.

— i_e-Atr
-A [ J°

= - A[0 -1]
_1
=A

2
variance t2f (t)dt

j At2e Atdt — —

_' — A;-

[—t2e-AT + I 2te-At — A

21
A2 — A2
1
2
A

but standard deviation is Vvariance

So mean standard deviation A.

8.4 Moment Generating Functions

Calculations for mean and variance are made simpler when moment generating functions
are used. This is done irrespective of whether the distribution is discrete or continous.
This is using a sum in case of the former and using an integral in case of the latter.

174
8.6.1 Mean and Variance for a discrete distribution
The moment generating function for a discrete variable X is given by M(t) which is
defined by

M (t) = £ P (x)ext................................(1)
all x
2 3
but ex = 1+ x + — + — +......................................

So that

(xt)2 , (xt)3 . (xt)4 +


M (t) = P (x)(1+x + (2)
2! + 3! + 4! +
all x

Differentiating equation(2) with respect to t, we get

dM (t) 2 x3t2 x4t3


= P (x)(x+x + +~+ ............................)(3)
dt
all x

Putting t = 0 in equation (3)

/ dM (t)\
x) .................... (4)
V dt J
t=0

Equation (4) is an expression for the expectation (mean) of the random variable. Dif-
ferentiating (3) with respect to t

d2M (t) x4t2


= P (x)(x2+x3t+ + .....................)(5)
dt2
all x

Putting t = 0 in equation (5)

...........
(d2M2^) tot = x2p (x) (6)
V ' =0 all x

Equation (6) gives an expression for E(x2).


But V(x) = E(x2) — [E(x)]2

175
So that the variance of x is given by

Variance (x) E(x2) - [E(x)]2

2
y^ x2p(x) y^ xp(x)
all x all x

[d2M (t) \ / dM (t) \ 2


\ dt2 )t=o V dt J
t=0J

Which can in short be written as

[M"(t)]t=c - [(M(t))t=o]2
Using the moment generating functions, we can arrive at conclusions reached earlier in
chapters 4 and 5 about binomial and Poisson distributions.

8.6.2 Mean and Variance for the Binomial distribution


The Binomial distribution is defined as
P(X = x) = Q) px(1 - p)n-x,x = 0,1, 2, ...n.

The moment generating function gives

M (t) yz (x) eXtpx(1 - p)n-x

= E (!)x
(pe‘ )x(1 - P)n-x
x=o

= [Pet + (1 - p)n

Differentiating with respect to t

dM (t)
pet • n(pet + (1 - p))n 1
dt
/ dM (t) \ = np(p +1 - p)n-1
\ dt / t=o

np(1)n-1 = np....................(7)

176
Equation (7) gives the mean of the binomial distribution. The second derivative gives.

d2 M (t)
petn(n — 1)pet [pe* + (1 — p)]n 2
dt2
+pef'n \pef' + (1 — p)]” 1

(d?M (t) \ pn(n — 1)p[p +1 — p]”-2 + pn[p +1 — p]”-1


X t2 / t=o
np2 (n — 1) + np

Therefore

Varian / dM (t)\ 2
“<X) = t
\ dt )

= [np2 (n — 1) + np] — (np)2


22222
= n p — np + np — n p
= — np2 + np
= np(—p + 1)
= np(1 — p) but 1 — p = q
= npq.........................(8)

8.6.3 Mean and Variance for the Poisson distribution


The Poisson distribution is defined by
-x x
e\
P(X = x) =--------— ,x = 0,1, 2,...
x!

So that the moment generating function gives

M (t)

(Ae* )x
M (t) x!

177
Introducing exe outside the summation but cancelling by putting e xet
inside the sum-
mation

-x
— xet /t A t \x
x
M(t) = e • e ‘J2 e • (Ae )
Xe

k=0 x!

That adjustment was done so that the terms in the expansion are those of the poisson
distribution with mean Ae . Then sum is 1 because total probability is 1. This gives.

M (t) e-XeXet

dM (t) t -xexet .................................. (9)


Ae e
dt
M t
'
and
and Aete-x-Wxe
exe + Aete-x • Aetexe...............(10)
dt2

Utilising equation (9)

(T) «*i *
t=0

and utilising equation (10)

A A2
t=0

so that the mean = E(K) = A and variance = E(K2) — [E(K)]2

= (A + A2) + (A)2
=A

In summary, for any discrete distribution with a random variable X,

dM (t) d2M (t)


= E(x) and = E [x2]
dt t=0 dt t=0

These two expressions enable us to find the mean variance.

178
8.6.4 Mean and Variance for continous distributions.
If X is a continous random variable with probability density function f(x), the moment
generating function is defined by

M(t) = J f (x)extdt

and E(x) and E(x2) are defined by

E(x) = and
t=0
fd2M (t)l
E(x2)
| dt2 J
t=0
Example 8.6.1
Find the moment generating function for

0<x<2
f (x) = i
I0
elsewhere

and use it to find the mean and are variance of the distribution.
Solution:

M(t) = [ f(x)extdx
0

2 extdx

ext 1 2
2t
0

— (e2t - 1)
2t

Since we have t in the denominator we shall get a problem when t is equated to 0.


Expanding e2t as

!A+2t +w + (2t)3 + w + -A
M (t)
2t V + + 2! + 3! + 4! + )

179
1 [ 4t2 8t3 16t4
2t 2t
V
+-------1-----+ IT
2 6
2 2 t3
1 t
+ +-t2+-+...

dM (t) 4 2
1 + -t + t2 + ...
dt o

d2M (t) 4
dt2 3+2t + ...

When t = 0
/ dM (t)\
Mean 1
\ dt / t=0

/d2M (t) \ 4
\ dt2 )t=o 3

/d2M (t) \ / dM (t)\ 2


Variance
\ dt2 )t=o \ dt J
t=0
4 12
3
4
=--1
3

1
3

Example 8.6.2

A random variable X has the probability density given by

( 2ke-2x, 0 < x < x


f (x) = {
[ 0, elsewhere

Find the moment generating function of X and use it to find the mean and variance of
the distribution.
Solution:

180
2
t-2
2
t-2
2 We need to first find the constant K.
t-2
2 e 2xdx 1
2 -1
2 —2xr
2K — e =1
t-2 2
Jo
2
2- t -k [e—2x]r = 1
K 1

2e 2x, 0<x<x
f
(x)
0, elsewhere

M (t) lf ^‘dd

r
/ 2e—2x • extdx
o
pr
2 e(t—2)xdx
Jo

2x— r
t-2

, 2r - e0]

[e(t—2)r - 1]

M (t) [e(t—2)r - 1]

M (t) [e(t—2)r - 1]

181
1
4
2
2- t ’
0 - 2(-1)
M '(t)
(2 - t)2
2
(2-F

Mean [M '(t)Lo
2_1
22 _ 2

0 - 2[2(2 - t) - 1]
M ''(t)
(2 - t)4

4(2 - t) 4
(2 - t)4 = (2 - t)3
4
M ''(0) 23
4=1
8=2
[M''(t) - [M'(t)]]t=o
Variance

1 2
2

11
2-4

Therefore ,M(t)

1
mean 2 and variance = -
4

Exercise 8

1. The probability of Ben hitting a target is 4. Assuming that this probability is


constant and that the trials are independent, calculate the mean number of shots
needed to hit the target.

182
2. A discrete random variable X has probability given by P(X) = c|2 — x|, where c
is a constant for x = 0,1, 2, ...5. Calculate the mean and standard deviation of
X.
3. The number of times that a child will seek for permission to attend a disco before
being allowed is a random variable X with probability distribution.

x
P (X = x) = c x = 0,1, 2,...

Find (i) the constant c (ii) the probability that he will seek for permission more
than twice before he is allowed.
4. A traveller arrives late in town and has to check on various lodges until he finds
accomodation. If the probability that he gets accomodation is constant and equal
to 5, what is the probability that he has to try
(i) two lodges
(ii) more than two lodges.
(iii) find the expected value for the number of lodges tried and the most likely
number of lodges tried.
5. Taxis arrive at stage A every twenty minutes. If Ben walks to the stage without
taking note of the time to find out if he is on time for the taxi, find the mean and
standard deviation of the time for which he has to wait for the taxi.
6. The random variable X has the probability density function f (x) = 3e-3x for
0 < x < x. Find
(i)
P(X > 30)
(ii) F(x)

7. A continous random variable has pdf f where

( 1 x3, 0 < x < 2


f (x) = {
0, elsewhere

Find the
(a) Mean
(b) Variance

183
(c) Median
(d) Cummulative distribution function
(e) P(1 < x < 2).

(f) A continous random variable X is distributed between the values 4 and 8 and has
a pdf of ~. Find the mean, variance and median of x.

9. A random variable X has a probability density function given by

2x
( 2e , 0 < x < x
f (x) = {
I 0, elsewhere

Find the moment generating function of x and use it to find the mean and variance
of the distribution.
10. A random variable X has a probaility density function

( 4e-4x, 0 < x < x


f (x) = {
0, elsewhere

Find the moment generating function of X and use it to find the mean and variance
of the distribution.
11. A continuous random variable X has pdf given by

k(x2 — x3), 0 < x < 2

{ 0, elsewhere

Find the constant k, mean and standard deviation of the distribution.

184
Chapter 9

ESTIMATION

9.1 Introduction

It is not possible in most cases to handle whole populations while analysing some
statistics about those populations. Statisticians are left with the option of choosing a
sample from the population which sample should represent all the characteristics of the
population. The sample mean X and standard deviation S are made to stand for the
population mean u and standard deviation 6.
If samples are taken from the same population, the means of those samples X i, X2 ... Xn
form a distribution which we call the sampling distribution of the mean. Each of the
values X is an estimation of the mean.

9.2 Unbiased Estimate of the mean

A good estimator should be unbiased. This implies that the expectation of the sam-
ple mean X should be equal to the population mean p,. If a sample has size n, the
sample mean X is calculated from the n observations of x. If the observations are
X1,X2,X3,. .. Xn, then

Xi + X2 + X3 + . .. + Xn
X= -----------------------------
n
Xi + X2 + ... + Xn
E (X) E n

E (Xn)
=E + E(D +... + n

= E + E + E + ... + E
nnn n
=n

185
9.3 Unbiased Estimate of the variance

If all possible samples of size n are drawn from a population with replacement, and
the population has mean p and standard deviation 5, the means of the samples have a
sampling distribution with mean p and standard deviation often called the standard
error of the mean.
This value of is derived in the following way:

Let the variance of the sampling distribution be Var(X). Then

Xi 1
Var(X) Var nI

1
—2 Var
n

= {Var(Xi) + Var(X2) + Var(Xs) + ... + Var(Xn)}


n2
but variance of xi = 52 so that

Var(X) = -1 • n52
n2

=f
n

So that standard deviation = Var(x) = .


When the population mean p is known or when we have X as the estimate of p, we
solve for the standard deviation of the sample using the formula

n
S2 = E (Xi - x)2
i n

This formular gives a biased estimate of 5 2 due to the fact the sum of the squares of the
deviation of the xis from X is less than the sum of the squares of the deviations from
p. So once p is known, we find an unbiased estimator of the variance thus:

(xi - p)2
52 E
n

186
E {[(xi - x) - (A - x)]2 |
n

| - x)2 - 2(xi - X)(A - X) + (A - x)2 }


n

E {t" (xi - x)2 - 2(A - x) t" (xi - x) + n—------------------L |


n

E{t E {(A - x2)}

1
(x—x)
(Xi
The second term is zero because nx = nx so that V = 0.
i

A2 E(S2) + E {(A - x)2}


i
2 E (xi - x)2
since S
1 n

5
1
But E {(A - x)} var(x) n

n
A2
So A2 E (S2) + -
n

n82 nE (S2) + A2
nA2 - A2 nE (S 2)
(n - 1)A2 nE (S 2)

A2 n
T E (S2)
n

A2 n
E n —S2
1
(xi - x)2 |

187
Xi f d fd fd2
1.6 1 -2.0 -2.0 4.00
17.2 1 -0.8 -0.8 0.64
17.8 1 -0.2 -0.2 0.64
16.5 1 -1.5 -1.5 2.25
18.0 1 0 0 0
*{ z
18.6 1 0.6 0.6 0.36 42 F— n —
18.8 1 0.8 0.8 0.64 F} -S
19.0 1 1.0 1.0 1 1
19.1 1 1.1 1.1 1.21
19.5 which1.5
1.5 an unbiased estimator of variance. Compare this value S2 with S2 which
is an2.25
1
we stated earlier, they are related by the expression
20 1 2 2 4.00
11 2.5 16.39
S

(n-r)

n — 1 in the denominator is the number of degrees of freedom, symbolised as v. This is


n
because if the deviations are measured from x, there is one term ^(x* — x) = 0 from
i
n—observations so that we remain with (n — 1) terms which we can independently vary.
For large n, the error is so small and negligible when we use S 2 instead of S2 to estimate
the variance.
Activity E6

Example 9.3.1

The ages of 11 boys in the school team were recorded in years as


16,17.8,19.1,18.0,18.6,16.5,19.0,17.2,18.8,19.5, 20. Determine the estimates for the
mean and standard deviation of the ages of all the boys in the school if the school team
can be used as a sample.

188
The unbiased estimate for is x = 18. 2 years
The unbiased estimate for J2 is
n
A2 = n — 1S2

11
Using an assumed mean = x 15.82181818
A =1018.0

= 17.404
Efd
x
S= 4.171810159 A+
Ef
4. 172 years.
2.5
80
'

= 18.2272727272727273
18.2
V
(f 2
and S2
Ef

16.39 /2.5\2
ET " V
180.29 - 6.25
121
174.04
11

= 15.8218181818

Example 9.3.2
A sample of eight measurements of heights of men aged thirty years, in metres, was as
follows
1.5,1.7,1.6,1.7,1.8,1.5,1.6. Determine the estimates for the mean and standard devi-
ation for the men aged thirty years.
Solution:

189
Using an assumed mean A = 1.6

x 1.6 + 03

= 1.6375
The unbiased estimate of p = x = 1.6375 and

0.09 /0.3\2
S2

0.01125 - 0.00140625
0.00984375
The unbiased estimate of 62 is

n 8
S2 = -----------S2 = - x 0.00984375
n-1 7
= 0.01125.

9.4 The Central Limit Theorem

As the sample size n is increased without limit, the shape of the distribution of the
sample mean taken with replacement from a population (normal or not) with mean p
and standard deviation 6 will approach a normal distribution. The distribution will
have a mean p and standard deviation 6/y/n.

9.5 Confidence intervals

Using data from a random sample, we find an interval within which the estimate of the
parameter should lie with a certain degree of confidence (probability). The interval is
called a confidence interval while its upper and lower values are called confidence limits.
If x is the mean of a random sample of size n taken from a normal population with
mean p and variance 6, where 6 is known, then the symmetric C% confidence interval
for p is given by

190
There are two cases to consider under confidence intervals. These are when 6 is known
or 6 is not known.
Activity E5
Case 1 (6 known)

Example 9.5.1

It is known that the standard deviation of the ages in years of students at a polytechnic
is 3 years. A sample of 49 selected students revealed a mean age of 22 years. Find the
95% confidence interval for the population mean.
Solution:
100(1 - 2a)% 95
1 - 2a 0.95
2a 0.05
a 0.025
Z0.025 =1.96

Hence the 95% confidence interval is given by

Z6 1.96 x 3
x ± —=. 22
n —49

5.88
22
~T~

= 22 ± 0.84
= 21.16, 22.84
21.16 < < 22.84

We can say with 95% confidence that the average age of students at the polytechnic
lies between 21.16 years and 22.84 years.

Example 9.5.2

191
A survey of 30 families revealed that the mean age of the children in the family is 5
years with a standard deviation of 0.5 years. Find the 99% confidence interval for the
mean age of children in a family.
Solution:

100(1 - 2a)% 99
1 - 2a 0.99
2a 0.01
a 0.005
Z0.005 =
2.58
The interval is given by

x±Za r, 2.58 x 0.5


y/ 5 ±------—
n y/30
= 5± 0.235520699
- 5 ± 0.2355
- 4.7645, 5.2355

The interval is 4.7645 < < 5.2355 - 4.765 < < 5.236.

Example 9.5.3
The following data represents a sample of the assets in millions of shillings of 32 families
in Kasese town. Find the 90% confidence interval for the mean value of assets.
12, 3, 13, 73, 11, 9, 8, 40, 5, 2, 17, 4, 9, 2, 7, 3,
5, 3, 1, 13, 3, 15, 22, 17, 18, 1, 15, 3, 19, 20, 50, 31.
Solution:
From the data X = 14.1875 and S = 15.60073923
Since n > 30, we shall still use the z tables

100(1 - 2a)% = 90
1 - 2a = 0.9
2a = 0.1
a = 0.05
Za = Zo.05 = 1.645

The interval is given by

x Z
± a
/

192
1.645 x 15.60073923
= 14.1875 ±
32
= 14.1875 ± 4.536658521
= [9.65,18.72]

Example 9.5.4

A sample of the reading scores of 36 fourth graders has a mean of 80 and standard
deviation 16.
(i) Find the 95% confidence interval of the mean reading scores of all fourth graders.
(ii) Find a 99% confidence interval of the mean reading scores of all fourth graders.
Solution:

Here n = 36, i = 80 and 8 = 16.

(i) For 95% confidence interval

100(1 - 2a)% 95
1 - 2a 0.95
2a 0.05
a 0.025
Z
a Z0.025 =1.96

The interval is given by

x ± Z ~^=n 16 x 1.96
80 ±------«-----
6
74.773, 85.227
74.77 < < 85.23

(ii) For 99% confidence interval

100(1 - 2a)% 99
1 - 2a 0.99
2a 0.01
a 0.005
Z0.005 =
2.58
193
S
\/n — 1

The interval is given by

5 16
X ± Z= 80 ± 2.58 x —
6

(73.12, 86.88)
73.12 < < 86.88.
Case 2:(5 Unknown).
When 5 is known and the variable is normally distributed or when 5 is unknown but
n > 30, the standard normal distribution is used to find confidence intervals for the
mean. But in real life the population standard deviation may not be known when the
sample n < 30. In such a case, the sample standard deviation is used to find the
confidence intervals and we use a different distribution, the student’s t— distribution.
This distribution was discovered by W.S Gosset in 1908 while he was employed by a
brewing firm. He published it under the pseudonym student; hence it is called the
student’s t— distribution.
Like the normal distribution, the students t-distribution is bell shaped, symmetric about
the mean and its mean, median and mode are equal to zero located at the centre of the
distribution. It never touches the x-axis.
The difference between it and the standard normal distribution is that the variance
is greater than 1, it is a family of curves based on the concept of degrees of freedom
which is related to sample size and as the sample size n is increased, the t-distribution
approaches the standard normal distribution.
The formula for finding a confidence interval is

x±t a

Activity F1
Example 9.5.5
The masses in grams of twelve ball bearings taken from a batch at a manufacturing plant
were: 20, 23,19, 21, 24, 25, 27, 22, 25, 23, 21,18. Calculate a 95% confidence interval for
the mean mass of the population, assumed to be normal.
Solution:
From calculator, X = 22.33 S = 2.674
For 95% confidence interval
100(1 — 2a) = 95%
1 — 2a = 0.95
2a = 0.05
a = 0.025

194
The interval is given by

S
X ± ta —.
Vn—1
2.201 x 2.6742
22.33 ±--------=---------

22.33 ± 1.77467
[20.55533, 24.10467]
r-j 20.6 < i < 24.1

Example 9.5.6
The heights of 15 bean stalks are found to have a mean of 10cm and a standard deviation
of 0.8cm. Find 99% confidence limits for the population mean.
Solution:
n = 15, x = 10, S = 0.8,V = n — 1 = 14
For 99% confidence limits,
100(1 - 2a) 99
1 - 2a 0.99
2a 0.01
a 0.005
to.005 =
ta
2.977
The limits are given by

S = 10±2-97% 08
X ± ta----
Vn—1
10 ± 0.6365
[9.365,10.6365]
[9.4,10.6].

Example 9.5.7
A random sample of egges taken from a days production of Muhindo’s farm had the
following masses in grams 52, 58, 53, 54,51,55, 57, 56, 52, 54. Assuming the weights are
normally distributed, find 98% confidence limits for the mean mass of the eggs provided
that day.
Solution:
n =10 => V = n — 1 = 9.

195
S
/n — 1

From calculator, x = 54.2 and S = 2.299758441


For 98% confidence limits

100(1 - 2a) 98
1 - 2a 0.98
2a 0.98
a 0.01
ta [Link] = 2.821

The limits are given by

54.2 2.821 2.299758


x±t a

= 54.2 ± 2.162539
= 52.037461,56.362539
= [53.04,56.36]

Confidence interval for a proportion


The probability that a certain member of the population has an attribute is p and if x
is the number of members in the population who have this attribute in a sample of size
n then P = x so that
n

x
E p
( ) = E (-)

= -E (x)
n

But one has the attributes or not. So it is a binomial situation. But for a binomial
distribution B(n,p), E(x)=np and variance is npq. This shows that

E (P) — • np = p and
n

Var(P) Var(x)
n

—Var(x)
n2

196
but the variance of binomial distribution is npq where q =1 — p

Var(P) = — • np(1 — p)
n2
1
= -p(1 — p).
n

When n is large the sampling distribution of x tends to a normal distribution. The


sampling distribution of the proportion p tends to a normal distribution with mean p
and standard deviation n (1 — p) which is the standard error of the proportion We
use the standard normal distribution Z to find a confidence interval for the proportion.
Activity F2
Example 9.5.8
An opinion poll taken from the electorate indicated that 40 out of 100 would vote for
candidate A. What is the 98% confidence interval for the proportion of the population
who will vote for candidate A. If there are only two candidates, what advice would you
give candidate A?
P=A
n 100 400 0.4

For 98% confidence interval


100(1 — 2a) 98
1 — 2a 0.98
2a 0.02
a 0.01
Z0.01 =
2.33
The confidence limits are given by

^p(1 — P)
P ± Za = 0.4 ± 2.33
n V 100
= 0.4 ± 0.114
= [0.286,0.514]
- [0.29,0.51]
= 0.29 < P < 0.51
Advice: A should drop out of the race because he cannot win or else change the
compaign strategy.

197
Example 9.5.9
In a random sample of 120 airport workers, 48 have been vaccinated against swine
flu. Calculated 95% confidence limits for the proportion of workers that have been
vaccinated against swine flu.
Solution:
n = 120,p = = 0.4. The Z-value is 1.96.
The confidence interval is given by

/0.4 x 0.6\
0.4 1.96
k 120 )

= 0.4 ± 0.08765
= (0.31235,0.48765)
- (0.31,0.49)
Example 9.5.10
A sample of 400 nursing students included 100 men
(a) Find the 95% confidence interval for the true proportion of men who are studying
nursing
(b) How large should the sample have been to reduce the confidence interval to 2%?
Solution:
(a) n = 400,P = 100 = 0.25
For 95% confidence interval, Z = 1.96
The interval is given by

/p(1 - p) 10.25 x 0.75


P ± Za\^----------= 0.25 ± 1.96%-----------------------
Vn V 400
= 0.25 ± 0.0424
= [0.2076,0.2924]
0.2076 < P < 0.2924

(b) The confidence limits required are 0.25 ± 0.01 giving

^0.25 x 0.75
1.96 0.01
n
0.7203 = 0.0001n
n = 7203
The sample should have been 7203 nursing students.

198
Exercise 9

199
Chapter 10

SIGNIFICANCE TESTING

10.1 SETTING UP A HYPOTHESIS

In almost all situations, decisions are taken basing on the prevailing situation at the
time the decision is going to be made. Hypotheses are assumptions about a parameter
of the population. We test hypotheses to assess their correctness.
A cook claims she can tell whether onions or tomatoes were put in the frying pan first.
She performs a series of trials to test her claim. Sauce is presented to her in two different
bowls. The two bowls are randomly presented and she has to identify the bowl which
has sauce where the tomatoes were put first. If she is correct four times out of five, is
it right to accept her claim?
This is a binomial situation where correct identification can be said to be success and
incorrect identification can be said to be “failure”. In this case n = 5,p = 2,q = 2.
Hypotheses always come in pairs i.e the null hypothesis and the alternative hypothesis.
In our estimation we have a binomial model. So the null hypothesis is Ho : p = 1 and
the alternative hypothesis is Hi : p > 1. The hypothesis that is being tested is the null
hypothesis.
Example 10.1.1
A coin is tossed fifteen times and heads showed up four times. is there evidence at 1%
level of significance that the coin is biased?
Solution:
Assume that the coin is not biased. This is a binomial model.

Ho : P =0 -
2
Hi : P 1= -
2

Should the null hypothesis be true, then the number of heads X is binomially distributed
as X ~ B(15, 2). A high number or a low number of heads will lead to rejection of the

200
null hypothesis.
We thus solve for
P (X < 4 or X > 11)
P(X < 4) = 0.0592 (from tables)
P(X > 11) = 0.0592
P(X > 11) + P(X < 4) = 0.0592 + 0.0592
= 0.1184 = 11.84%
Since 11.84% > 1%, the result is not significant at 1% level. We retain the null hypoth-
esis that there is no evidence at 1% level of significance that the coin is biased.

Type I and Type II errors:


When a null hypothesis is tested by application of a significance test on a sample, we may
not be sure that we have made a correct conclusion. Therefore a type I error is made if a
null hypothesis is retained when infact it should be rejected. The probability of making
a type I error is equal to the signicance level of the test. Type II error is calculated if
a particular value of the parameter is specified for the alternative hypothesis.

Tests on the mean of a normal distribution (d known)


Activity G1
Example 10.1.2
A carpenter is told to produce wooden rods whose lengths are normally distributed
with = 100cm and 6 = 4cm. To check on his accuracy a sample of 10 rods is taken
and the mean length was found to be 101cm. Is the carpenter accurate at 5% level of
significance?
Solution:
The model is normal
H0 : = 100cm, 6 = 4
Hi : = 100cm
The sampling distribution for the sample mean x of a sample of 10 rods is normally
distributed with = 100cm, standard deviation = -^= = -^~= = 1.2649
For the observed sample mean 101 we have

Z = (101 - 100) = 0.790569415 - 0.79


1.2649

This is a two picked tailed. Therefore.


P(Z < -0.79) + P(Z > 0.79) = 2P(Z > 0.79)
= 2 x 0.2148
= 0.4296 = 42.96%
201
Since 42.96% > 5% there is no evidence that the carpenter is innacurate. We retain
Ho.
NB: We could have done this using the critical region instead of calculating the proba-
bility as we shall do in the next example.
Example 10.1.3
Grain millers claim that the average weight of a bag of maize flour is 80kg. If a random
sample of 100 bags had a mean of 79kg and standard deviation of 4kg test whether the
average weight of the bags is less than 80kg at 5% level of significance.
Solution:
The model is normal
Ho : = 80kg, 6 = 4
Hi : < 80kg

The Z-value which leaves an are of 5% to the left is -1.645


Using the sample

Z= = -2.5
4^%00

-2.5 is in the rejection region so we reject the null hypothesis, i.e. we accept the
alternative hypothesis that the average weight of bags is less than 80kg.
Example 10.1.4
The average mark in an examination at kilembe secondary school is 58% with a standard
deviation of 2%. Is there reason to believe that there has been a change in performance
if a random sample of 40 students has an average of 60%? Test this clan at 2% level of
signinance.
Solution:
Ho : = 58
Hi : = 58
This is a two tailed test i.e. there is an area of 1% at either tail.

202
The Z value which haves an area of 1% at a either tail is 2.33.
Evaluating the sample

Z = (x - h) 60- 58
= 6.3245

Since 6.3245 is greater than 2.33, we reject H0 and conclude that there is a significant
change in performance of students at 2% level of significance.

Tests for large samples (d unknown)


Should 4 be unknown when the sample is large, the test statistic Z is used with 4
replaced by S so that Z = ,x—_ 1

Activity G2
Example 10.1.5
80 80
Eighty measurements of a variate gave E xi = 200 and E x1 2
= 625. Test at 5% level
i=1 i=1
of significance if these measurements are from a population with mean greater than 1. 8.
Solution:

Exi
Sample mean
n

— = 2.5
80
T m'}
Sample s.d

1
625
80

203
Marks 20 — 24 25 — 29 30 — 34 35 — 39 40 — 44
Frequency 8 10 18 7 12
Classes f x fx x2 fx2
20 — 24 8 22176 484 3872
25 — 29 10 27270 729 7290
30 — 34 18 32576 1024 18432 = 1.25
35 — 39 7 37259 1369 9583 H0 : = 1.8
40 — 44 12 42504 1764 21168 Hi : > 1.8
55 1785 60345
x—
S/ /n — 1

2.5 — 1.8

The Z—value which leaves an area of 0.05 to the right is 1.645.


Since 4.98 > 1.645, we reject H0 and conclude that the population mean is greater than
1.8 at 5% level of significance.
Example 10.1.6
The sample of marks in a test were distributed as below

Find the mean and variance of the marks.


The mean mark for the whole district is 30. Test whether the mean mark for the school
differs significantly from the district mean at 5% level of significance.
Solution:

204
Efx 1785
Mean
f 55

32.45

1
Efx2 22
Standard Deviation
Ef (f)

60345 /1785\2 2
_55 EE )

V43.88429753 ~ 6.6245
~ 6.62
H0 : 30 and Hi 30
This is a two-tailed test

The Z—value which leaves an area of 0.025 at either tail is 1.96.

x — p, 32.45 30
0.0504
S/y/n — 1 6.6W24

Since 0.0504 < 1.96, we accept H0 that the performance of the school does not differ
from that of the distric in general.

10.2 Tests for small samples (5 unknown)

For small samples from normal populations, the test statistic is t g/--

205
So t = x—
s\/n — 1
104.3 —
102
x— Activity G3
Example 10.2.1 S/Vn — 1
A teacher claims that his students have an average I.Q of 102. To check his claim a
sample of 10 students were found to have the following [Link]. 98, 95, 106, 120, 110,
105, 96, 108, 115, 90. Does this evidence support his claim? test it at 5% level of
significance.
Solution:
Assume that the I.Q s are normally distributed. So
Ho : = 102
Hi : //. = 102 .
this is a two tailed test.
From the t-tables, the critical value tg = 2.262
From the sample X = 104.3 and s.d = 9.000555538 ~ 9

= 0.7666666 ... ~ 0.767


since 0.767 < 2.262, we accept H0, that the average I.Q of his students is 102.
Example 10.2.2
A shopkeeper claims that the average weight of a bar of soap is 700g. A sample of 8
bars gave the following weights.
698, 701, 699, 704, 708, 695, 697, 702. Is there evidence at 5% level of significance that
the bars of soap are under weight?
Solution:
Assume that the weights are normally distributed
Ho : = 700
Hi : < 700
This is a one tailed text.
From tables, t = 1.895
From the sample X = 700.5 and sd = 3.905

700.5 700
3.

= 0.338753742 ~ 0.339

206
Since 0.339 < 1.895 we accept Ho that the bars are not underweight.
Alternative answer

S.d = 4.174754056
t = 700.5 - 700
= 4.174754056/^7

= 0.31687511
0.317

10.2.1 Tests for the Difference between two means for large
samples.
If large samples are taken from a population, the distribution of x, the sample mean
will be normal.
If two samples are taken from a large population and we are required to find if the
means are significantly different, then the test statistic will be

(xi - X2) - (^1 - ^2)


Z

If 41 and 42 are unknown and the samples are large then

x1 - x2
Z=
§2 + S22
ni «2
—1

Example 10.2.3
An examination is taken by 400 men and 150 women.
The mean mark for men is 60 with a standard deviation of 3 while for women, the mean
mark is 64 with a standard deviation of 5.
Test at 5% level of significance if the difference between the means is significant.
Solution:
Assume a normal distribution

Ho : ^1 = ^2 ^1 - ^2 = 0
H1 : ^1 = /v

207
x1 — X2
(A2
\ni n2 J
60 — 64
( 32 I 52 \ 2
\400 + 150 7
The test statistic is

—4
7®)

-9.19682
This is a two tailed test. The Z—value which leaves an area of 0.025 at either tail is
1.96.
Since 9.19682 > 1.96 we reject H0. There is a significant difference between the means
of men and women.

10.2.2 Testing if two samples are from the same population


If the two samples are from the same population X 1 — X2 should not differ significantly
from zero.
Now our null hypothesis is that 41 = 42 and the standard deviation of X1 — X2 then is

- + “}
4 n n2 J

If 4 is known we use the test statistic

X1 — X2
Z
= i
4f2
t ni n2 J

However, if 4 is unknown and S1 and S2 are the standard deviations of the two samples,
the unbiased estimate of the standard deviation of the population is

f n1Sl + n2S2 |2
[ n.1 + n.2 — 2 J

where n1 + n2 — 2 is the number of degrees of freedom.


In this case, the test statistic is

208
x1 — x2
S 2
ni si+n2 2 A A + 1
ni +n2-2 J yni n2 J J
60 — 57
2 7
. { . + 15}2

t ni+n2-2

If the populations are normal and/or the samples are large.


Activity G5

Example 10.2.4

A test was administered to two groups of students picked from the senior three class.
The first group had 20 students who had an average of 60% with a standard deviation
of 3% while the second group had 15 students had an average of 57% with a standard
deviation of 2%. Test at 5% level of signicance if the two groups of students were of
the same ability.
Solution:
Ho : ^1 — ^2, ^1 — $2 — $
H1 : Samples from different ability students

x1 — 60 x2 — 57
S1 — 3 S2 — 2
n1 — 20 n2 — 15

The unbiased estimate of standard deviation is

f
20 x 32 + 15 x 22 ) 2 1
[ 20+15 — 2 J /240\ 2
)
2.69679945
r-j 2.7

t33

3.253

This is significant at 5% level so Ho is rejected.


The students in the two groups are not of the same ability. NB: We use interpolation
to read t33 from tables.

Example 10.2.5

209
Below is a list of marks obtained in a chemistry practical exam by groups A and B.
A : 50, 38, 72, 42, 28, 64, 78, 47, 37, 51, and 44
B : 59, 50, 64, 68, 58, 48, 59, 54, 46, 51, and 65
Test the teacher’s claim at 5% level of significance that the students in the two groups
have the same ability.
Solution:
From the data
XA= 50.09 XB = 56.54
SA = 15.4 SB = 7.33
nA = 11 nB = 11
H :
0 fiA = fiB
Hi : fiA = fiB

The pooled variance

(nA - 1)SA + (nB - 1)SB


S2
nA + nB - 2
= (11 - 1)(15.4)2 + (11 - 1)(7.33)2
= 11 + 11 - 2
= 2371.6 + 537.289
= 20
= 145.4
The test statistic t is given by

50.09 - 56.54
1
11+11-2 = ----------------------------1
{(145.4)( 11 +£)}2
= -6.45
= 5.142416305
t20 = -1.254274181 ~ -1.254
|t2o| = 1.254
From tables, t20 = 2.086. Because 1.254 < 2.086, we retain the null hypothesis that the
students of the two groups have the same ability.

Tests for a proportion (large samples)


Here we consider a variable which is binomially distributed and n is large so that a
normal approximation is utilised.

210
Ho : p =0.4
Hi : p >0.4
P =np = 100 x 0.4 = 40
4 =y/npq = V100 x 0.4 x 0.6 = -%24
Activity G6
Z =x — p
4
Example 10.2.6
50 — 40 National Examinations Board stated that 40% of the candidates pass Math-
Uganda
^24 with atleast a credit. A teacher from Kilembe Secondary school claims that
ematics
his students perform better than the national average because of 100 candidates he
= 2.041
presented to UNEB, 50 got atleast a credit. Is his calim justified? Test at 5% level of
significance.
Solution: The model is binomial approximated by a normal one. This is a one tailed

The value of Z is significant at 5% level since 2.041 > 1.645. The teachers claim is
justified.

Tests for Difference between two proportions (large)


Example 10.2.7

In a sample of 1000 people from Muhanga district. There are 520 men of whom 300 are
alcoholics and 480 women of whom 200 are alcoholics. Is there evidence at 5% level of
significance that the men in the district are more likely to take alcohol than women?

211
Solution:
Let Pi = probability that a man takes alcohol
P2 = probability that a woman takes alcohol

Ho : Pi = P2 = p
Hi : pi > P2

This is a one-tailed test. The numbers of alcoholics are binomially distributed. The
best estimate for p is

number of alcoholics 300 + 200


P =---------i-------------i— =---------------= 0.5
number in sample 1000

P = q = 0.5
The observed proportion of men who take alcohol Pi has S.d^/(pq/ni) where ni is
the number of men in the sample and for women P 2 has S.d^/(pq/n2) where n2 is the
number of women in the sample.
Thus Pi — P2 has s.d 5i-2 given by

(- + T) 1
\ni n2)
^i-2 2

Using an estimate of p = 0.5 the estimate of the pooled standard deviation is

(0.5 x 0.5 f— + — W
[ \520 480/J
Si-2

= 0.031648105
- 0.03165

From Ho, the mean value of Pi — P2 is 0. The observed value is 5000 — 20 25 =


0.1602541 0.1603 0 i56
But n is large. So we use the Z test statistic

Z 0.1603 — 0
= 0.03165
= 5.064770932 - 5.065

The value is significant since 5.065 > 1.645. So we reject H 0 and conclude that the men
are more likely to take alcohol than women in the district.

212
Ho : A = 8
Hi : A < 8

and P (X = x) Ax e~x
x!
P(X10.2.3
< 2)= P (xTests
= 0) +using the
P (x = 1)Poisson
+ P (x =distribution
2)
Example 10.2.8 8 2 -8
8 8, 8 e
e
The number of+faults
= + 1! 2! in a square metre of dyed cloth has been 8. A new dying machine
has been installed and+the
= 0.00033546 faults per+ metre
0.002683 are now 2. Is this evidence that the new
0.010734804
machine is better than-the
= 0.013753964 old one?
1.375% < 5%Test at 5% level of significance.
Solution: This is a Poisson model

The result is significant at 5% level. We reject the null hypothesis and conclude that
the new machine is better that than the old one.

Exercise 10

1. Scales are set to weigh packets of wheat flour of 500g each. To find out about the
accuracy of the scales, a sample of 12 packets is taken and the mean weight was
found to be 502 with a standard deviation of 4kg. Assuming that the standard
deviation is constant, test at the 5% level of significance if the scales are correctly
set.
2. A maize miller claims that his sacks are each 60kg. A sample of 50 bags was taken
and it was found to have a mean of 59kg with a standard deviation of 4kg. Is
there evidence at 5% level of significance that the weights of the bags are actually
less than 60kg?
3. The figures below were weighings of packets of omo in grams
60, 58, 67, 48, 72, 55, 62, 70, 58, 74
45, 56, 66, 47, 71, 64, 68, 52, 69, 61.
Could they have come from a population whose mean is 60g. Test it at 5% level
of signicance.

213
4. A bottling company sets its machine to fill bottles of 500ml of water. A sample
of 100 bottles is checked and the mean quantity is found to be 496mls with a
sample standard deviation of 10mls. Does this differ significantly from 500mls at
2% level of significance?
5. A manufacturer claims that his wax candles burn on average for 180 minutes. To
check this claim, an officer from the bureau of standards observed the burning
of 8 candles and found that they burn for the following minutes. 170, 178, 185,
182, 190, 173, 176, 181. Does this evidence support the manufactures claim at
5% level of significance?
6. The lives of light bulbs are normally distributed. If ten of them burnt for the
following hours 1200, 1210, 1280, 990, 1100, 1190, 1250, 1050, 1150, 1170, estimate
the population mean and show that variance is 8032 hours. The manufacture
claims that his bulbs have a life span of 1200 hours. Test his claim at 5% level of
significance.
7. There are 600 men and 800 women in a church. The mean number of days per
year in which a man fasted was 6.5 with a standard deviation of 2.8 and for the
women the corresponding figures were 7.2 and 3.1. Test at 5% level of significance
if the difference between the means is significant.
8. In a random sample 600 people, there are 350 men and 250 women. 190 men are
left handed while 150 women are left handed. Is there evidence at 5% level of
signicance that the men in this community are more likely to be left handed than
women?
9. A learner typist was making 6 mistakes per page. After a long practice, he reduces
his mistakes to one per page. Is this evidence at 5% level of significance that he
has improved?

214
Chapter 11

THE CHI-SQUARED TEST

Here we utilise the x2-distribution where the observed frequencies 0, are compared with
(0
the expected frequencies E. The statistic x2 is given by V —E) . This distribution
is a function of v, the number of degrees of freedom. For a specific value of v, the x2
distribution is denoted by \ 2V •

The x2 distribution is tabulated as percentage points. A percentage point is that value


of x2 which has a specified percentage of the distribution lying to its right.

11.1 Calculation of %2

As an illustration, suppose we toss three coins one hundred and twenty times. Let our
interest be in the number of tails obtained. We assume that the coins are fair. This is
a binomial situation with n = 3 and p = 1.
The observed frequencies compared with the expected frequencies are tabulated in the
table thus:

No. of tails Observed frequency Expected frequency


120
*f0 (1 )3 =15
0 14 120
* f 1) (1) (1 )2 = 45
120
* f J ] (2)’ (2)2 = 45
1 40 120
4 O (2)2 = 15
2 48

3 18

Let the observed frequencies be O» and the expected frequencies be E^, the results above
are put in the table below.

215
Oi Ei Oi - Ei (Oi - Ei)2 (Oi-Ei)2
14 15 -1 1 1 Ei
40 45 -5 25 15
25
48 45 -3 9 45
9
18 15 3 9 45
_9_
15
149 = 1.4222
0 1 2 3 4
22 50 58 42 28

There are four classes so the degrees of freedom in this case is v = 3. The total frequency
in this case should equal 120.

11.2 Goodness of fit

. The x2 distribution is used to test the goodness of fit of a given table of observed
frequencies to a theoretical model.
The x2-test is applicable if total frequency is not less than 50 and each class has a
minimum frequency of 5. In case where the class frequency is less than 5, then that
class should be combined with one nearest to it.

Example 11.2.1
Four identical coins were tossed 200 times and the observed frequencies of the number
of tails per toss is shown in the following table.

No. of tails
Observed frequency

Test at the 5% level if the coins are biased.


Solution:
Let Ho : P (T) = 2, H : P (T) = 1

No. of tails Observed freq Expected freq


22 200
x f0) (1)0 (2)4 = 12.5
0
50 200 x f 1 ) (1)1 ()3 =50
58 200 x f 2 ) (1 )2 (1 )2 = 75
1 42 200
x f 3 )(1 )3 (1)‘ = 50
28 200
2 x( 4 (1)‘ (1 )0 = 12.5

216
Oi Ei Oi - Ei (Oi - Ei)2 (Oi - Ei)2/Ei
22 12.5 9.5 90.25 7.22
50 50 0 0 0
58 75 -17 289 3.853333
42 50 -8 64 1.28
12.5 Th15.5 240.25 19.22
28
en 31.573333
Change inx mass Observ freq
x < x <is— 5 08
-5 < ca
x<0 06
lc
0<x<5 10
ul
5 < x < 10 29
10 < xat< 15 17
ed
15 < x < 20 08
th
20 < x < 25 15
25 < xus< oo 7
.
2 (O - E)2
X > ~----------= 31.57333...
E

There are five classes so that x2est = 31.573 against X2%(4) = 9.49
Since Xtest = 31.573 > 9.49 this is significant so reject H0, i.e. the coins are not fair.
They are biased.
Example 11.2.2
For a period of thirty days 100 babies in a babies home were given a new type of food
and the table below shows the recorded changes in their masses (in grams)

It is thought that these data follow a normal distribution with mean 5 and standard
deviation 8. Use the x2 distribution at the 5% level of significance to test this hypothesis.
How would the test be modified if the mean and standard deviation were unknown.
Solution:
Let the random variable X be “change in mass over thirty days”.
Ho : X is N(5, 82)
Hi : X is not N(5, 82)
The expected frequencies for the given class interval is calculated in tabular form below.
If X is N(5, 82) then the standard variable is Z = x-2.

217
Class observed upper standard upper Q(z) class Expected class
frequency class Bound class bound probability frequency
-2 < x < -5 8 -5 -1.25 0.1056 0.1056 10.56
-5 < x < 0 6 0 -0.625 0.2660 0.1604 16.04
0<x<5 10 5 0 0.5000 0.2340 23.4
5 < x < 10 29 10 0.625 0.7340 0.2340 23.4
10 < x < 15 17 15 1.25 0.8944 0.1604 16.04
15 < x < 20 8 20 1.875 0.9697 0.0753 7.53
20 < x < 25 15 25 2.5 0.9938 0.0241 2.41
25 < x < x 7 x x 1.0000 0.0062 0.62
0 8 6 10 29 17 8 15 7
E 10.56 16.04 23.4 23.416.04 7.53 2.41 0.62
O-E -2.56 -10.4 -13.4 5.6 0.96 0.47 12.59 6.38
2
(O-E) 0.621 6.284 7.674 1.340.0574 0.0293 65.771 65.652
E

This
gives
rise to
the
followi
ng table
of
observe
d and
expecte (O - E)2
d X
test = E 147.4287
E
frequen
cies.
We test this against x5%(7) = 14.07
Since \2 = 147.4287 > 14.07, we reject H0, i.e. the data does not follow a normal
distribution with mean 5 and standard deviation 8.
If the mean and standard deviation are not known, they are estimated from the given
data and then used to calculate the expected frequencies. There would be two degrees
of freedom less.
If a given distribution is said or thought to be a normal, poisson or binomial, do the
following to test the goodness of fit:
(i)
Calculate the expected frequencies E under the null hypothesis.
(ii)
Combine adjacent classes if one or some of them have frequencies less than 5
thereby also combining their frequencies.

(iii)
Calculate ('0~E for each of the classes.

(iv) (0-E)2
Calculate the statistc xtest = V
E

218
Number of heads 0 1 2 3 4 5
Observed frequency 12 40 56 60 2715

(v)
Determine the degrees of freedom v. This is n — 1 if p is known for a binomial
distribution but v = n — 2 if p has to be estimated using x = np. The same
case applies to the poisson distribution. For a normal distribution, if p and 6 are
known, v = n — 1 but if it has to be estimated, then v = n — 3.
(vi)
Find X^%(v) where a% is the level of significance under which the test is being
done.
(vii)
Ccmparmg Xtest with X2a%(v), if Xtest > Xa%(v)> reject the nuU hypothesis or else
accept it.

Example 11.2.3

Five identical coins were tossed 210 times and the observed frequencies of the
number of heads per toss was as shown in the table below:

Test 1% level of significance if the coins are biased.


Solution:
This is a binomial situation with n = 5 and p = 1. Let H 0:p= 1 and Hi : p = 1.
The observed frequencies compared with the expected frequencies are tabulated
below.

Let the observed frequencies be O and the expected frequencies, E, the above
results are put in the table below.

219
O E O-E (O - E)2 (O-E)2
12 6.5625 5.4375 29.56640625 E
4.505357143
40 32.8125 7.1875 51.66015625 1.574404762
56 65.625 -9.625 92.640625 1.411666667
60 65.625 -5.625 31.640625 0.482142857
2732.8125 -5.8125 33.78515625 1.029642857
15 6.5625 8.4375 71.19140625 10.84821429
1 2 3 4 5 6
20 30 18 7 6 4

2 (O - E )2
X > ~----------= 19.85142857 = 19.85
E

This is tested against X%(5) = 15.09. Since x2est > Xi%(5), we reject H0. That is,
the coins are biased so that p = 1.

Exercise 11

1. For a period of one year. 100 snakes in a zoo were given a new type of diet. The
table below shows the changes in mass (grams) recorded by the zoo attendant.

Change in mass(g) x Observed frequency


-20 < x < -15 8
-15 < x < -10 15
-10 < x < -5 4
5x 6
0x0 12
5< 15
x10< 10
10
x
15 9
x15
20 5
x 20
25
It is thought that these data follow a normal distribution with mean 5 and stan-
darddeviation 10. Use X2 the distribution at 10% level of significance to test this
hypothesis.

2. A
nalfe
ysi w
s yea
of rs No. of goals per match 0
thegiv No. of matches 15
goaes
ls the 220
scofoll
redow
pering
mares
tchults
by :
Find the mean of this distribution and the frequencies correct to two decimal
places associated with a Poisson distributin having the same mean. Use the
distribution at 2.5% level of significance to determine whether or not the above
distribution can reasonably be modeled by this Poisson distribution.
3. Three identical dice were tossed 80 times and the observed frequencies of the 1’s
showing up was as shown in the table below:

Number of 1’s 01 2 3
Observed frequency 20 26 20 14

Test at 5% level of significance if the dice are biased.

221
Chapter 12

CORRELATION AND
REGRESSION

Introduction

A population may have two variables and our concern in this chapter is to find out if
there is a relationship between the two variables i.e. we shall check if there is interde-
pendence or correlation between the two variables.
If the variables are plotted in the xy-plane, we get a scatter diagram
Example 12.0.4
Draw a scatter diagram for the following data:

x 2 3 5 6 8 9 10
y 4 7 9 8 10 13 12

+ + + + + +

Each point represents the values of two variables under consideration for a particular
set of sample.
Types of correlation:
- Positive Correlation: If y tends to increase as x increases, there is a positive
correlation.
- Negative Correlation: If y tends to decrease as x increases, there is a negative
correlation.
- Zero Correlation: If there is no relationship between x and y then there is zero
or no correlation

On scatter diagram above shows a positive correlation.

Measurement of correlation:
The scatter diagrams give a visual impression of correlation. If we have to quantify this
correlation then we have to evaluate statistically the two variables whose correlation
coefficient we need to determine.
The covariance of two variables X and Y, abbreviated as Cov(X,Y) is given by the
expression E(X-E)(Y — Ey) and if X and Y are independent Cov(X,Y)=0. If X and Y
are not independent Cov(X,Y)= 0
Generally,

Cov(X,Y) = E [(X — Ex )(Y — Ey)]


— E [XY yx Y yxX + yx yy ]
= E (XY) — yxE (Y) — yxE (X) + ExEy
— E (XY) ^xEy Ey ^x + Ex Ey
Cov(X,Y) = E (XY) — ExEy •
Conclusively, if X and Y are independent,
E(XY) = E(x)E(y) = yxyy, so that in this case

Cov(X,Y) = E (XY) — Ex Ey
— ExEy E E
xy
=0

The unbiased estimate of Cov(X,Y) is

1n
. 12(x*— x y— y)
n1
i

and it depends on the degree of correlation and spread of the values of X and of Y.
The correlation coefficient lies between 0 and 1 for a positive correlation or between -1

223
En(x — x)(y — y)
En (x—x)2 n (y—y)2

and 0 for a negative correlation.


Activity I2
Activity I3

If the unbiased estimate of covariance is divided by the unbiased estimates of standard


deviations of X and Y, we get the product moment correlation coefficient. (Pearsonian).

1n
Sx 52(x.—x) 4>
\b—1

1n
Sy —1
52 (y — y)2 J• Then
\b

(
r xS
x
— n

^
An- x
rOx; —E S
)^
x)^/ y(
r {nijsn y
(y. — (
»)} x
n n —
52x.2 — g n x.)2
But 52 (x. — x)2 — n
1 1 y
n )x
n (E n y.)2
Y— ) n
and
52^ — y)2 1 (
1
y
m(x — x)(y — y)
so that r — (S? Xi)21 fv y2 (ST yi-y21 ’
nJT n
y
n n ) n n n
52 x.y. — 52 xy. — 52 yx. + 52 xy
And also ^2 (x — x)(y — y) 1111
1
n n n n
52 x.y. — x 52 y. — y 52 x + 52 xx
1 111

224
n —
i xiyi - nxy_________
}{E? ? - " }
n /v^n v^n \ /
i xy- (Ei X'O.i yi) /n
n v^n v^n n
nn i xiyi - > , i x^ x—
yi y 22 x + nxy
x 2 3 5 6 8 10 22 xiyi - x 22 V i
i
11
y 4 7 9 8 10 12
n
but 22 V ny and
1

n
nx so that
1
n
n
22(x - x)(y - y) 22 xiyi - nxy + nxy
i i
n
22 xiyi - nxy
1

Hence r E
1
n

n --
E i Xiyi - nxy
^/{n E? x - (En xi)2 n2 /v^n
E y i2 - ( yi)

r E
1
nx? - EnE2] inEnyt - (En»)?]}2

r E
{( n2 /v^n \
E
n 2
E
Example 12.0.5 n
x?
For the data below, calculate the product
- moment correlation coefficient.
(E
n
xi
)2)

Solution:

225
x y x2 y2 xy
2 3 4 16 6
3 7 9 49 21
5 9 25 81 45
6 8 36 64 48
8 10 64 100 80
10 12 100 144 120
34 50 238 454 320

The product moment correlation coefficient is

__________n^2xy - ^2 __________
r
y'-! >>'2 - (£x2)] (n£y2 - (£y)2]}

6 x 320 - 34 x 50
V(6 x 238 - 342)(6 x 454 - 502)

1920 — 1700
V(1428 - 1150)(2724 - 2500)

232
, = 0.891280119
V272 x 224
r-j 0.8913
Example 12.0.6
The marks of candidates in maths and physics were given as;

Candidates A BCDE FGHI


Maths 58 51 36 87 76 45 42 49 83
Physics 70 64 55 81 33 45 73 66 91

Calculate the product moment correlation coefficient.


Solution:

226
x y x2 y2 xy
58 70 3364 4900 4060
51 64 2601 4096 3264
36 55 1296 3025 1980
87 81 7569 6561 7047
76 33 5776 1089 2508
45 45 2025 2025 2025
42 73 1764 5329 3066
49 66 2401 4356 3234
83 91 6889 8281 7553
527 578 33685 39662 34737
_ n^xy — ^ x^y
r=
y/{[n£x2 — (£xy2)] [n£y2 — (£y)2]}
9 x 34737 — 527 x 578
^{[9 x 33685 — (527)2] [9 x 39662 — (578)2]}
C
yy - 22
y2 — nyx2

- 0.3328

Another way of stating the product moment correlation coefficient is

Cxy
r
CxxCyy

where xy —
Cxy nxy
C
xx 2 —2
E x — nx

Try the example we have done using this other approach and find which will be easier
for you to remember when solving such problems.
ssss
activity I1
Interpretation of the magnitude correlation coefficient.

227
X Y Rx R
y D = Rx-Ry D2
62 60 4 5 1 1
78 72 1 1 0 0
59 66 5 3 2 4
67 64 3 4 -1 1
42 56 7 6 1 Correlation
1 coefficient Interpretation
54 48 6 7 -1 0-1< 0.2 Very low correlation
71 67 2 2 0 0.2-
0 < 0.4 Low correlation
0.4- < 0.6 6£ d2 Moderate correlation
0.6- < 0.8 n(n2 - 1) High correlation
0.8- 1.00 Very high correlation.

12.1 RANK CORRELATION

There are two ways of measuring correlation by ranks. These are by spearman and
kendall.

12.
1.1
Sp
In this case p =1-------,^2
ear 2n
~ d2 2 — 1)
n(n
ma
where d is the difference between the rankings of a given pair of scores and n is the
n’s
number of pairs.
ra
Example 12.1.1
nk
Two
cor examiners X and Y marked scripts of candidates who sat for an interview. They
gave
rel the following marks.
ati
on x 62 78 59 67 42 54 71
p y 60 72 66 64 56 48 67

Calculate the spearman’s correlation coefficient of p.


Solution:

228
M P R
m Rp D Rm R
p D2
50 35 7 10 -3 9
72 40 2 8 -6 36
43 60 8 3 5 25
61 53 5 5 0 0
80 55 1 4 -3 9 1 6x8
- 2
32 70 10 1 9 81 = 7(7 - 1)
66 38 4 9 -5 25
69 42 3 7 -4 16 = 0.857142857
54 63 6 2 4 16 - 0.857
40 48 9 6 3 9
Example 12.1.2
226
Below are marks scored by 10 students in a Maths and Physics examination.

M: 50 72 43 61 80 32 66 69 54 40
P: 35 40 60 53 55 70 38 42 63 48

Calculate the spearman’s rank correlation coefficient between the performance in Maths
and physics. Comment on the correlation.
Solution:

1 6E d
P = 1---------F5-----n
n(n2 — 1)

1 6 x 226

= 10 x 99
= —0.36969696969
- —0.3697.

There is a low negative correlation. Performance in one negatively affects performance


in the other.

229
A B CD E F G H
Rx 1 2 34 5 6 7 8
R
y 1
2 38 6.5 6.5 5 4

The pairing and scoring is done asfollows


12.1.2 Kendall’s Correlation Coefficient.
Kendall’s rank correlation coefficient (T) is given by

agreements -disagrements S
total number of pairs 2n(n _ 1)

where S is the sum of all the scores. The scores are obtained in the following way:
- the data is arranged in two rows where the first row is in ascending order.
- the data in the second row is arranged in accordance with that of the first row
- Give ranks to each of the rows
- Compare the adjacent scores of the two rows. If there is an increases or decrease
in both, allot+1. If different allot _1.

Example 12.1.3

Two examiners X and Y marked scripts of 8 candites and gave the following marks:

X 42 61 38 55 65 48 35 53
Y 45 54 46 51 72 45 49 41

Calculate Kendall’s correlation coefficient for the two examiners.


Solution:
We rank each of the marks for the examiners from highest to lowest. So the ranks are:

230
AB AC AD AEAF AGAH Score
1 1 1 1 1 -1 -1 =3
BC BD BE BF BG BH
1 1 1 1 -1 -1 =2
CD CE CF CG CN
1 1 1 -1 -1 =1
DEDF DGDH
1 1 -1 -1 =0
EF EG EH
1 -1 -1 =-1
FG FH
-1 -1 =-2
S
1 n(n - 1)

4
1(8)(7)
Candidate A B C D
Paper 1 92 80 71 89 GH
Paper 2 79 93 7385 1=1
4

Total score is 4 .'.S = 4

1
7 0.1429

Note 12.1.1

In case of the same marks the ranks are shared. In this case we had 45 and 45 so the
ranks 6 and 7 are shared between them so that each has a rank of 6.5
Example 12.1.4 In the two papers of an A-level maths examination, ten candidates
gained the following marks

E F G H I J
33 68 46 70
94 64 65 67 74

calculate

(a) the product moment correlation coefficient


(b) spearmans coefficient of rank correlation
Solution:

231
x x2 y y2 xy
92 8464 79 6241 7268
80 6400 93 8649 7440
71 5041 73 5329 5183
89 7921 85 7225 7565
81 6561 82 6724 6642
86 7396 94 8836 8084
33 1089 64(a) 4096 2112
68 4624 65 4225 4420
46 2116 67 4489 3082
70 4900 74 5476 5180
716 54512 776 61290 56976
X Y Rx R
yD = Rx-Ry D2
92 79 1 5 -4 16
80 93 5 2 3 9
71 73 6 7 -1 1
89 85 2 3 -1 1
81 82 4 4 0 0
86 94 3 1 2 4
33 64 10 10 0 0
68 65 8 9 -1 1
46 67 9 8 1 1
70 747 6 1 1

n^xy -^ x^y
r = —, =
y/{[n^2x - (£x)2][n£y2 - (£y)2]}
2

= 10 x 56976 - 716 x 776


= /{[10 x 54512 - 7162] [10 x 61290 - 7762]}

= 14144
= /{32464 x 10724}

= 0.758041234
- 0.758

(b)

34

232
D2
2
n(n — 1)
A B C D E F G H I J
Scale X 63 66 68 61 62 60 71 73 70 76
Scale Y 61 66 66 58 63 59 70 71 68 64
Scale Z 61 72 76 73 62 71 77 68 65 77
x y Rx R
y D Rx-Ry D2
63 61 7 8 -1 -1
66 66 6 4.5 1.5 2.25 p
68 66 5 4.5 0.5 0.25
61 58 9 10 -1 1
1 6 x 34
62 63 8 7 1 1 —
10 x 99
60 59 10 9 1 1
71 70 3 2 1 1 0.793939393
73 71 2 1 1 1 ~ 0.794
70 68 4 3 1 1
76 64 1 Example6 -512.1.5 25
34.5
Three weighing scales from different stalls X,Y,Z in Gitarama market were used to
weigh ten bags of maize A,B,C,..., J and the results in kilogrammes were as given in
the table below

Determine rank correlation coefficients for the performances of the scales.


(i) X and Y
(ii) Y and Z.
Which of the three scales X,Y and Z were in good working conditions.
Solution:
Using Spearman’s coefficient.
(i)

233
Y Z Ry Rz D=Ry-Rz D2
61 61 8 10 -2 4
66 72 4.5 5 -0.5 0.25
66 76 4.5 3 1.5 2.25
58 73 10 4 6 36
63 62 7 9 -2 4
59 71 9 6 3 9
70 77 2 1.5 0.5 0.25
6E D2
71 68 1 7 -6 36
n(n2 — 1)
68 65 3 8 -5 25
64 77 6 1.5 4.5 20.25 6 x 34.5
137 10 x 99

(i
i)

6£ D2 , 6 x 137
P = 1---------T~^----T = 1-------------
n(n2 — 1) 10 x 99

= 0.1697.

Scales X and Y were in good working condition due to a high correlation. If you
tried to check X and Z, you would get a coefficient of 0.385 which is still low.
NB: Try to do this question again using Kendall’s correlation coefficient. It will
be different but will give you the same conclusion. It takes a little more time.

12.2 REGRESSION

Regression is a statistical method used to find whether there is a relationship and


which type of relationship between two variables. The relationships may be positive or
negative, linear or non-linear.

234
x y x2 xy
40 120 1600 4800
48 110 2304 5280
55 130 3025 7150
60 140 3600 8400
66 142Normally
4356 9372 a scatter plot is made so that the general trend of the relation can be observed
70 150so4900 10,500
that ways of measuring the relationship are utilised. After a scatter plot is drawn,
339 792the
19785 45502
value the correlation coefficient if seen to be significant leads to the determination
of the equation of the regression line. The regression line is also called the line of best
fit. This line may be drawn by “eye” although the line drawn by “eye” can’t be reliable
enough. If the number of points above the line is equal to the number of points below
the line and the sums of the squares of the vertical distances from each point to the
line is at a minimum, such a line can be said to be of best fit.

12.2.1 Determination of the regression line Equation


The equation of the regression line is y' = a + bx where a is the y1 intercept and b is
the slope of the line where

(Ey)(Ex2) - (£x)(£xy)
n( x2) - ( x)2
E £

n(Exy) - (Ex)(Ey)
and n( x2) - ( x)2
E £
b

The mathematical derivation of the equation of the regression line is beyond the scope
of this book.

Example 12.2.1

Find the equation of the regression line for the data below and graph the line on the
scatter plot of the data.

x: 40 48 55 60 66 70
y: 120 110 130 140 142 150

Solut
ion:

235
(E y)( x2) - ( x)( xy)
n( x2) -
E (E x)2
792 x 19785 - 339 x 45502
6 x 19785 - 3392

= 64.53998416
~ 64.54
= n(£xy) - (£x)(£y)
n(E x2) - ( x)2
6 x 45502 - 339 x 792
= 6 x 19785 - 3392

1
The equation is y' .193982581 ~ 1.194.
y a + bx
64.54 + 1.194x

Example 12.2.2

The table below shows the percentage of sand, y in the soil at different depths x, in
metres.

Soil depth (x): 4.5 7.0 5.8 3.0 5.0 8.5 9.8 10.5
% of sand (y): 80 65 75 90 68 55 64 50

236
x y x2 xy
4.5 80 20.25 360
7.0 65 49.0 455
5.8 75 33.64 435
3.0 90 9.0 270
5.0 68 25.0 340
8.5 (i) Plot a
55 72.25 467.5 scatter diagram for the data. Comment on the relationship between soil
depth and the percentage of sand in the soil.
9.8 64 96.04 627.2
10.5 50 (ii)
110.25
Draw 525
a line of best fit through the points of the scatter diagram. Use your result
54.1 547415.43 3479.7
to estimate
(a) percentage of sand at a depth of 4m
(b) depth of the soil with 70% sand.
Solution:

Ther
e is
a
stro
ng
nega
tive
corr
elati
on

Using the table

a = 98.29927136 - 98.3
b = —4.425030885 ~ -4.43

237
y' = a + bx
y' = 98.3 - 4.43x

(a) when x = 4,y=80.58%


(b) when y = 70
Th 70 = 98.3 - 4.43x
e
lin x=6.388261851
e 6.39m
of
Examp >le 12.2.3
bes
t fit
is
giv
en
by

In two different competitions, schools A,B,C,... and H participated and their


performances in points are give in the table below

A B C D E F GH
Competition 1 56 47 50 51 43 49 52 54
Competition 2 59 49 58 60 52 51 56 57

(i) Plot the points on a scatter diagram of competition 2 against competition 1.


(ii) Draw a line of best fit through the plotted points on your scatter diagram.
Estimate how many points a school would have scored in competition 2 if it
had 48 points in competition 1
(iii) Calculate the pearsonian product moment correlation for the data.
(iv)
Solution:

238
y
x x xy
56 59 3136 3304
47 49 2209 2303
50 58 2500 2900
51 60 2601 3060
43 52 1849 2236
T
49 51 2401 2499
o
52 56 2704 2912
d
54 57 2916 3078 y2
r 3481
a 2401
w 3364
3600
a 2704
l 2601
i 3136
n 3249
e
o 402 442 20316 22292 24536
f
b The line of best fit is given by y' = a + bx where
e
s = (E y)(Ex2) - (E x)(E y)
t ™(E x2) - (E x)2
f
i 442 x 20316 - 402 x 442
t, = 8 x 201316 - (402)2
w
e = 19.79220779
l ~ 19.8
o
o n(Exy) - (Ex)(Ey)
k and b
n(E x2) - (E x)2
f
o 8 x 22292 - 402 x 442
r = 8 x 201316 - (402)2
t
h = 0.705627705
e ~ 0.706.
l
i y' = 19.8 + 0.706x
nwhich line is plotted on the scatter diagram.
eWhen x = 48,y = 53.688 ~ 54
y
(iii)' Pearsonian product moment correlation coefficent is given by
=
_________"Vxn - E xHy_______________
a y/\n £ x2 - (£ x)2][n £ y2 - (£ y)2]
+
8 x 2292 - 402 x 442 652
2 2
b [(8 x 20316 - (402) ] [8 x 24536 - (442) ] = ^924 x 924
x
239
= 0.705627705
~ 0.706

Example 12.2.4

The price of matoke is found to depend on the distance the market is away from
the nearest town. The table below gives the average price for the markets around
Kasese town.

Distance dkm 35 3 12 15 19 25 5 22 11
Price P shs 130 170 150 140 145 135 160 140 155

(i) Plot these data on a scatter diagram


(ii) Draw the line of best fit on your diagram
(iii) Find the equation of your line
(iv) Estimate the price of matoke when d =13

Let d = x and p = y

240
x y x2 xy
35 130 1225 4550
3 170 9 510
12 150 144 800
15 140 225 2100
19 145 361 2755
25 135 625 3375
5 160 25 800
22 140 484 3080
11 155 121 1705
147 1325 3219 20675

The line of best fit is y! = a + bx

(Ey)(Ex2) - (Ex)(Exy)
a
n(E x2) - (E x)2
1325 x 3219 - 147 x 20675
9 x 3219 - (147)2

166.5240424
r-j 166.5
n(
Ey) - (Ex)(Ey)
and b n(E x2) - (E x)2

9 x 20675 - 147 x 1325


9 x 3219 - (147)2

-1.181744091
r-j -1.182
y 166.5 1.182x

when d =13
y
166.5 -
1.182(13)
151.134
151

Activity H1
Exercise 12
1. For the data below, Calculate the product moment correlation coefficient

241
x 2 4 5 7 8 10
y 3 4 6 5 8 9
x 60 72 78 59 65 70 66
y 58 74 56 64 60 65 55

2. For the data given below calculate


(i) the product moment correlation coefficient
(ii) Spearman’s rank correlation coefficient

(iii) The table below shows the marks scored by eight students in Maths and Physics.

Maths 40 48 79 26 37 60 55 70
Physics 62 68 46 39 60 52 48 32

Calculate the Kendall’s rank correlation for the students performance in the two
subjects. Comment on your result.
3. The following table shows the marks scored by 10 students in English and Maths.
Calculate their product moment correlation coefficient.

English 40 28 30 31 22 29 25 40 36 20
Math 45 35 31 28 27 35 24 36 30 20

4. Find the equation of the regression line for the data below:

x: 10 12 4 2 8 6 14
y: 60 55 90 89 70 80 65

5. The table below shows the heights and weights to the nearest unit of ten men.

Height (cm) 140 150 151 145 155 145 148 153 148 148
Weight (kg) 61 69 70 66 73 64 66 74 69 68

(i) Plot the points on a scatter diagram


(ii) Draw a line of best fit
(iii) Estimate from the graph the height of a man who weighs 67kg.

(iv) The following marks were scored by students in English and Mathematics exam-
inations.

English: 73 51 42 64 38 55 47 36 51
Maths: 47 57 39 43 49 52 60 55 46

(i) Draw a scatter diagram and comment on the performance of students in the
two subjects
(ii) Calculate a rank correlation and comment on your results.

6. The cost of travelling a certain distance from the city centre depends on the route
and the distance a given place is away from the city centre. The table below
gives the average rates of travel charged for distances travelled away from the city
centre.

Distance,s(km) 5 8 10 17 20 26 29 41 42 46
Rates charged, r(shs) 500 750 900 950 1100 1000 1150 1500 1350 1750

(i) Plot the above data on a scatter diagram. Find and plot the line of best fit
on the scatter diagram.
(ii) Use your result to estimate the cost of travelling a distance of 36km.

7. A speed and error typing examination was give to 9 candidates. The table below
shows their speeds (y) in seconds and the number of errors in their typed scripts
(x).

No. of errors (x): 10 22 18 8 30 28 26 13 15


Speed in sec(y): 120 126 114 110 143 150 145 132 135

(i) Draw a scatter diagram of these data


(ii) Calculate the equation of the regression line of y on x and draw this line on
the scatter diagram
(iii) Calculate the product moment correlation coefficient.

243
Answers to Exercises

Exercise 1

1.

(b) 50.4
2. 1035.29
4
3.

(ii) 36
(iii) 36.17
4.
5. (i) (608.54444) (ii) (522.5)
6. (i) 7.70369643 (ii) (7.461009762)
7. 15.25, 15.056, 15.65
8.
(6.18)
9.
(1.185358255 - 1.185)
10.
(126.8)
11.
(26.6, 8.114)
12.
(i) 79.27 (ii) 11.09 (iii) 80.45 (iv) 8.55
13.
90, 93.75, 96.75, 98.75, 100, 101.25, 102.75, 103.75, 107.5
14.
72.8, 74.8, 76.8, 75.4, 73.0, 71.8, 71.2, 70.8
15.
187.5
16.
189.25, 190.25, 192, 193.25, 194.25, 196.25, 197, 198.5, 200.

Exercise 2
1.
2. (i) 4 (ii) 27
I
3.
120
4. 1
3
(i) 1 (ii) i0
244
x 0 1 2 3 4
P (x) 1 1 3 1 1
(ii) 2 16 8 16

(i) i = 0.025 (ii) 2.55,0.5475 (iii) 43 = 0.325


(i)9§ (U)218? (iii) 2.05599 3 3
5. (iv)
5
6. 2
(i) 99. (ii) 33 (ii) 95 (iv) i
3
7. (i) 35 (ii) 3150 (iii) J40. 1680 = 168
(ii)
9135 (iii) 9139 (iv) 91390
913
8. (i) & (ii) i (iii) 25
9. (i)
7 (ii) 5 (iii) 10
10.
11. (i) 3 (ii) (iii) 1 (iv) 2
1 0
Exercise 3
1. 103 4451
60 , 3600
2.
(i) 2.8 (ii) 1.16
3.
1400/
4.
(i) 0.1125, 2.99984 (ii) 7.4625, 77.4736
5.
(i)
10 (ii) 2 (iii) 15
6.
(i) 10 (ii) 3 (iii) 31 (iv) 3

7.
(i) 12.4, 13.973 (ii) 8.7, 3.4933
8.
(i) 33 (ii) 0.55 (iii) 0.55 (iv) 7.
9.
(i) 1, 1, (ii) mean 0, variance 1.
10.
(i)

11.
12.
13.

Exercise 4

245
(i) 27 (ii) 17 (iii) H (iv) |0 (v) 32 (vi) 6
(i) 0.953344 (ii) 0.046656 (iii) 3.

Exercise 5

(i) 0.002479 (ii) 0.01487 (iii) 0.00007373 (iv) 0.0004424


0.00674, 0.17547,0.104445.
0.08422,
0, x<0
1. (i) 0.1678 (ii) 0.00000256 - 0.0000 (iii) 0.4967 (iv) 0.7969
x2 0 < x<4
32 , 2. (i) 0.1641 (ii) 0.0020 (iii) 0.0020 (iv) 0.998
7 (x
- 2) 4<x<6 3. (i) 8 13

1, x>6 4. (i) 0.1651 (ii) 0.0134 (iii) 0.000003813766


5.
6.

1.
2.
3. (i) 0.0821 (ii) 0.9858
4. (i) 0.0183 (ii) 0.0733 (iii) 0.7619
5. (i) 0.0498 (ii) 0.2240 (iii) 0.4232 (iv) 0.5768
6. (i) 9.356 x 10 11 (ii) 0.07263 (iii) 0.01394 (iv) 0.00103.

Exercise 6
1. (i)
| (ii) 1 (iii) 1 (iv) L0315
2.
(i) 4 (ii) 23 (iii) 4
(iv)

F (x) = <

3.
(i) 772 (ii) 1 (iii) 3

246
(iv)

' 0, x<0

1 — cos x, 0 < x < 2


F (x) = <

1, x
2

4. (i)
2 (3 —
f (x)
=| x), 0<x<3

0, elsewhere

1 1
2

0, 00

F (x) = < 1 (6x — x2), 0x3

X 1, x 3

5. (i) k =1 (ii) 1 (iii) 2 —


A (iv) 3
3’
(v)
r 0 x<—1
1 (x
+ 1)2> 1x0
F (x) = <
6 (—x2 + 4x + 2), 0 < x < 2

1,x > 2
X

Exercise 7

1. (a) 0.0548 (b) 0.0082 (c) 0.3085 (d) 0.0117 (e) 0.8849

2. (i) —0.253 (ii) 0.915 (iii) 1.42 (iv) 1.34

247
3. 49.82 ,23.54 , 0.1894

4. (i) 684 (ii) 95.15 - 95

5. (i) 0.0736 (ii) 0.9938

6. (i) 1347.89 (ii) 41.83% (iii) 0.4199

7. 0.1018

8. (i) B (ii) D (iii) 82 (iv) 58

9. 22million

10. 190, 440, 61 months


11. (i) 0.6915 (ii) 0.0528
12. (i) 0.9873 (ii) 0.6992 (iii) 0.1318
13. (i) 0.1699 (ii) 3.65
14. (i) 60, 37 (ii) 94 (iii) 0.099

Exercise 8
1.
4
2. 3
3, 2
3.
(i) 3 (ii)
64
4. (i)
4 (ii) (iii) 2 5, 1
25 2 .
5.
10 10
73
6.
(i) e 90 (ii) —e 3x
7.
(a) 1.6 (b) | (c) 1.6818 (d) 16x4, 0 < x < 2, 1; x > 2 (e) 1
8. 5
8ln2, 1.251, 16.
9.
2 _1 1
2-t, 2, 4
10.
— 11
4-t, 1 , 1
11.
— 9 1-1
L4’5’5

248
Exercise 9

1. (a) 9.44,10.56 (b) it is a lie


2. 38.8 < n < 58.4
3. [49.8 < n < 50.2]
4. (i) 48.4 < n < 51.6 (ii) 47.445 < < 52.555
5. 54.56 < < 61.44
6. [102.95,127.65] OR [103.44,127.16]
7. [93, 103]
8. [55.77, 67.73]
9. [12.2, 17.8]
10. (0.214, 0.266)
11. [0.124, 0.176] Not valid.
12. [0.31, 0.49]
13. [0.723, 0.777]

Exercise 10

1. The result is not significant. There is no evidence that the scales setting is incor-
rect. i.e. 1.732 < 1.96
2. -1.768 is in the rejection region, so the weights bags are less than 60kg.
3. 0.59 < 1.96, H0 is retained, so the measurements could have come from a popu-
lation whose mean is 60kg
4. 3.97995 > 2.33. It differs significantly. The machine could be set again.
5. 0.2544 > 2.365, we accept H0. The manufacturers claim is valid.
6. 1.732 < 2.262, accept H0. The manufacturers claim is valid.
7. 4.42 > 1.96,Z is significant at 5% level, we reject H0 and conclude thaat there is
a signicant difference in means.
8. 1.392 < 1.645 we accept H0. Men are not more likely to be left handed than
women.

249
9. 1.74% < 5%, so he has improved actually.

Exercise 11

1. Xtest = 61.44 > 18.48. We reject H0. This data does not follow a normal distribu-
tion with mean 5 and standard deviation 10
2. x = 2.16, since Xtest = 6.025 < 11.14, we accept H0. The distribution can be
reasonably modeled by a Poison distribution.
3. Since xlest = 554.7 > 7.815, we reject H0. The dice are biased

Exercise 12

1. 0.923420976 ~ 0.923
2. (i) r = 0.09842 (ii) -0.01786
3. -0.1786 low negative correlation
4. 0.7865
5. y' = 95.86 - 2.893x
6. (ii) y' = -61.685 + 0.874x (iii) 147cm
7. (i) There is almost no linear relationship. The trend can not be determined by
the scatter plot. (ii) e = -0.2375

8. (i) y' = 528.14 + 23.232x (ii) 1364 shs.


9. (ii) y' = 104.4885 + 1.38x (ii) v = 0.784764662

250

You might also like