Probability and Statistics 2 Notes
Probability and Statistics 2 Notes
We will only know when we are no longer able to take advantage of it…
DESCRIPTION
Random variables: discrete and continuous, probability mass, density and distribution
functions, expectation, variance, percentiles and mode. Moments and moment generating
function. Moment generating function and transformation Change of variable technique for
univariate distribution. Probability distributions: hyper-geometric, binomial, Poisson, uniform,
normal, beta and gamma. Statistical inference including one sample normal and t tests.
Pre-Requisites: STA 2100 Probability and Statistics I, SMA 2104 Mathematics for Science
Course Text Books
1) RV Hogg, JW McKean & AT Craig Introduction to Mathematical Statistics, 6th ed.,
Prentice Hall, 2003 ISBN 0-13-177698-3
2) J Crawshaw & J Chambers A Concise Course in A-Level statistics, with worked examples,
3rd ed. Stanley Thornes, 1994 ISBN 0-534- 42362-0
Course Journals:
1) Journal of Applied Statistics (J. Appl. Stat.) [0266-4763; 1360-0532]
2) Statistics (Statistics) [0233-1888]
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 1
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
1. RANDOM VARIABLES
1.1 Introduction
In application of probability, we are often interested in a number associated with the outcome
of a random experiment. Such a quantity whose value is determined by the outcome of a
random experiment is called a random variable. It can also be defined as any quantity or
attribute whose value varies from one unit of the population to another.
A discrete random variable is function whose range is finite and/or countable, Ie it can only
assume values in a finite or countably infinite set of values. A continuous random variable is
one that can take any value in an interval of real numbers. (There are uncountably many real
numbers in an interval of positive length.)
Note: The probability that X takes on the value x, ie p(X x) , is defined as the sum of the
probabilities of all points in S that are assigned the value x.
We can say that this pmf places mass 83 on the value X = 2 .
The “masses” (or probabilities) for a pmf should be between 0 and 1.
The total mass (i.e. total probability) must add up to 1.
Definition: The probability mass function of a discrete variable is a graph, table, or formula
that specifies the proportion (or probabilities) associated with each possible value the random
variable can take. The mass function P(X x) (or just p(x) has the following properties:
0 p(x) 1 and p(x) 1
all x
More generally, let X have the following properties
i) It is a discrete variable that can only assume values x1 , x2 , .... xn
ii) The probabilities associated with these values are
P( X x1 ) p1 , P( X x2 ) p2 ……. P( X xn ) pn
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 2
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
n
Then X is a discrete random variable if 0 pi 1 and p
i 1
i 1
Remark: We denote random variables with capital letters while realized or particular values
are denoted by lower case letters.
Example 1
Two tetrahedral dice are rolled together once and the sum of the scores facing down was noted.
Find the pmf of the random variable ‘the sum of the scores facing down.’
Solution
+ 1 2 3 4 Therefore the pmf of X is given by the table
1 2 3 4 5 below
2 3 4 5 6 x 2 3 4 5 6 7 8
1 1 3 1 3 1 1
3 4 5 6 7 P(X=x) 16 8 16 4 16 8 16
Example 3
A discrete random variable Y has a pmf given by the table below
Y 0 1 2 3 4
P(Y=y) c 2c 5c 10c 17c
Find the value of the constant c hence computes P1 Y 3
Solution
p(Y y) 1 c(1 2 5 10 17) 1 c 351
ally
Exercise 1.1
1. A die is loaded such that the probability of a face showing up is proportional to the face
number. Determine the probability of each sample point.
2. Roll a fair die and let X be the square of the score that show up. Write down the
probability distribution of X hence compute P X 15 and P3 X 30
3. Let X be the random variable the number of fours observed when two dice are rolled
together once. Show that X is a discrete random variable.
4. The pmf of a discrete random variable X is given by P( X x ) kx for x 1, 2 , 3, 4 , 5 , 6
Find the value of the constant k, P X 4 and P3 X 6
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 3
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
5. A fair coin is flip until a head appears. Let N represent the number of tosses required to
realize a head. Find the pmf of N
6. A discrete random variable Y has a pmf given by P(Y y ) c 34 for y 0 ,1, 2 , .....
x
0.015
density
0.01
0.005
0
0 10 20 30 40 50 60 70 80 90 100
Age
The area of each bar corresponds to the proportion of the population with ages in that
interval. The total area of all the bars is 1.
The distribution of the ages can be modelled by a curve. This curve is called a probability
density function.
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 4
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
b
iii) pa x b f( x) dx i.e. probabilities correspond to areas under the curve.
a
Example 1: Sketch the graph of each of the following functions. Decide in each case
x 3 X 1
whether it could be the equation of a probability density function: (a) f( x)
0 elsewhere
321 (24 x 3x 2 36) 2 X 6 x2 4 x 3 0 X 4
b) f( x) c) f( x)
0 elsewhere 0 elsewhere
Solution
The function is non-negative everywhere.
For f to represent a p.d.f, we need to check
that f( x) dx 1 . But:
all x
f( x) dx x dx 12 x
-3
1
2
0
0 ( 12 ) 12
all x
So f(x) could not represent a probability
density function.
6
f( x) dx 24 x 3x 36dx
1 2
32 2
all x
1
32 12 x 2
x 3 36 x 2
6
1
32 0 (32) 1
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 5
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
Remark A crucial property is that, for any real number x, we have P(X x) 0 (implying
there is no difference between P(X x) and P(X x) ); that is it is not possible to talk about
the probability of the random variable assuming a particular value. Instead, we talk about the
probability of the random variable assuming a value within a given interval which is defined
to be the area under the graph of the probability density function between x a and x b .
Example 2
The time X, in hours, between computer failures is a continuous random variable with density
e 0.01x for x 0
f(x) Find hence compute P50 X 150 and PX 100
0 , elsewhere
Solution
f(x) 0 for all x in 0 x Thus 1 e 0.01x dx 100 e 0.01x
0
0 100 0.01..
50
150
50 e 0.5 e 1.5 0.3834005 and
0
100
0 1 e 1 0.6321206
(5 x)( x 2) 7 x 10 x2 .
f( x) dx k ( x 1)dx k 7 x 10 x dx
3 5
2
1 3
all x
1k 1
2 x2 x 1
3
7
2 x 2 10 x 13 x 3
5
3
( )
3
2
1
2
25
6 ( )
15
2
16
3 k 163
2
P(X 2) 1 P(X 2) 1 163 ( x 1)dx 1 163
1
1
2
x 2 x 1 1 163 0 ( 12 ) 32
2 29
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 6
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
Solution
12 x cdx 12 54 c
2 3
all x
f(x)dx 1 1
0 4
dx
2
c 34
Exercise 1.2
cx, 0 x 1
1) Suppose that the random variable X has p.d.f. given by f(x) Find the
0, elsewhere
value of the constant c hence determine m so that PX m 12
5x k , 0 x 3
2) Let X be a continuous random variable with pdf f(x) Find the value
0, elsewhere
of the constant k hence compute P1 X 3
k (1 y ), 4 x 7
3) A continuous random variable Y has the pdf given by f(y) Find
0, elsewhere
the value of the constant k hence compute PY 5 and P5 Y 6
4) The continuous random variable X has probability density function
k ( x 1)2 , 0 x 2
f( x) Find the value of the constant k k hence compute P X 1.5
0, otherwise
5) A continuous random variable R is defined by the probability density function
k (5 r ), 0 r 2 a) Sketch the p.d.f of R
f(r ) b) Find k hence compute P(1 ≤ R ≤ 3).
0, otherwise
6) The life, T hours, of an electrical component is modelled by the probability density
ke0.001t , T 1000
function f(t )
0, otherwise
a) Sketch the probability density function.
b) Find the value of the constant k.
c) Find P(1500 ≤ T ≤ 2000).
k (1 y 2 ), 1 x 1
7) A continuous r.v Y has probability density function f( x) Find
0, otherwise
the value of the constant k hence compute PY 0.5 and P(0.5 Y 0.5)
kx(1 x) , 0 x 1
8) Let X be a continuous r.v witha pdf f ( x) . Calculate P X 12 14
0, otherwise
6 , 0 x 2
1
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 7
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
kx, 0 x 2
11) A continuous random variable X has the pdf given by f(x) k 4 x 2 x 4 Find
0 , elsewhere
the value of the constant k hence compute P X 3 and P1 X 3
12) The length of time in minutes a customer queue in a post office is a random variable T with pdf
c 81 t 2 , 0 t 9
f(t )
0, elsewhere
a) Find the value of the constant c and the cdf of T
b) Find the probability that a customer will wait for more than 3 minutes
c) A customer has been queuing for 3 minutes, find the probability that this customers will be
queuing for at least 7 minutes
d) Three customers are selected at random, find the probability that exactly 2 of them had to
queue for longer than 3 min
Reminder If the cdf of X is F(x) and the pdf is f(x) , then differentiate F(x) to get f(x), and
integrate f(x) to get F(x) ;
Theorem: For any random variable X and real values a < b, Pa X b F(b) - F(a)
Example 1
1 1 x for x 1, 2 , 3 , 4 , 5
Let X be a discrete random variable with pmf given by f( x) 20 .
0 , elsewhere
Determine the cdf of X hence compute P X 3
Solution
4 x 1 x( x403)
x x
F(x) f(t) (t 1)
t
1
20
t 1
1
20
(2 3 .... x) 1 x
20 2
0 for x 1
x 3)
F( x) x ( 40 for x 1, 2 , 3 , 4 , 5 Recall for an AP S n n
2 2a n 1d
1 for x 5
P X 3 1 P X 3 1 340
6
11
20
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 8
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
Example 2
Suppose X is a continuous random variable whose pdf f(x) is given by
1 x, 0 x 2
f( x) 2 . Obtain the cdf of X hence compute P X 23
0, elsewhere
Solution
0, x 0
2
x x
F(x) f(t)dt 12 tdt 14 t 0 14 x thus F( x) x4 , 0 x 2
2 x 2
- 0 1, x 2
P X 23 1 P X 23 1 14 23 89
2
Example 3
A continuous random variable X has a probability density function given by
0.25 , 0 x 2
f( x) 0.5 x c , 2 x 3 Find the cdf of X hence compute P1.5 X 2.5 .
0 , elsewhere
Solution
x 1 dt x
0 4
x
4
F(x) f(t)dt x
12 t - 34 dt k x 4-3x 12 k
2
-
2
Under the two levels, F(2) must be the same. (reason for introducing k)
0 for x 0
x
4 for 0 x 2
F(2) 12 k F( x) 2
4 1 for 2 x 3
x -3x
1, for x 2
P1.5 X 2.5 F(2.5) - F(1.5) 2.5 3( 2.5)
2
1 1.5
44
0.3125
Exercise 1.3
x3 k
1. The CDF of a discrete random variable X is given by F( X ) , x 1, 2, 3
40
a) Show that k=13 b) Find the pmf of x
C , 0 x 4
2. The pdf of a continuous random variable X is given by f( x) x Find the
0, elsewhere
value of the constant C, the cdf of X and P X 1
kx(1 x), 0 x 1
3. The pdf of a random variable X is given by g( x) Find the value
0, elsewhere
of the constant k, the cdf of X and the value of x such that G(x) 12
4. A continuous random variable x has 0), x 2
cumulative distribution function
F( x) 16 x 13 , 2 x 4 Find the
1, x 4
probability density function f(x) of X.
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 9
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 10
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
Example 1
x 6 for x 1, 2 , 3
Give the pmf of a random variable X as f( x) find the pmf of Y X 2
0 , elsewhere
Solution
The only values of Y with non-zero probabilities are Y = 1, Y = 4 and Y = 9 . Now
PY = 1 P X2 = 1 PX = 1 16
PY = 4 P X2 = 4 PX = 2 13 and
PY = 9 PX = 9 PX = 3
2 1
2
In some cases several values of X will give rise to the same value of Y. The procedure is just
the same as above but it is necessary to add the several probabilities that are associated with
each value x that provides a unique value y.
x 1
for x 0 , 1, 2 , 3 , 4
Example 2 Given the pmf of a r.v X as f( x) 15 find the pmf of
0 , elsewhere
Y X 2
2
Solution
x 0 1 2 3 4
y 4 1 0 1 4
\Exercise 1.4
16 for x 1, 2 , 3 , 4 , 5 , 6
1. Suppose the pmf of a r.v X is given by f( x) , Obtain the pmf of
0 , elsewhere
Y 2 X and Z X 3
2
x2 1
for x 0 , 1, 2 , 3
2. Let the pmf of a r.v X be given by f( x) 18 , determine the pmf of
0,
elsewhere
Y X 1 2
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 11
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
x 10 for x 0 , 1, 2 , 3 , 4
3. Suppose the pmf of a r.v X is given by f( x) , Obtain the pmf of
0 , elsewhere
Y X 2
1 for x 1, 2 , 3 , ....
x
Example 1
5 x 4 , 0 x 1
A continuous r.v X has a pdf given by f( x) . Determine the pdf of Y x 3
0 otherwise
Solution
1 2
5 y 3 , 0 x 1
2
dx 1 2 3 dx 4
Yx X Y Y g(y) f(x) 5 y 3 y 3 3
3 1 1
3
dy 3 dy 3
0 otherwise
24 x 2 , 0 x 12
Example 2 A r.v X has pdf f( x) determine the pdf of Y 8 X 3
0 otherwise
Solution
Y 8 x 3 X 12 Y 3
1 dx 1 2 3
6y g(y) f(x)
dx 2
24 12 y 3 16 y 3
1 2
1, 0 x 1
dy dy 0, elsewhere
NB Y 8 X 3 is the cdf of X
Exercise 1.5
5 x 4 , 0 x 1
1. For a r.v X with f( x ) , determine the pdf of Y 2 ln x and its range.
0 otherwise
e x , x 0
2. A r.v X has pdf f( x) determine the pdf of Y X 4
0 otherwise
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 12
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 13
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
We will sketch the proof using a continuous random variable since the proof using the
discrete random variable is similar and was also discussed in probability and statistics I.
(i) Ec cP ( X x)dx c P( X x)dx c(1) c
All x All x
(iv) Eag1 (x) bg 2 (x) ag (x) bg (x) P( X x)dx ag (x) P( X x)dx bg (x) P( X x)dx
1 2 1 2
All x All x All x
Eag1 (x) Ebg 2 (x) aEg1 (x) bEg 2 (x) ie from part iii
Proof:
Recall that EaX b a b therefore
Var (aX b) E(aX b) (a b) Ea X E a 2 X a2 E X a 2 var( X )
2 2 2
2
Remark
(i) The expected value of X always lies between the smallest and largest values of X.
(ii) In computations, bear in mind that variance cannot be negative!
Example 1
Given a probability distribution of X as below, find the mean and standard deviation of X.
X 0 1 2 3
P(X=x) 1/8 1/4 3/8 1/4
Solution
3
X 0 1 2 3 total E ( X ) xp ( X x) 1.75 and
p ( X x) 1
8
1
4
3
8
1
4 1 x 0
xp ( X x) 0 1
4
3
4
3
4
7
4
standard deviation
x 2 p ( X x) 0 1
4
3
2
9
4 4 E ( X 2 ) 2 4 1.752 0.968246
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 14
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
Example 2 The probability distribution of a r.v X is as shown below, find the mean and
standard deviation of; a) X b) Y 12 X 6 .
X 0 1 2
P(X=x) 1/6 1/2 1/3
Solution
2
X 0 1 2 total E ( X ) xp ( X x) 7 6 and
p ( X x) 1
6
1
2
1
3 1 x 0
xp ( X x) 2
E ( X 2 ) x 2 p( X x) 116
1 2 7
0 2 3 6
x p ( X x)
2
0 1
2
4
3
11
6 x 0
Standard deviation E ( X 2 ) 2 11
6 (7 6) 2 17
6 1.6833
Now E(Y ) 12E( X ) 6 12(7 6 ) 6 20
Var (Y ) Var (12 X 6) 122 Var ( X ) 144 17
6 242.38812
1 x, 0 x 2
Example 3 A continuous r.v X has a pdf given by f(x) 2 , find the mean
0, elsewhere
and standard of X
Solution
2 2
4
E(x) xf( x)dx 2 x dx 6 x 0 and E(x ) x f( x)dx 12 x 3dx 18 x 4 0 2
2 2
1 2 1 3 2 2
3
0 0
Standard deviation E ( X 2 ) 2 2 ( 4 3 )2 3
2
Exercise 1.6
1. Suppose X has a probability mass function given by the table below
X 2 3 4 5 6
P(X=x) 0.01 0.25 0.4 0.3 0.04
Find the mean and variance of; X
2. Suppose X has a probability mass function given by the table below
X 11 12 13 14 15
P(X=x) 0.4 0.2 0.2 0.1 0.1
Find the mean and variance of; X
3. Let X be a random variable with P(X = 1) = 0.2, P(X = 2) = 0.3, and P(X = 3) = 0.5. What is the
expected value and standard deviation of; a) X b) Y 5 X 10 ?
4. A random variable W has the probability distribution shown below,
W 0 1 2 3
P(W=w) 2d 0.3 d 0.1
Find the values of the constant d hence determine the mean and variance of W. Also find
the mean and variance of Y 10 X 25
5. A random variable X has the probability distribution shown below,
X 1 2 3 4 5
P(X=x) 7c 5c 4c 3c c
Find the values of the constant c hence determine the mean and variance of X.
6. The random variable Z has the probability distribution shown below,
Z 2 3 5 7 11
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 15
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
1 1 1
P(Z=z) 6 3 4 x y
If E ( Z ) 4 3 , find the values of x and y hence determine the variance of Z
2
36
m
, m 1, 2 , 3 , ...,8
7. A discrete random variable M has the probability distribution f(m) ,
0 , elsewhere
find the mean and variance of M
510
y
, y 1, 2 , 3 , 4
8. For a discrete random variable Y the probability distribution is f(y) ,
0 , elsewhere
calculate E (Y ) and var(Y)
kx for x 1, 2 , 3 , 4
9. Suppose X has a pmf given by f(x) , find the value of the constant k
0 , elsewhere
hence obtain the mean and variance of X
kx , x 2, 4, 6
10. A discrete random variable X has a probability function P( X x) k x 2, x 8
0, elsewhere
a) Show that k 181 hence find E (X ) and E ( X 2 )
b) Calculate var3 4 X , give your answer to 3 significant figures.
11 A biased die with six faces is rolled. The discrete random variable X represents the score
of the uppermost face. The probability distribution of X is shown in the table below
X 1 2 3 4 5 6
P(X=x) A a a b B 0.3
a) Given that E(X) = 4.2, find the values of a and b.
b) Show that E X 2 20.4 c) Find var 5 3x
k 1 x 2 , x 1,0,1,2
12 A discrete random variable X has probability function P( X x)
0, elsewhere
a) Show that k 16 c) Show that E ( X 2 ) 43
b) Find E (X ) d) Find var 1 3x
13 A team of 3 is to be chosen from 4 girl and 6 boys. If X is the number of girls in the
team, find the probability distribution of X hence determine the mean and variance of X
14 A fair six sided die has; ‘1’ on one face, ‘2’ on two of its faces and ‘3’ on the remaining
three faces. The die is rolled twice. If T is the total score write down the probability
distribution of T hence determine; a) the probability that T is more than 4. b) the mean
and variance of T
kr for 0 r 4
15 The pdf of a continuous r.v R is given by f(r) , (a) Determine c. hence
0 , elsewhere
Compute P(1 0 r 2) , E(X) and Var(X).
k (1 10
m
) for M 10
16 A continuous r.v M has the pdf given by f(m) , find the value of
0 , elsewhere
the constant k, the mean and the variance of X
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 16
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
k (1 x) for 0 x 1
17 A continuous r.v X has the pdf given by f(x) , findt the value of
0 , elsewhere
the constant k. Also find the mean and the variance of X
d 2 if T 1
18 The lifetime of new bus engines, T years, has continuous pdf f(t) t find the
0 , if T 1
value of the constant d hence determine the mean and standard deviation of T
19 An archer shoots an arrow at a target. The distance of the arrow from the centre of the
k (3 + 2x - x 2 ) if x 3
target is a random variable X whose p.d.f. is given by f(x) find
0 , if x 3
the value of the constant k. Also find the mean and standard deviation of X
20 The random variable Y has probability density function f(y) given by
ky(a y ), 0 x 3
f(y) where k and a are positive constants.
0, elsewhere
2
a) Explain why a ≥ 3 and then show that k
9(a 2)
b) Given that E(Y) = 1.75 , show that a = 4 and write down the value of k.
c) For these values of a and k, sketch the probability density function,
d) Write down the mode of Y.
a bx , 0 x 5
21 A continuous random variable x has the following pdf f( x) where a and b
0 , otherwise
are constants. Show that 10a 25b 2
a) Given E X
35
, find a second equation in a and b hence find the values of a and b.
12
b) Find the median of X
22 The queuing time X minutes of a customer at a till of a supermarket has a pdf
323 x(k x) , 0 x k
f( x)
0 , otherwise
a) Show that k 4 . Also find E (x) and var(x)
b) Find the probability that a randomly chosen customers queuing time will differ from the mean
by at least half a minute
23 The probability density function f(x) can be written in the following form.
ax , 0 x 2
f( x) b ax , 2 x 4
0 , otherwise
a) Find the values of the constants a and b.
b) Show that σ, the standard deviation of X, is 0.816 to 3 decimal places.
c) Find the lower quartile of X.
d) State, giving a reason, whether P(2 – σ < X < 2 + σ) is more or less than 0.5
k (1 x) , 1 x 0
24 A continuous r.v X has the pdf given by f(x) 2k (1 x), 0 x 1 , find the value of
0 , elsewhere
the constant k. Also find the mean and the variance of X
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 17
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
e x for x 0
25 A continuous r.v X has the pdf given by f(x) , find the mean and
0 , elsewhere
3x
standard deviation of; a) X b) Y e 4
Median
The median, m, of a random variable X is defined to be the value such that “half of the
distribution lies to the left of m and half to the right”. More formally, m should
satisfy FX (m) = P(X m) 0.5 where F is the cumulative distribution function of X.
Note: If there is a value m such that the graph of y= f(x) is symmetric about x=m, then both
the expected value and the median of X are equal to m.
The lower quartile Q l and the upper quartile Q 3 are similarly defined by
FX (Ql ) = 0.25 and FX (Q3 ) = 0.75
Thus, the probability that X lies between Q l and Q 3 is 0.75 - 0.25 = 0.5 , so the quartiles give
an estimate of how spread-out the distribution is. More generally, we define the nth percentile
of X to be the value of xn such that FX (x n ) = 0.01n or n 100 , that is, the probability that X is
smaller than xn is n%.
2 x, 0 x 1
Example A random variable X has the pdf given by f(x) State the mode
0 , elsewhere
hence find the lower, middle and upper quartiles.
Solution
On the interval 0 x 1, f(x) is maximized at x 1 so the mode is 1
On the interval 0 x 1, the cdf of X is given by F(x) x 2 thus
a) At lower quartile Q l , F(Ql ) Ql 0.25 Ql 0.25 0.5
2
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 18
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
Exercise 1.7
k (1 x) for 0 x 1
1) A continuous r.v X has the pdf given by f(x) , find the mode.
0 , elsewhere
x 2 ( x 2) 0 x 2
2) A random variable X has p.d.f. f(x) Find the mode of X.
0 , otherwise
1 e 2x for x 0
3) Let X be a continuous random variable with density function f(x) 2 .
0 , elsewhere
Determine the 25th percentile of the distribution of X.
4) A random variable X is defined by the cumulative distribution function
0, x 2
F( x) k ( x 2 x 6), 2 x 5
1, x 5
a) Find the value of the constant k hence work out P(3 ≤ X ≤ 4).
b) Obtain and sketch the probability density function.
c) State the mode. Also find median value and the interquartile range.
k ( x 2 2 x 3)11 x 2
5) A random variable X has p.d.f. f(x), where f(x) k (2 12 x) 2 x 4
0 , otherwise
2. PROBABILITY DISTRIBUTION
2.1 Discrete Distribution
Among the discrete distributions that we will discuss in this topic includes the Bernoulli,
binomial, Poisson, geometric and hyper-geometric
Definition: A Bernoulli trial is a random experiment in which there are only two possible
outcomes - success and failure. Eg
Tossing a coin and considering heads as success and tails as failure.
Checking items from a production line: success = not defective, failure = defective.
Phoning a call centre: success = operator free; failure = no operator free.
A Bernoulli random variable X takes the values 0 and 1 and P( X 1) p and
P( X 0 ) 1 p
Definition: A r.v X is said to be a real Bernoulli distribution if it’s pmf is given by;
p x (1 p)1 x for x 0 ,1
P( X x )
0 otherwise
We abbreviate this as X ~ B(p) ie p is the only parameter here. It can be easily checked that
the mean and variance of a Bernoulli random variable are p and 2 p(1 p1)
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 19
Time is precious, but we do not know yet how precious it really is. We will only know when we are no longer able to take advantage of it…
denote the number of successes on n trials. The random variable X is said to have a binomial
distribution and has probability mass function
P( X x )n Cr p x (1 p)n x for x 0 ,1, 2 ..... n
We abbreviate this as X ~ Bin ( n , p) read as “X follows a binomial distribution with
parameters n and p ”. n Cr Counts the number of outcomes that include exactly x successes
and n x failures.
The mean and variance of a Binomial random variable are respectively given by;
np and 2 np(1 p1)
n
Let’s check to make sure that if X has a binomial distribution, then P( X x ) 1 . We will
x 0
need the binomial expansion for any polynomial:
n n
p q n n Cr p x q n x therefore n Cx p x (1 p)n x p 1 p n 1n 1
x 0 x 0
Example 1
A biased coin is tossed 6 times. The probability of heads on any toss is 0:3. Let X denote the
number of heads that come up. Calculate: (i) P( X 2 ) (ii) P( X 3) (iii) P(1 X 5 )
Solution
If we call heads a success then X has a binomial distribution with parameters n=6 and p=0:3.
(i) P( X 2 )6 C2 (0.3)2 (0.7)4 0.324135
(ii) P( X 3 )6 C3 (0.3)3 (0.7)3 0.18522
(iii) P(1 X 5 ) P( X 2 ) P( X 3 ) P( X 4 ) P( X 5 )
0.324 0.185 0.059 0.01 0.578
Example 2 A quality control engineer is in charge of testing whether or not 90% of the
DVD players produced by his company conform to specifications. To do this, the engineer
randomly selects a batch of 12 DVD players from each day's production. The day's
production is acceptable provided no more than 1 DVD player fails to meet specifications’.
Otherwise, the entire day's production has to be tested.
a) What is the probability that the engineer incorrectly passes a day's production as
acceptable if only 80% of the day's DVD players actually conform to specification?
b) What is the probability that the engineer unnecessarily requires the entire day's
production to be tested if in fact 90% of the DVD players conform to specifications?
Solution
Let X denote the number of DVD players in the sample that fail to meet specifications.
a) In part a we want P( X 1) with binomial parameters n 12 and p 0.2
P( X 1) P( X 0 ) P( X 1) 12 C0 (0.2) 0 (0.8)12 12 C1 (0.2)1 (0.8)11
0.069 0.206 0.275
b) In part b we require P( X 1) 1 P( X 1) with parameters n 12 and p 0.1 .
P( X 1) P( X 0 ) P( X 1) 12 C0 (0.1)0 (0.9)12 12C1 (0.1)1 (0.9)11 0.659
So P(X 1) 0.341
Example 3 Bits are sent over a communications channel in packets of 12. If the probability
of a bit being corrupted over this channel is 0.1 and such errors are independent, what is the
probability that no more than 2 bits in a packet are corrupted?
Proverbs 21:5 The plans of the diligent lead to profit as surely as haste leads to poverty By J. K. Kiingati Page 20