DEBRE BIRHAN UNIVERSITY
College of computing
Department of data science
Course Name: Statistics and probability
Chapter five
Prepared by: Damenech S.(MSc. in Biostatistics)
Date: November 01/02/2018
2-2
ONE DIMENSIONAL RANDOM VARIABLE
Random variable(RV): is a real valued function which assigns a
numerical value to each out come in a sample space. or
A random variable is a mathematical function that assigns a numerical
value to each outcome in a sample space of a random experiment.
Example: Suppose a fair coin is tossed twice. Let X be the number of heads
in the two tosses of a coin.
We have
S={(HH),(HT), (TH), (TT)}
Then, the value of X, if no heads appear
TT
in the two tosses0of the coin is 0 i.e
X(TT)=0 X
TH
and X(HT)=X(TH)=1 HT 1
X(HH)=2 HH
2
Thus, X={0,1,2}
A RV is usually denoted by upper case letters: X, Y, Z….
2-3
TYPES OF RANDOM VARIABLES
Discrete random variable: A random variable X is called
discrete (or of the discrete type), if X takes on a finite or countable
infinite number of values;
That is, either finitely many values such as x1, . . . , xn, or countable
infinite many values such as x0, x1, x2, . . . .
Let X be number of heads in n Tosses of a coin.
Then, X=0,1,2,3,4……n
Let Y be number of car accidents per week.
Then, Y= 0,1,2…..
Continuous random variable: assume any values in a
given interval.
Take whole or fractional number.
Obtained by measuring.
Take infinite number of values in an interval.
For example, let X be the a certain person’s waiting time for a bus
which arrives every five minutes. Then, {X: 0<x<5}
2-4
PROBABILITY DISTRIBUTIONS
Definition: a probability distribution a random variable
consists of all possible values the RV with its
corresponding probabilities.
There are two types of probability distribution associated
with the type of random variables.
These are:
A) Discrete probability distribution
B) Continuous probability distribution
2-5
A) DISCRETE PROBABILITY DISTRIBUTION
Definition: Discrete probability distribution of a random
variable, X also known as Probability mass function (pmf),
denoted by P(x) , is a list of all possible values of X along
with the point probabilities of X.
X=𝑥𝑖 𝑥1 𝑥2 𝑥3 … … … . 𝑥𝑛
P(x)=P(X=𝑥𝑖 ) P(X=x1) P(X=x2) P(X=x3) …….P(X=xn)
The Probability mass function (pmf) , P(x) of a discrete RV,
X must satisfy the following two conditions.
i. 𝑷(𝒙) ≥ 0 for all x.
𝒏
ii. 𝒊=𝟏 𝑷(𝑿 = 𝒙𝒊 )=1
2-6
DISCRETE PROBABILITY DISTRIBUTION CONT……
Example1 : Let X be the number of heads in three tosses of a
fair coin.
a) Construct the Probability mass function (pmf) of X.
b) Find P(1<X ≤ 3)
Exercise:Find
1.P(X≤3) , 2.P(X<3) ,3.P(1≤X≤3)
Example 2: A shipment of 20 similar laptop computers to a
retail outlet contains 3 that are defective. If a school makes
a random purchase of 2 of these computers, find the
probability distribution for the number of defectives. Check
that p(x) is pmf
2-7
DISCRETE PROBABILITY DISTRIBUTION CONT…..
Solution:
a) First identify the possible value that X can assume i.e
X={0,1,2,3}
Then, calculate the probability of each possible distinct
value of X i.e P(X=0)=1/8 , P(X=1)=3/8 , P(X=2)=3/8 and
P(X=3)=1/8
Thus, the pmf of X can be given as:
𝑃 (1 < 𝑥 ≤ 3) = 𝑃(𝑋 = 𝑋𝑖 ) = 𝑃 (𝑋 = 2) + 𝑃 (𝑋 = 3)
b) 𝑖=2
3 1
= + = 0.5
8 8
2-8
DISCRETE PROBABILITY DISTRIBUTION CONT…..
Solution: Let X be a random variable whose values x are
the possible numbers of defective computers purchased
by the school. Then x can only take the numbers 0, 1, and
2. Now
2-9
B) CONTINUOUS PROBABILITY DISTRIBUTION
Definition: Continuous probability distribution of a
continuous R.V, X also known as Probability density
function(pdf) and denoted by f(x) is a real valued
function which satisfies the following conditions:
i. f (x)≥0 for all x.
∞
ii. −∞
f x =1
If X is a continuous random variable and a and b are real
constants with a ≤ b, then
P (a ≤ x ≤ b) = P (a < x ≤ b) = P (a ≤ x < b) = P (a < x < b)
2-10
PROPERTIES OF CONTINUOUS PROBABILITY DISTRIBUTION
Let X be continuous RV with pdf, f (x) and a and b are constants.
Where -∞ < 𝑥 < ∞
Then,
∞
1. The total area under the graph of f(x) is 1 i.e −∞
f x =1
2. The sub area under the graph of f(x) between points a and b is
b
a
f x dx
3. The probability that X lies between any two points a and b where
p(a<b) is :
b
P(a < x < b)= P(a ≤ x ≤ b)=P(a < x ≤ b)=P(a ≤ x < b)= a
f x dx
4. P x=a =0
b
5. P x≤b =P x<b = −∞
f x dx
∞
6. P x≥a =P x>a = 𝑎
f x dx
2-11
CONTINUOUS PROBABILITY DISTRIBUTION
Example: Suppose that the r-v X is continuous with the pdf of
Then find
a) Check that f (x) is a pdf
b) b) Find P(x<0.5)
c) P (1<x<1.5)
2-12
CONT….
Hence, f (x) is the pdf of some r-v X
DISTRIBUTION FUNCTIONS FOR DISCRETE RANDOM VARIABLES 2-13
Cumulative Distribution Function (CDF), is a
fundamental concept in probability theory and statistics
that provides a way to describe the distribution of the
random variable.
The CDF starts at 0 for the smallest possible value of X
and increases to 1 as x approaches the largest possible
value of X.
It is a non-decreasing function that provides a complete
description of the distribution of the random variable.
If X is a discrete random variable, the function given by
F(X)=P(X≤x) = 𝑡≤𝑥 𝑓(𝑡) for all x in R and 𝑡 ∈ 𝑥
Where f(t) is the value of probability distribution or p.m.f
of X at t, is called the distribution function, or the
cumulative distribution function of X.
2-14
If X takes on only a finite number of values x1, x2, . . . , xn, then
the distribution function is given by:
2-15
CONT…
2-16
DISTRIBUTION FUNCTIONS OF CONTINUOUS RANDOM VARIABLES
If X is a continuous random variable and the value of its probability density is f
𝑥
(t), then function given by 𝐹 𝑋 = 𝑃(𝑋 ≤ 𝑥) = −∞ 𝑓 𝑡 𝑑𝑡 is called the
distribution function, or the cumulative distribution of the continuous [Link].
Theorem: If f (x) and F(x) are the values of the probability density and the
distribution function of X at x, then P (a ≤ x ≤ b) = F(b) - F(a)
2-17
FUNCTIONS OF RANDOM VARIABLES
In probability and statistics, a function of a random variable refers to a
new random variable created by applying a mathematical function to an
existing random variable.
If ( X ) is a random variable and ( g ) is a function, then ( Y = g(X) ) is
also a random variable. or
If ( X ) is a random variable with a known probability distribution,
applying a function ( g ) to ( X ) transforms it into a new random
variable ( Y ).
Example: If ( X ) represents the outcome of rolling a die, and ( g(X) =
X^2 ), then ( Y = X^2 ) represents the square of the die roll.
Functions of discrete random variables
If X is a discrete random variable and Y is a function of X, then it
follows immediately that Y is also discrete.
Suppose that X is a discrete random variable with probability distribution
p(x), and,
let Y = g(X) define a one-to-one transformation between the values of X
and Y so that the equation y = g(x) can be uniquely solved for x in terms
of y, say x = w(y). Then the probability distribution of Y is p(y) =
p[w(y)].
2-18
CONT…
FUNCTIONS OF CONTINUOUS RANDOM VARIABLES 2-19
2-20
Identify the Distribution of X
Given:
f(x)=x/12,1<x<5
This is actually the probability density function (pdf) of X
since:
5 𝑥 𝑥2 25 1
1 12
dx = from 1 up to5 = − =1
24 24 24
Step 2: Define the Transformation
Let:
Y=2X−3 We aim to find the pdf of Y, denoted fY(y).
fX(x)=x/12,1<x<5
Step 3: Determine the Range of Y
Since X∈(1,5), then:
Y=2X−3∈(2⋅1−3,2⋅5−3)=(−1,7)
Step 4: Find the Inverse Transformation 2-21
Solve for X in terms of Y
Y=2X−3 = Y+3=2x
x=y+3/2
Step 5: Compute the Jacobian
dX/dY = ½
Step 6: Apply the Transformation Formula
Using the formula:
fY(y)=fX(x)⋅dY/dX
Substitute x=y+3/2
𝑦+3
2 1 𝑦+3
fY(y)= . =
12 2 48
the probabilista density función of y is
(𝑦+3)/48 for -1<y<7