BMA2102 Probability and Statistics II Lecture 1
BMA2102 Probability and Statistics II Lecture 1
Gikonyo Kiguta
Mount Kenya University
Contents
1 Random Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 Introduction 5
1.2 Discrete Random Variables and Probability Mass Function 5
1.3 Continuous Random Variables and Probability Density Function 8
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Articles 15
Books 15
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.)
Now, what are the possible values that X takes on and what are the probabilities of X taking
a particular value?
From the above we see that the possible values of X are the 4 values
X = {0, 1, 2, 3}
Ie the sample space is a disjoint union of the 4 events {X = j} for j = 0, 1, 2, 3
6 Chapter 1. Random Variables
Since for a fair coin we assume that each element of the sample space is equally likely (with
probability 18 , we find that the probabilities for the various values of X, called the probability
distribution of X or the probability mass function (pm f ). can be summarized in the following table
listing the possible values beside the probability of that value
X 0 1 2 3
1 3 3 1
P(X = x) 8 8 8 8
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.
3
We can say that this pmf places mass 8 on the value X = 2.
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:
P (X = x1 ) = p1 , P (X = x2 ) = p2 . . . . . . P (X = xn ) = pn
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 Discrete Random Variables and Probability Mass Function 7
+ 1 2 3 4
1 2 3 4 5
Solution 2 3 4 5 6
3 4 5 6 7
4 5 6 7 8
X = {1, 2, 3, 4, 5, 6, 7, 8}
Therefore the pmf of X is given by the table below
x 2 3 4 5 6 7 8
1 1 3 1 3 1 1
P(X = x) 16 8 16 4 16 8 16
Example 2
The pmf of a discrete random variable W is given by the table below
W -3 -2 -1 0 1
P(W = w) 0.1 0.25 0.3 0.15 d
Find the value of the constant d, P(−3 ≤ w < 0), P(w > −1) and P(−1 < w < 1)
Solution
∑all w p(W = w) = 1 ⇒ 0.1 + 0.25 + 0.3 + 0.15 + d = 1 ⇒ d = 0.2
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 P(1 ≤ Y < 3)
Solution
1
∑ally p(Y = y) = 1 ⇒ c(1 + 2 + 5 + 10 + 17) = 1 ⇒ c = 35
2 5 1
P(1 ≤ Y < 3) = P(Y = 1) + P(Y = 2) = 35 + 35 = 5
8 Chapter 1. Random Variables
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 P(3 ≤ 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 P(3 ≤ X < 6)
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 x
6. A discrete random variable Y has a pmf given by P(Y = y) = c 43 for y = 0, 1, 2, . . . Find the
value of the constant c and P(X < 3)
2x
7. Verify that f(x) = k(k+1) for x = 1, 2, . . . .k can serve as a pmf of a random variable X.
8. For each of the following determine c so that the function can serve as a pmf of a random variable
X.
a) f (x) = cx for
x x = 1, 2, 3, 4, 5
c) f (x) = c 16 for x = 0, 1, 2, 3 . . .
b) f (x) = cx2 for x = 0, 1, 2, . . . .k
d) f(x) = c2−x for x = 0, 1, 2, . . .
9. A coin is loaded so that heads is three times as likely as the tails. For 3 independent tosses of the
coin find the pmf of the total number of heads realized and the probability of realizing at most 2
heads.
A continuous random variable can assume any value in an interval on the real line or in a collec-
tion of intervals. The sample space is uncountable. For instance, suppose an experiment involves
observing the arrival of cars at a certain period of time along a highway on a particular day. Let
T denote the time that lapses before the 1st arrival, then T is a continuous random variable that
assumes values in the interval [0, ∞)
To illustrate the concept of a probability density function, consider a histogram with unequal
class widths. Frequency density is plotted on the vertical axis, where
frequency
frequency density =
class width
One can also draw a relative frequency histogram in which the area of a bar corresponds to the
proportion of the data falling into the corresponding interval. The relative frequency is defined as
frequency density
Relative frequency =
Total frequency
Eg. The relative frequency histogram below shows the distribution of ages of the UK population.
1.3 Continuous Random Variables and Probability Density Function 9
The area of each bar corresponds to the proportion of the population with ages in that inter-
val. 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.
Definition: A probability density function (or p.d.f.) is a curve that models the shape of the
distribution corresponding to a continuous random variable. The function has several important
properties If f(x) is the p.d.f corresponding to a continuous random variable X and if f(x) is defined
for −∞ < X < ∞ then the following properties must hold:
10 Chapter 1. Random Variables
i) f (x) ≥ 0 for all x. i.e. the graph of the p.d.f. never dips below the x -axis.
R∞
ii) −∞ f(x)dx = 1 for all x. i.e. the total area under a p.d.f. is 1.
Rb
iii) p(a ≤ x ≤ b) = a f(x)dx i.e. probabilities correspond to areas under the curve.
Example 1: Sketch the graph of each of the following functions. Decide in each case whether it
could be the equation of a probability density function:
−3
x X≥1
(a) f(x) =
0 elsewhere
1
24x − 3x2 − 36 2 ≤ X ≤ 6
b) f(x) = 32
0 elsewhere
2
x − 4x + 3 0 ≤ X ≤ 4
c) f(x) =
0 elsewhere
Solution
a.
The
R
function is non-negative everywhere. For f to represent a p.d.f, we need to check that
all x f (x)dx = 1. But:
R ∞ −3 1 −2 ∞
= 0 − − 21 = 12
R
all x f (x)dx = 1 x dx = − 2 x 0
b. R
The function is non-negative everywhere. If f represents a p.d.f., then all x f(x)dx = 1
1 6
Z Z
f(x)dx = 24x − 3x2 − 36dx
all 32 2
1 2 6
= 12x − x3 − 36x 0
32
1
= [0 − (−32)] = 1
32
1.3 Continuous Random Variables and Probability Density Function 11
c.
The function is clearly negative for some values of x. Consequently f(x) cannot represent a proba-
bility density function.
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, −0.01x
in hours, between computer failures is a continuous random variable with density
λe for x > 0
f(x) =
0, elsewhere
Find λ hence compute P(50 ≤ X < 150) and P(X < 100)
12 Chapter 1. Random Variables
Solution
Solution f (x) ≥ 0 for all x in 0 ≤ x < ∞
R ∞ −0.01x ∞
dx = −100λ e−0.01x 0 = 100λ ⇒ λ = 0.01.
Thus 1 = λ 0 e
R 150 −0.01x 150
dx = −e−0.01x 50 = e−0.5 − e−1.5 ≈ 0.3834005 and
Now P(50 ≤ X < 150) = 0.01 50 e
R 100 −0.01x 100
dx = −e−0.01x 0 = 1 − e−1 ≈ 0.6321206
P(X < 100) = 0.01 0 e
Example 3
A continuous random variable X is defined by the probability density function
k(x − 1), 1 ≤ x ≤ 3
f(x) = k(5 − x)(x − 2)3 ≤ x ≤ 5
0, elsewhere
Solution
a.
1.3 Continuous Random Variables and Probability Density Function 13
b.
To find k, we can use the property that
R
all x f (x)dx = 1 Note that
(5 − x)(x − 2) = 7x − 10 − x2
R3 R5
7x − 10 − x2 dx
R
all x f (x)dx = k 1 (x − 1)dx + k 3
1 2 − x 3 + 7 x2 − 10x − 1 x3 3
1
⇒ k = 2x 1 2 3 3
3
− − 12 + − 25 15 16 3
= 2 6 − −2 = 3 ∴k= 16
c.
3 2
Z
P(X > 2) = 1 − P(X ≤ 2) = 1 − (x − 1)dx =
16 1
2
3 1 2 3 1 29
= 1− x −x = 1− 0− − =
16 2 I 16 2 32
Example 4
A continuous random variable X has a probability density function given by:
0.25, 0 < x < 2
f(x) = 0.5x + c, 2 < x < 3
0, elsewhere
Solution R2 1 R3 1
dx = 21 + 54 + c ⇒ c = − 34
R
all x f (x)dx = 1 = 0 4 dx + 2 2x+c
R2 1 R 2.5 1 3
P(1 ≤ X < 2.5) = P(1 ≤ X < 2) + P(2 ≤ X < 2.5) = 1 4 dx + 2 2 x − 4 dx =
h 2 i2.5
= 14 + x −3x
4 = 14 + 16
3 7
= 16
2
Exercise 1.2
1)Suppose
that the random variable X has p.d.f. given by
cx, 0 ≤ x ≤ 1
f(x)=
0, elsewhere
Find the value of the constant c hence determine m so that P(X ≤ m) = 12
x
2) Let X be a continuous random variable with pdf f(x) = 5 + k, 0 ≤ x ≤ 3 Find the value of
0, elsewhere
the constant k hence compute P(1 < X < 3)
k(1 + y), 4 ≤ x ≤ 7
3) A continuous random variable Y has the pdf given by f (y) = Find the
0, elsewhere
value of the constant k hence compute P(Y < 5) and P(5 < Y < 6)
14 Chapter 1. Random Variables
k(x − 1)2 , 0 ≤ x ≤ 2
4) The continuous random variable X has probability density function f(x) =
0, otherwise
Find the value of the constant k k hence compute P(X < 1.5)
k(5 − r), 0 ≤ r ≤ 2
5) A continuous random variable R is defined by the probability density function f (r) =
0, otherwise
a) Sketch the p.d.f of R
b) Find k hence compute P(1 ≤ R ≤ 3).
6) Thelife, T hours, of an electrical component is modelled by the probability density function
ke−0.001t , T ≥ 1000
f(t) =
0, otherwise
a) Sketch the probability density function.
b) Find the value of the constant k.
c) Find P(1500 ≤ T ≤ 2000)
7) A continuous r.v Y has probability density function
k 1 − y2 , −1 ≤ x ≤ 1
f(x) =
0, otherwise
Find the value of the constant k hence compute P(Y < 0.5) and P(−0.5 < Y < 0.5)
8) Let X
be a continuous r.v witha pdf
kx(1 − x), 0 ≤ x ≤ 1
. Calculate P X − 21 > 14
f(x) =
0, otherwise
1
9) The pdf of a random variable X is given by f (x) = 6,0 ≤ x ≤ 2
1
3,2 ≤ x ≤ 4
Sketch the graph of f(x) hence find P(1 < x ≤ 3)
k(1 + x)2 , −2 ≤ x ≤ 0
10) A continuous random variable X has the pdf given by f(x) = 4k 0 < x ≤ 43
0, elsewhere
Find the value of the constant k hence compute P(X > 1) and P(−1 < X < 1)
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 P(1 < X < 3)
12) Thelength 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
Bibliography
Articles
Books