Lecture Note L3
Lecture Note L3
Lecture Note L3
Fall 2023
Ch 02: 2
Probability theory
Random variables
Fall 2023
Ch 02: 3
Probability theory
Random variables
EXAMPLE 2.1
Fall 2023
Ch 02: 4
Probability theory
Random variables
Thus, for example, in the case of HH (i.e., 2 heads), X = 2
while for TH (1 head), X = 1. It follows that X is a random
variable.
Fall 2023
Ch 02: 5
Probability theory
Random variables
Definition:
A random variable X is a function defined on S, which takes
values on the real axis
X: S → R
Sample space Real numbers
Fall 2023
Ch 02: 6
Probability theory
Random variables
Example:
Random variable Type
Number of eyes when rolling a dice discrete
The sum of eyes when rolling two dice discrete
discrete
counting
Number of children in a family
Age of first-time mother discrete
Time of running 5 km continuous
Amount of sugar in a coke continuous measure
Height of males continuous
Fall 2023
Ch 02: 7
Discrete random variable
Probability function
Definition:
Let X : S → R be a discrete random variable.
3. P(X = x) = f(x),
where P(X=x) is the probability for the outcomes sS : X(s) = x.
Fall 2023
Ch 02: 8
Discrete random variable
Probability function
Example: Find the Probability function for the number of
heads when flipping three coins. Let X : # heads.
Solution: S={HHH, HHT, HTH, THH, TTH, THT, HTT, TTT}
X : S → {0,1,2,3}
Outcome Value of X Probability function
TTT x=0 f(0) = P(X=0) = 1/8
HTT, TTH, THT x=1 f(1) = P(X=1) = 3/8
HHT, HTH, THH x=2 f(2) = P(X=2) = 3/8
HHH x=3 f(3) = P(X=3) = 1/8
Fall 2023
Ch 02: 9
Discrete random variable
Probability function
Example:
A pair of fair dice is tossed. Let X assign to each point (a,b) in S the
maximum of its numbers, i.e. X(a,b) = max (a,b). Find f(x).
Solution:
We obtain the sample space S consisting of the 36 ordered pairs of
numbers between 1 and 6:
X : S → {1, 2, 3, 4, 5, 6}
Fall 2023
Ch 02: 10
Discrete random variable
Probability function
We compute the distribution f (x):
x 1 2 3 4 5 6
f(x) 1/36 3/36 5/36 7/36 9/36 11/36
Fall 2023
Ch 02: 11
Discrete random variable
Probability function
The graph of the distribution function f(x) with x is:
Fall 2023
Ch 02: 12
Discrete random variable
Probability function
Example:
Now let Y assign to each point (a,b) in S the sum of its numbers, i.e.
Y(a,b) = a + b. Find f(y).
Solution:
S = {(1, 1), (1,2), ..,(6,6) }
Then Y is a random variable
Y : S → {2, 3, 4, 5, 6, 7, 8, 9,10,11,12}
This information is put in the form of a table as follows:
y 2 3 4 5 6 7 8 9 10 11 12
f(y) 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36
Fall 2023
Ch 02: 13
Discrete random variable
Probability function
The graph of the distribution function f(y) with y is:
Fall 2023
Ch 02: 14
Discrete random variable
Probability function
Example:
A coin weighted so that P(H) = 2/3 and P(T) = 1/3 is tossed three
times. Let X be the random variable which assigns to each point in S
the largest number of successive heads which occurs. Find the
distribution function f(x).
Solution:
Fall 2023
Ch 02: 15
Discrete random variable
Probability function
The probabilities of the points in S are as follows:
Fall 2023
Ch 02: 16
Discrete random variable
Probability function
Assign a number for each out come, i.e. Get the values of X:
Fall 2023
Ch 02: 17
Discrete random variable
Probability function
Assign a number for each out come, i.e. Get the values of X:
x f(x)=P(X=x)
0 P(TTT)= 1/27
P(HTT, THT, TTH)=
1
2/27+2/27+2/27 =6/27
2 P(HHT,THH,HTH) = 4/27+4/27+4/27= 12/27
3 P(HHH) = 8/27
x 0 1 2 3
f(x) 1/27 6/27 12/27 8/27
Fall 2023
Ch 02: 18
Example
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.
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.
Fall 2023
Discrete random variable Ch 02: 19
Definition:
Let X : S → R be a discrete random variable with
probability function f(x).
Fall 2023
Ch 02: 20
Discrete random variable
Cumulative distribution function
0 1 2 3 x 0 1 2 3 x
Fall 2023
Ch 02: 21
Continuous random variable
Fall 2023
Ch 02: 22
Continuous random variable
Density function
Definition:
Let X: S → R be a continuous random variables.
Note!! Continuity: P(a < X < b) = P(a < X < b) = P(a < X < b) = P(a < X < b)
Fall 2023
Ch 02: 23
Continuous random variable
Density function
Example: X: service life of car battery in years (contiuous)
Density function: 0.5
0.3
0.1
0 otherwise 0
1 3.5 6
3
= = 0.68
Fall 2023
Ch 02: 24
Continuous random variable
Density function
Alternative solution:
0,5
0,3
f ( x) = 0.96 − 0.16x for 3.5 x 6 0,2
0 othwerwise 0,1
0
1 3 3,5 6
= = 1 − 0.32 = 0.68
Fall 2023
Ch 02: 25
Continuous random variable
Density function
Example: Suppose that the error in the reaction temperature, in oC,
for a controlled laboratory experiment is a continuous random variable X
having the probability density function
Fall 2023
Ch 02: 26
Continuous random variable
Density function
Solution:
(a) Obviously, f(x) ≥ 0. To verify condition 2 in Definition, we have
Fall 2023
Ch 02: 27
Continuous random variable
Density function
Definition:
Let X : S → R be a contiguous random variable with density
function f(x).
3 0,4
= f ( x ) dx 0,3
− 0,2
3 0,1
= − 0.16 + 0.16x dx 0
1 3 3,5 6
1
= = 0.32
Fall 2023
Ch 02: 28
Continuous random variable
Density function
From the definition of the cumulative distribution funct. we get:
0,5
0,4
0,3
0,2
0,1
0
1 a 3,5 b 6
Fall 2023
Ch 02: 29
Continuous random variable
Density function
Example: For the density function of the previous Example, find F(x),
and use it to evaluate P(0 < X ≤ 1).
Solution:
For −1 < x < 2,
Therefore,
Fall 2023
Ch 02: 30
Continuous random variable
Density function
The cumulative distribution function F(x) is expressed in the Figure
shown.
Fall 2023
Continuous random variable Ch 02: 31
Example:
The Department of Energy (DOE) puts projects out on bid and
generally estimates what a reasonable bid should be. Call the
estimate b. The DOE has determined that the density function of
the winning (low) bid is
Find F(y) and use it to determine the probability that the winning
bid is less than the DOE’s preliminary estimate b.
Fall 2023
Ch 02: 32
To determine the probability that the winning bid is less than the
preliminary bid estimate b, we have
Fall 2023
Ch 02: 33
Fall 2023
Ch 02: 34
Joint distribution
Joint probability function
it desirable to record the simultaneous outcomes of several random
variables. For example:
• In wireless communication systems, the joint distribution of
received signal strength and noise power may be studied to
analyze system performance and optimize receiver design.
Definition:
Let X and Y be two discrete random variables.
The joint probability function f(x,y) for X and Y
Is defined by
1. f(x,y) 0 for all x and y
2. f ( x, y ) = 1
x y
Fall 2023
Example of Joint probability distribution Ch 02: 36
Example:
Let's say we have a function f(X, Y) that represents the probability
of a smartphone needing Y replacement components after being
used for X hours. So, if X represents the number of hours the
smartphone has been used and Y represents the number of
components that need replacement, then f(2000, 2) could
represent the probability that a smartphone used for 2000 hours
requires 2 replacement components.
Fall 2023
Ch 02: 37
Joint distribution
Joint probability function
Example:
Two ballpoint pens are selected at random from a box that contains 3 blue
pens, 2 red pens, and 3 green pens. If X is the number of blue pens selected
and Y is the number of red pens selected, find
(a) the joint probability function f(x, y),
(b) P[(X, Y) ∈ A], where A is the region {(x, y)| x + y ≤ 1}.
Solution
Fall 2023
Ch 02: 38
Joint distribution
Joint probability function
The possible pairs of values (x, y) are (0, 0), (0, 1), (1, 0), (1, 1), (0, 2), and (2, 0).
Fall 2023
Ch 02: 39
Joint distribution
Joint density function (continuous)
Definition 3.9:
Let X and Y be two continuous random variables.
The joint density function f(x,y) for X and Y is
defined by
1. f(x,y) 0 for all (x,y)
2. − − f ( x, y ) dx dy = 1
3. P(a < X< b, c<Y< d) = c f ( x, y) dx dy
d b
Fall 2023
Joint distribution Ch 02: 40
Example:
Fall 2023
Ch 02: 41
Fall 2023
Ch 02: 42
Joint distribution
Marginal probability function
Definition:
Let X and Y be two discrete random variables with joint
probability function f(x,y).
The marginal probability function for X is given by
g(x) = y f(x,y) for all x
Fall 2023
Ch 02: 43
Joint distribution
Marginal probability function
Example:
The joint probability function f(x,y) for X and Y where X
is the number of blue pens selected and Y is the number of
red pens selected is given by
h(y)
a) Probability of one red pen is
selected
P(Y =1)=h(1)= 3/14+3/14+0 = 3/7
Fall 2023
Ch 02: 44
Joint distribution
Marginal density function
Definition:
Let X and Y be two continuous random variables with
joint density function f(x,y).
The marginal
density function for X is given by
g ( x) = f ( x, y) dy
−
for all x
The marginal density function for Y is given by
h( y ) = f ( x, y) dx
−
for all y
Fall 2023
Ch 02: 45
Joint distribution
Marginal density function
Example
Joint density f(x,y) for X and Y: 2
2
1.5
(2x + 3y) 0 x 1, 0 y 1
f(x, y) = 5 1
1
0 otherwise 0.5
0 0.5
Fall 2023
Ch 02: 46
Joint distribution
Conditional density and probability functions
Definition:
Let X and Y be random variables (continuous or discrete)
with joint density/probability function f(x,y). Then the
Conditional density/probability function for Y given X=x is
Fall 2023
Ch 02: 47
Joint distribution
Conditional probability function
Example:
Joint probability function
f(x,y) for X and Y is given by:
h(y)
• P(Y=1 | X=1 ) = f(1|1)
= f(1,1) / g(1)
= (3/14) / (15/28)
= 6/15
g(x)
• P(Y>=1 | X=0 ) =
3 1
+ 7
14 28
= 10 =
10
28
Fall 2023
Ch 02: 48
Joint distribution
Conditional probability function
Examples:
The joint density for the random variables (X, Y ), where X is the unit
temperature change and Y is the proportion of spectrum shift that a certain
atomic particle produces, is
(a) Find the marginal densities g(x), h(y), and the conditional density f(y|x).
(b) Find the probability that the spectrum shifts more than half of the total
observations, given that the temperature is increased by 0.25 unit.
Fall 2023
Ch 02: 49
Joint distribution
Conditional probability function
Examples:
The joint density for the random variables (X, Y ), where X is the unit
temperature change and Y is the proportion of spectrum shift that a certain
atomic particle produces, is
(a) Find the marginal densities g(x), h(y), and the conditional density f(y|x).
(b) Find the probability that the spectrum shifts more than half of the total
observations, given that the temperature is increased by 0.25 unit.
Fall 2023
Ch 02: 50
Joint distribution
Conditional probability function
Examples:
The joint density for the random variables (X, Y ), where X is the unit
temperature change and Y is the proportion of spectrum shift that a certain
atomic particle produces, is
(a) Find the marginal densities g(x), h(y), and the conditional density f(y|x).
(b) Find the probability that the spectrum shifts more than half of the total
observations, given that the temperature is increased by 0.25 unit.
Fall 2023
Ch 02: 51
Example
Solution
Fall 2023
Ch 02: 52
Fall 2023
Ch 02: 53
Joint distribution
Independence
Definition:
Two random variables X and Y (continuous or discrete) with
joint density/probability functions f(x,y) and marginal
density/probability functions g(x) and h(y), respectively, are
said to be independent if and only if
f(x,y) = g(x) h(y) for all x,y
Fall 2023
Ch 02: 54
Example
Solution:
Since X1, X2, and X3 are independent
Fall 2023