Chapter - 2
Chapter - 2
Prepared by:
Nigus G (MSc.)
Email: [email protected]
Tell - +251-914424246
1
CHAPTER TWO
RANDOM VARIABLE AND PROBABILITY
DISTRIBUTIONS
Definition : Given a random experiment with a
sample space 𝑆, a function 𝑋 that assigns to each
element 𝑠 in 𝑆 one and only one real number 𝑋 𝑠 =
𝑥 is called a random variable(r.v.).
A random variable is a numerical description of the
outcomes of an experiment or a numerical valued
function defined on sample space, usually denoted by
capital letters.
Example : Let 𝑋 be the number of defective Laptop
products when three Laptops are tested.
2
Cont’d
Let 𝐷 = 𝐷𝑒𝑓𝑒𝑐𝑡𝑖𝑣𝑒 and 𝑁 = 𝑁𝑜𝑛𝑒 𝑑𝑒𝑓𝑒𝑐𝑡𝑖𝑣𝑒 𝑖𝑡𝑒𝑚
The sample space 𝑆 will be;
𝑆 = {𝐷𝐷𝐷, 𝐷𝐷𝑁, 𝐷𝑁𝐷, 𝐷𝑁𝑁, 𝑁𝐷𝐷, 𝑁𝐷𝑁, 𝑁𝑁𝐷, 𝑁𝑁𝑁}
Let 𝑋 be a function defined on 𝑆 such that:
𝑋 𝐷𝐷𝐷 = 3,
𝑋 𝐷𝐷𝑁 = 𝑋 𝐷𝑁𝐷 = 𝑋 𝑁𝐷𝐷 = 2,
𝑋 𝐷𝑁𝑁 = 𝑋 𝑁𝐷𝑁 = 𝑋 𝑁𝑁𝐷 = 1,
𝑋 𝑁𝑁𝑁 = 0
The function 𝑋 assigns a real number to each element 𝑠 in 𝑆. Thus 𝑋 is a
random variable. 𝑅𝑥 = (0,1,2,3) is called the range space of 𝑋.
3
Classification of Random variables
o Random variables may be divided into two types:
Discrete random variables and
Continuous random variables.
4
Discrete Random Variable
Discrete random variable assume only a countable
number of values.
Examples:
Number of attempts to solve a coding challenge.
Number of users on a website.
Number of lines of code written.
For a random variable 𝑋 of discrete type, we
associate a number 𝑃 𝑥𝑖 , 0 ≤ 𝑃(𝑥𝑖 ) ≤ 1 for 𝑖 =
1,2,3, … . Which is probability of 𝑥𝑖
5
Cont’d
The function 𝑃 𝑋 = 𝑃(𝑋 = 𝑥) is called the probability
mass function (pmf) if 𝑃 𝑥 , 𝑥𝜖𝑅 satisfy the following
properties.
I. 𝑃 𝑥𝑖 ≥ 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑥𝜖𝑅;
II. 𝑥𝜖𝑅 𝑃 𝑥 = 1 ;
III. 𝑃 𝑋 = 𝑥 = 𝐹(𝑥)
The collection of pairs {𝑥𝑖 , 𝑃 𝑥𝑖 } for 𝑖 = 1,2,3, … is called
a probability distribution.
Since 𝑋 is a discrete random variable here we call it a discrete
probability distribution.
6
Example-1
Consider an experiment of testing PC products in a company.
Let 𝑋 be the number of defective products . Construct the
probability distribution of 𝑋 when three PCs are tested.
Solution:
First identify the possible value that X can assume.
Calculate the probability of each possible distinct value
of X and express X in the form of frequency
distribution.
7
Cont’d
From our previous Example
𝑋 = (0,1,2,3)
Sample space =2𝑛 = 23 =8 OR
𝑆 = {𝐷𝐷𝐷, 𝐷𝐷𝑁, 𝐷𝑁𝐷, 𝐷𝑁𝑁, 𝑁𝐷𝐷, 𝑁𝐷𝑁, 𝑁𝑁𝐷, 𝑁𝑁𝑁}=8
and the probability distribution of 𝑋 (number of
defective products) is given by:
8
Exercise
Let 𝑋 be a random variable denoting the number of bits
equal to 1 in an 8 bit random binary number. Find the
sample space and construct the probability distribution
of 𝑋.What is the probability that at most 3 bits ON?
9
Continuous random variables
A sample space contains an infinite number of outcomes (
non countably infinite) equal to the number of points on a
line segment, it is called continuous sample space.
Let 𝑋 denote a random variable with space 𝑅, an interval
or union of intervals. Such a set 𝑅 is called continuous
sample space.
The random variable 𝑋 is called a continuous 𝑟. 𝑣. ,and 𝑋
is said to have a continuous distribution denoted as 𝑓(𝑥).
Examples:
CPU processing time.
Mark of a student.
10
Cont’d
The function 𝑓 𝑥 is called probability density function
(𝑝𝑑𝑓) of a 𝑟. 𝑣. 𝑋, if it satisfy the following properties:
I. 𝑓 𝑥 ≥ 0, 𝑥𝜖𝑅;
II. 𝑓 𝑥 𝑑𝑥 = 1
𝑏
III. 𝑃 𝑎≤𝑋≤𝑏 = 𝑎
𝑓 𝑥 𝑑𝑥 = 1
Probability means area for continuous random variable.
A continuous random variable has a probability of zero
of assuming any one of its values. i.e. if 𝑋 is continuous
𝑃 𝑥=𝑎 =0
11
Example-1
Consider the function
𝑐(2𝑥 − 𝑥 2) 0 ≤ 𝑥 ≤ 2, 𝑐 > 0
𝑓(𝑥)
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
I. Find the value of c so that 𝑓(𝑥) defines a
probability density function.
1 2
II. Find 𝑃(0 ≤ 𝑥 ≤ 1) and 𝑃( ≤𝑥≤ )
2 3
Solution
I) For a probability density function
∞
−∞
𝑓 𝑥 𝑑𝑥 = 1 , (𝑛𝑜𝑡𝑒 𝑓(𝑥) ≥ 0 𝑓𝑜𝑟 𝑎𝑙𝑙) . So
12
Cont’d
∞ 2 3 2
𝑥
𝑓 𝑥 𝑑𝑥 = 𝑐(2𝑥 − 𝑥 2 )𝑑𝑥 = 𝑐 𝑥 2 −
−∞ 0 3 0
=𝑐 4 − 8 3= 4𝑐 3 =1=
𝑐=3 4
1 13
II) 𝑃 0 ≤ 𝑥 ≤ 1 = 0
𝑓 𝑥 𝑑𝑥 = 0 4 (2𝑥 − 𝑥 2 )𝑑𝑥
3 1
𝑥
=3 4 𝑥2 −
3 0
3 1 − 1 = 1
4 3 2
1 2
𝐼𝐼𝐼) 𝑃( ≤ 𝑥 ≤ ) =??
2 3
13
Exercise
Let 𝑋 be a continuous random variable with 𝑝𝑑𝑓
1
𝑓 𝑥 = 6 𝑥 + 𝑘, 0 ≤ 𝑥 ≤ 3
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
I. Evaluate 𝑘
II. Find 𝑃(1 ≤ 𝑥 ≤ 2)
14
Properties of Probability Distribution
1) 𝑝 𝑥 ≥ 0, 𝑖𝑓 𝑋 𝑖𝑠 𝑑𝑖𝑠𝑐𝑟𝑒𝑡𝑒.
𝑓 𝑥 ≥ 0, 𝑖𝑓 𝑋 𝑖𝑠 𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑜𝑢𝑠.
2) 𝑥 𝑝 𝑋 = 𝑥 = 1, 𝑖𝑓 𝑋 𝑖𝑠 𝑑𝑖𝑠𝑐𝑟𝑒𝑡𝑒.
𝑓 𝑥 𝑑𝑥 = 1, 𝑖𝑓 𝑋 𝑖𝑠 𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑜𝑢𝑠
15
Two Dimensional Random Variables
We may define two or more random variables on the same
sample space .
Let 𝑆 be the sample space associated with a random
experiment 𝐸. Let 𝑋 𝑎𝑛𝑑 𝑌 be two real random variables
defined on the same space.
Let 𝑋 = 𝑋 𝑠 𝑎𝑛𝑑 𝑌 = 𝑌(𝑠) be two functions assigning a
real number to each outcomes 𝑠 𝜖 𝑆. Then (𝑥, 𝑦) is called
two dimensional random variable.
Example: Suppose in a communication system, 𝑋 is a
transmitted signal and 𝑌 is the corresponding noisy received
signal. Then (𝑥, 𝑦) is a joint random variable.
16
Cont’d
Note
I. If the possible values of (𝑋, 𝑌) are finite or countable
infinite, (𝑋, 𝑌) is called a two dimensional discrete
random variable.
II. If (𝑋, 𝑌) can assume all values in a specific region 𝑅 in
the 𝑥𝑦-plane, (𝑋, 𝑌) is called a two dimensional
continuous random variable.
17
Joint Probability Mass Function
(Discrete case)
If (𝑋, 𝑌) is a two dimensional discrete random variable such
that 𝑃(𝑋 = 𝑥𝑖 ,𝑌 = 𝑦𝑖 ) = 𝑝 𝑥, 𝑦 , then 𝑝 𝑥, 𝑦 is called the
probability mass function of (𝑋, 𝑌) provided that
I. 𝑝 𝑥, 𝑦 ≥ 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑥, 𝑦
II. 𝑅 𝑝 𝑥, 𝑦 = 1
III. 𝑃(𝑋 = 𝑥,𝑌 = 𝑦) = 𝐹(𝑥, 𝑦)
Example: Suppose that two machines are used for particular
task in the morning and for a different task in the afternoon.
Let X and Y represent the number of times that a machine
breaks down in the morning and in the afternoon respectively.
The table below gives the joint probability distribution of (x,y)
18
Cont’d
19
Solution
a) 𝑝 𝑥 = 𝑦 = 𝑝 𝑥 = 0, 𝑦 = 0 + 𝑝 𝑥 = 1, 𝑦 = 1 +
𝑝 𝑥 = 2, 𝑦 = 2 = 0.25 + 0.08 + 0.13 = 0.46
b) 𝑝 𝑥 > 𝑦 = 𝑝 𝑥 = 1, 𝑦 = 0 + 𝑝 𝑥 = 2, 𝑦 = 0 +
𝑝 𝑥 = 2, 𝑦 = 1 = 0.15 + 0.10 + 0.07 = 0.32
20
Joint Probability Density function
( Continuous Case)
If (𝑋, 𝑌) is a two-dimensional continuous RV then 𝑓(𝑥. 𝑦) is
called the joint pdf 𝑋, 𝑌 , provided that 𝑓(𝑥. 𝑦) satisfies the
following conditions.
I. 𝑓 𝑥, 𝑦 ≥ 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑥, 𝑦;
II. 𝑓 𝑥, 𝑦 𝑑𝑥 𝑑𝑦 = 1 ;
𝑏 𝑑
III. 𝑃 𝑎 < 𝑋 ≤ 𝑏, 𝑐 < 𝑌 ≤ 𝑑 = 𝑎 𝑐
𝑓 𝑥, 𝑦 𝑑𝑦𝑑𝑥
21
Example
Let (𝑋, 𝑌) be a continuous 𝑅𝑉 with a joint pdf 𝑓 𝑥, 𝑦 =
𝑐 𝑖𝑓 0 < 𝑥 < 2 , 0 < 𝑦 < 4
𝑓 𝑥, 𝑦 =
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
a) Determine c
b) Find 𝑃(𝑥 < 1, 𝑦 < 3)
Solution
22
Marginal, Conditional Probability
distributions and Independent of RVs
Marginal probability Distribution
23
Cont’d
24
Cont’d
25
Conditional Distribution Function
When two random variables are defined in a random experiment,
knowledge one can change the probabilities of the other.
26
Cont’d
27
Independent Random Variables
28
Exercise
The joint probability mass function of (𝑋, 𝑌) is given by
𝑃 𝑥, 𝑦 = 𝑘 2𝑥 + 3 , 𝑥 = 0,1,2, 𝑦 = 1,2,3 then find the
marginal probability distribution of 𝑥 and 𝑦
29