Ac 213 Random Variables
Ac 213 Random Variables
Ms. Soko
random variables 1
Outline
random variables 2
Definition of a Random Variable
A random variable is a real valued function defined on a sample space
S. In a particular experiment, a random variable X would be some
function that assigns a real number X(s) for each possible outcome s S
A discrete random variable is a random variable that take a countable
number of values. If we count
Number of sales per day
Number of office machines to purchase
defective screws in a production,
A continuous random variable can take any value along a given
interval of a number line.
The time a customer spends in queued at a certain Bank
random variables 3
Probability Distributions, Mean and Variance for Discrete
Random Variables
random variables 4
Example
The probability mass function of the random
variable X is given by
0 1 2 3 4 5
random variables 5
Example 2
random variables 6
The Binomial Probability
The binomial probability distribution is one of the most widely used discrete probability
distributions. It is applied to find the probability that an outcome will occur x times in n
performances of an experiment.
experiment.
1. There are n identical trials. In other words, the given experiment is repeated n times,
where n is a positive integer. Each trial has two and only two outcomes. These
n x n− x
P ( x) = p q
x
Example: Binomial tree model in option pricing.
random variables 9
The Binomial Distribution Probability Distribution
Example 2: Say 40% of the class is female.
What is the probability that 6 of the first 10 students
walking in will be female?
n x n− x
P( x) = xp q
10 6 10 − 6
= 6 (.4 )(.6 )
= 210(.004096)(.1296)
= .1115
random variables 10
Example 1
At Cavendish University, management is contemplating on whether to ban drinking in hostels
or not. Suppose 60% of the student body are in favour of management plan to ban drinking in
hostels and 8 students are randomly selected, find the probability that
i. 3 favour the ban
ii. Less than 6 favour the ban
iii.At least 2 favour the ban
Solution
(i) n = 8, p = 0.6, q = 1 − p = 0.4
n
P ( X = x) = p x (1 − p ) n − x
x
8
P ( X = 3) = ( 0.6 ) ( 0.4 )
3 8−3
3
= 0.1239 .
(ii) P ( X 6 ) = P ( X = 0 ) + P ( X = 1) + P ( X = 2 ) + P ( X = 3) + P ( X = 4 ) + P ( X = 5)
Alternatively, we can use
P ( X 6) = 1 − P ( X 6)
P ( X = 6 ) + P ( X = 7 ) + P ( X = 8)
= 1−
8 8 8 0
= 1 − ( 0.6 ) ( 0.4 ) + ( 0.6 ) ( 0.4 ) + ( 0.6 ) ( 0.4 )
6 2 7 1 8
6 7 8
= 1 − 0.3154
= 0.6846
(iii) P ( X 2 ) = P ( X = 2 ) + P ( X = 3) + P ( X = 4 ) + P ( X = 5 ) + P ( X = 6 ) + P ( X = 7 ) + P ( X = 8 )
P ( X 2) = 1 − P ( X 2)
P ( X = 0 ) + P ( X = 1)
= 1−
8 8 7
= 1 − ( 0.6 ) ( 0.4 ) + ( 0.6 ) ( 0.4 )
0 8 1
0 1
= 0.9915
Example 2
Of a large number of mass-produced articles, one-tenth is defective. Find the probabilities that a
random sample of 20 will obtain
Solution
(a) Exactly two defective articles;
1
Let
(b)X be theAtnumber of defective
least two articles in a random sample of 20.
defective articles. Then X B 20, . Here
10
1
n = 20 and p = .
10
n
(a) P ( X = x ) = p x (1 − p ) n − x
x
20 − 2
20 1 9
2
=
2 10 10
20 1 9
2 18
=
2 10 10
= 0.2852
(b) P ( X 2) = 1 − P ( X 2)
i.e P ( X 2) = 1 − P ( X = 0) − P ( X = 1)
20 1 9 20 1 9
0 20 1 19
= 1− −
0 10 10 1 10 10
= 1 − 0.1216 − 0.2702
= 0.6082
Theorem
The mean and variance of the binomial distribution with parameters of n and p are
Mean: E ( X ) = np
Variance: Var ( X ) = npq , where q = 1 − p
Example 3
A packaging machine produces 20 percent defective packages. A random sample of ten packages
is selected, what are the mean and standard deviation of the binomial distribution of that process?
Solution
Let X be the number of defective packages in a sample of 10 packages. Here n = 10 and p = 0.2 .
X B (10, 0.2 )
Mean = E ( X ) = 10 0.2 = 2
Standard deviation = Var ( X )
= npq
= 10 0.2 0.8
= 1.265