Lecture 9 Probability and Statistics
CEC217
Dr. Tarık Adnan
Email: tarikalmohamad@[Link] 1
Office: 104
The Conditional Distributions
Where 𝑓(𝑥, 𝑦) & 𝑔(𝑥) ; ℎ(𝑦) are the joint probability distribution
and the marginal distributions, respectively.
2
Cont.
• To find the probability that the discrete random variable 𝑋
falls between 𝑎 and 𝑏 when it is known that the discrete
variable 𝑌 = 𝑦, we evaluate:
𝑃 𝑎<𝑋<𝑏𝑌=𝑦 = 𝑓 𝑥𝑦 ,
𝑎<𝑥<𝑏
• When 𝑋 and 𝑌 are continuous, we evaluate
𝑏
𝑃 𝑎 < 𝑋 < 𝑏 𝑌 = 𝑦 = න 𝑓 𝑥 𝑦 𝑑𝑥
𝑎
3
Example
• Two ballpoint pens are selected at random from a box that
contains 3 blue pens, 2 red pens, and 3 green pens. ℎ(𝑦)
If 𝑋: the number of blue pens selected
𝑌: the number of red pens selected
Find the conditional distribution of 𝑋, given that 𝑌 = 1, and use it
to determine 𝑃(𝑋 = 0 |𝑌 = 1).
Solution: In order to find 𝑓(𝑥|𝑦), where 𝑦 = 1, We have to find ℎ 𝑦
first
2
ℎ 𝑦 = ℎ(1) = 𝑓(𝑥, 𝑦) = 𝑓 𝑥, 1 = 𝑓 0,1 + 𝑓 1,1 + 𝑓(2,1)
𝑥 𝑥=0
3 3 6 3
ℎ(1) = + +0= =
14 14 14 7 4
Solution (Cont.)
• Now the conditional distribution of the random variable 𝑋 given
ℎ(𝑦)
Y = 𝑦 where 𝑦 = 1:
𝑓(𝑥, 𝑦)
𝑓 𝑥𝑦 =
ℎ(𝑦)
𝑓(𝑥, 1) 𝑓(𝑥, 1)
𝑓 𝑥1 = = , 𝑥 = 0,1,2
ℎ(1) 3
7
Hence,
𝑓(0,1) 7 7 3 1
𝑓 01 = = 𝑓 0,1 = × =
3 3 3 14 2
7 7 7 3 1 7 7
𝑓 1 1 = 𝑓 1,1 = × = , 𝑓 2 1 = 𝑓 2,1 = × 0 = 0
3 3 14 2 3 3
5
Solution (Cont.)
Therefore, the conditional distribution of 𝑋, given that 𝑌 = 1, is
ℎ(𝑦)
• Determine 𝑃 𝑋 = 0 𝑌 = 1 :
1
𝑃 𝑋=0 𝑌=1 =𝑓 01 =
2
• Therefore, if it is known that 1 of the 2 pens selected is red, we
have a probability equal to 1/2 that the other pen is not blue
(i.e., 𝑋 = 0). 6
Example: (homework)
• The joint density for the random variables (𝑋, 𝑌), where 𝑋 is ℎ(𝑦)
the unit temperature change and 𝑌 is the proportion of
spectrum shift that a certain atomic particle produces, is
1- Find the marginal densities 𝑔(𝑥), ℎ(𝑦), and the conditional
density 𝑓(𝑦|𝑥).
2- Find the probability that the spectrum shifts more than half of
the total observations, given that the temperature is increased
by 0.25 unit.
7
Example: (homework)
• Consider the joint density of two random variables 𝑋 and 𝑌, ℎ(𝑦)
where 𝑋 represents a certain measurement change and Y is
the proportion of an effect observed. The joint density
function is given by:
8𝑥𝑦 3 , 0 < 𝑥 < 𝑦 < 1
𝑓 𝑥, 𝑦 = ቊ
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
a) Find the marginal densities 𝑔(𝑥), ℎ(𝑦), and the conditional
density 𝑓(𝑦|𝑥).
b) Calculate the probability that the observed effect is more
than 75% of the total observations, given that the measurement
change is 0.60 unit.
8
Mathematical Expectation
9
Mean of a Random Variable
• Let two coins are tossed 16 times and 𝑋 is the number of
heads that occur per toss, then the values of 𝑋 are 0 (no
heads), 1 (one head), and 2 (two heads).
• Suppose that the experiment yields no heads, one head, and
two heads a total of 4, 7, and 5 times, respectively. The
average number of heads per toss of the two coins is then
• This 1.06 is an average value of the data and yet it is not a
possible outcome of {0, 1, 2}. Hence, an average is not
necessarily a possible outcome for the experiment 10
Cont.
• The numbers 4/16, 7/16, and 5/16 are the fractions of the
total tosses resulting in 0, 1, and 2 heads, respectively. These
fractions are also the relative frequencies for the different
values of 𝑋 in the experiment
• This method of relative frequencies is used to calculate the
average number of heads per toss of two coins that we might
expect in the long run. This average value is the mean of the
random variable 𝑋 or the mean of the probability distribution of
𝑋 or the mathematical expectation or the expected value of the
random variable 𝑋, and denote it as 𝜇𝑥 or as 𝜇 or 𝐸(𝑋) 11
Example
• Assuming that 1 coin was tossed two times, we find that the
sample space for our experiment is
𝑆 = {𝐻𝐻, 𝐻𝑇, 𝑇𝐻, 𝑇𝑇}.
• Since the 4 sample points are all equally likely, it follows that
1
and 𝑃(𝑋 = 2) = 𝑃(𝐻𝐻) =
4
Where 𝑇𝐻, indicates that the first toss resulted in a tail followed
by a head on the second toss.
12
Cont.
• Now, these previous probabilities are just the relative
frequencies for the given events in the long run. Therefore
• This result means that a person who tosses 2 coins over
and over again will, on the average, get 1 head per toss.
13
Definition of Mean, or Expected value:
• The aforementioned method used to calculate the expected
number of heads per toss of 2 coins suggests that the mean, or
expected value, of any discrete random variable may be
obtained by multiplying each of the values 𝑥1 , 𝑥2 , . . . , 𝑥𝑛 of the
random variable 𝑋 by its corresponding probability
𝑓(𝑥1 ), 𝑓(𝑥2 ), . . . , 𝑓(𝑥𝑛 ) and summing up the products
14
Cont.
• Notice that the way to calculate the expected value, or mean,
shown here is different from the way to calculate the sample
mean described in previous chapters, where the sample
mean is obtained by using data.
• But in mathematical expectation, the expected value is
calculated by using the probability distribution.
15
Example
• A lot containing 7 components is sampled by a quality
inspector; the lot contains 4 good components and 3
defective components. A sample of 3 is taken by the
inspector. Find the expected value of the number of good
components in this sample.
Solution
Let 𝑋 represent the number of good components in the sample.
The probability distribution of 𝑋 is
16
Cont. 4 3 3!
0 3−0 3! 1
𝑓 0 = 7 = =
7! 35
3
3! × 4!
4 3
4! 3!
1 3−1 1! × 3! 2! 12
𝑓 1 = 7 = = ,
3
35 35
18
𝑓 2 = , 𝑓 3 = 4/35
35
Therefore, the expected value is:
Thus, if a sample of size 3 is selected at random over and over
again from a lot of 4 good components and 3 defective
components, it will contain, on average, 1.7 good components. 17
Example
• A salesperson for a medical device company has two
appointments on a given day. At the first appointment, he
believes that he has a 70% chance to make the deal, from which
he can earn $1000 commission if successful.
• On the other hand, he thinks he only has a 40% chance to make
the deal at the second appointment, from which, if successful, he
can make $1500. What is his expected commission based on
his own probability belief? Assume that the appointment results
are independent of each other.
Solution? 18
Solution
• There can be 4 possible commission totals: $0, $1000, $1500,
and $2500. We then need to calculate their associated
probabilities. By independence, we obtain:
Therefore, the average or the expected commission for the
salesperson is
19
Thank you
Feel free to ask questions
20 20