Assignment 3
Assignment 3
Q1. In the Advanced Placement (AP) programs of high schools, during the senior year 40% of
students study subject D, 45% study subject E, and 50% study subject F. It is also known that
10% study both subjects D and F, 20% study both subjects E and F, 15% study subject D but
neither subject E nor F. Only 5% of the students study all three subjects.
(a) Define the random variable X as the number subjects taken (out of D, E, and F) by AP
students during the senior year. Obtain the probability mass function and cumulative distribution
function of X and represent it in the tabular form.
Ans.
X=3
P(D ∩ E ∩ F)= 0.05 = P(X=3)
X=2
P(D ∩ Ec ∩ Fc)= P(D) – P(D∩E)-P(D∩F)+P(D∩E∩F)
0.15 = 0.40-X-0.10+0.05
X=0.20
X=1
Given P(D ∩ Ec ∩ Fc)= 0.15
P(E∩Dc∩Fc) = P(E) - P(E∩D∩Fc) - P(E∩F∩Dc) - P(E∩F∩D)
= 0.45 - 0.15 - 0.05 = 0.1
P(F∩Ec∩Dc) = P(F) - P(F∩D∩Ec) - P(F∩E∩Dc) - P(F∩E∩D)
= 0.50 - 0.5 - 0.5 - 0.15 = 0.25
P(X=1) = 0.15 + 0.1 + 0.25 = 0.5
X= 0
P(X=0)= 1- P(DuEuF)
= 1-[P(D)+P(E)+P(F)-P(D∩E)-P(D∩F)-P(E∩F)+P(D∩E∩F)]
= 1-[0.40+0.45+0.50-0.20-0.10-0.20+0.05]
= 1 - 0.90
= 0.10
PμF=
X PμF
0 0.10
1 0.5
2 0.35
3 0.05
CDF=
X CDF
0 0.10
1 0.10+0.5 = 0.6
2 0.6+0.35 = 0.95
3 0.95+0.05 = 1.0
Ans.
(a). Sum of probabilities = 1
X/Y -2 -1 0 1 2
-2 4 3 2 1 0
-1 3 2 1 0 1
0 2 1 0 1 2
1 1 0 1 2 3
2 0 1 2 3 4
Sum(X+Y)= 4+3+2+1+3+2+1+1+2+1+1+2+1+1+2+3+1+2+3+4= 40
Henceforth, C.40 = 1
C= 1
40
(c). P(X=1)
P(X=1) = y=-2∑2 P(X=1,Y=y)
= C[(1+(-2))+(1+(-1))+(1+0)+(1+1)+(1+2)]
= 1/40 (1+0+1+2+3)
= 7/40
(d). P(|X-Y|≤1)
|X-Y| -2 -1 0 1 2
-2 0 1 2 3 4
-1 1 0 1 2 3
0 2 1 0 1 2
1 3 2 1 0 1
2 4 3 2 1 0
Pairs are (-2,-1), (-1,-2), (-2,-2), (-1,-1), (-1,0), (2,2), (0,-1), (0,0), (0,1), (1,0), (1,1), (1,2), (2,1)
Referring to the above pairs we will take the value from the table.
P(|X-Y|≤1)= C. ∑|X+Y|
= 1/40 (4+3+2+3+1+1+0+1+1+2+3+3+4)
= 1/40 (28)
= 0.7
Conditional Probabilities:-
P(Y=-2|X=1)= 1/7
P(Y=-1|X=1)= 0
P(Y=0|X=1)= 1/7
P(Y=1|X=1)= 2/7
P(Y=2|X=1)= 3/7
Q3.
Ans.
(a) P(X=2)
P(X=2)= ∑P(X=2,Y=y)
= 0.05+0.06+0.09+0.04+0.03
= 0.27
Q4. Suppose that X and Y have a discrete joint distribution for which the joint p.f. is defined as
follows:
Ans.
(a).
Marginal p.f of X
The marginal p.f. of X, denoted by fX(x), is found by summing the joint p.f. f(x,y) over all possible
values of y:
For x =0
fX(0)= y=0∑3 f(0,y) = y=0∑3 1/30 (0+y)= 1/30 (0+1+2+3)= 6/30 = 1/5
For x=1
fX(1)= y=0∑3 f(1,y) = y=0∑3 1/30 (1+y)= 1/30 (1+2+3+4)= 10/30 = 1/3
For x= 2
fX(2)= y=0∑3 f(2,y) = y=0∑3 1/30 (2+y)= 1/30 (2+3+4+5)= 14/30 = 7/15
The marginal p.f. of X is:
1/5, for x=0
fX(x)= 1/3, for x=1
7/15, for x=2
Marginal p.f. of Y
The marginal p.f. of Y, denoted by fY(y), is found by summing the joint p.f. f(x,y) over all possible
values of x:
For y =0
fY(0)= x=0∑2 f(x,0) = x=0∑2 1/30 (0+x)= 1/30 (0+1+2)= 3/30 = 1/10
For y=1
fY(1)= x=0∑2 f(x,1) = x=0∑2 1/30 (1+x)= 1/30 (1+2+3)= 6/30 = 1/5
For y= 2
fY(2)= x=0∑2 f(x,2) = x=0∑2 1/30 (2+x)= 1/30 (2+3+4)= 9/30 = 3/10
For y= 3
fY(3)= x=0∑2 f(x,3) = x=0∑2 1/30 (3+x)= 1/30 (3+4+5)= 12/30 = 2/5
(b).For this we will be requiring to verify the joint probability mass function f(x,y) can be factored
as the product of the marginal p.f.s fX(x) and fY(y). That is, X and Y are independent if and only
if:
From part (a), we know the marginal p.f.s of X and Y, therefore the joint p.f. is given by:
1. x=0, y=0
f(0,0)= 1/30 (0+0)= 0
(c). To obtain the conditional distribution of Y given a specific value of X, we will be using the
method of conditional distribution mass function:
Therefore:-
fY|X(0|0) = f(0,0)/ fX(0)= 0/1/5 = 0
fY|X(1|0) = f(0,1)/ fX(0)= 1/30.(0+1)/1/5 = (1/30)/(1/5)= 1/6
fY|X(2|0) = f(0,2)/ fX(0)= 1/30.(0+2)/1/5 = (2/30)/(1/5)= 2/6= 1/3
fY|X(3|0) = f(0,3)/ fX(0)= 1/30.(0+3)/1/5 = (3/30)/(1/5)= 3/6= 1/2
Therefore:-
fY|X(0|1) = f(1,0)/ fX(1)= 1/30.(0+1)/1/3 = (1/30)/(1/3)= 1/10
fY|X(1|1) = f(1,1)/ fX(1)= 1/30.(1+1)/1/3 = (2/30)/(1/3)= 1/5
fY|X(2|1) = f(1,2)/ fX(1)= 1/30.(2+1)/1/3 = (3/30)/(1/3)= 3/10
fY|X(3|1) = f(1,3)/ fX(1)= 1/30.(3+1)/1/3 = (4/30)/(1/3)= 2/5
Therefore:-
fY|X(0|2) = f(2,0)/ fX(2)= 1/30.(0+2)/7/15 = (2/30)/(7/15)= 1/7
fY|X(1|2) = f(2,1)/ fX(2)= 1/30.(1+2)/7/15 = (3/30)/(7/15)= 3/14
fY|X(2|2) = f(2,2)/ fX(2)= 1/30.(2+2)/7/15 = (4/30)/(7/15)= 2/7
fY|X(3|2) = f(2,3)/ fX(2)= 1/30.(3+2)/7/15 = (5/30)/(7/15)= 5/14
(d). For the conditional mean of Y given X=x is defined as:
E[Y|X = x]= y∑ y.fY|X(y|x)
E[Y∣X=1]=2.00
E[Y∣X=2]=1.857
Q5. Consider the directed arc graphical model below for events A,B,...,E A D C E B
(a) Based on the dependence structure implied by the graphical model, write down the
factorization of the joint probability of events A,B,C,D,E and F.
(b) Based on the dependence structure implied by the graphical model, are there any
independent events ? Please explain your reasoning.
(c) Based on the dependence structure implied by the graphical model, which are the events
conditionally independent of event B ? Please explain your reasoning.
(d) Based on the dependence structure implied by the graphical model, which are the events
conditionally independent of event E ? Please explain your reasoning.
Ans.
Here, A and D are the parent nodes, and their probabilities are P(A) and P(D), respectively. C is
a child node of A and D, represented by P(C∣A,D). B is a child node of C and D, given by
P(B∣C,D). Lastly, E is a child node of C and B, represented by P(E∣C,B).
(b) Regarding the independence of events based on the graphical model's dependence
structure, A and D do not share a common parent node, nor is there any direct or indirect
connection between them. Therefore they are independent.
(c) Examining the dependence structure, we find that certain events are conditionally
independent of event B. From the factorization, we see that P(B∣C,D) indicates that B is
conditionally dependent on C and D. Similarly, P(E∣C,B) shows that B and E are conditionally
dependent. Therefore, D and E are not conditionally independent of B due to their direct or
indirect dependencies. However, A is conditionally independent of B given C and D.
P(B|C∩D) → B is conditionally dependent on C and D
(d)
Considering the dependence structure with respect to event E, we note that P(E∣C,B) indicates
that E is conditionally dependent on both B and C. Consequently, events A and D are
conditionally independent of event E when conditioned on C and B. Therefore, A and D are
conditionally independent of event E.