MS230400002 cs723 Assign2
MS230400002 cs723 Assign2
Maximum Marks: 50
Instructions
Due Date: 14
May 2024
The purpose of this assignment is to give your hands-on practice. It is expected that students will
solve the assignment themselves. The following rules will apply during the evaluation of the
assignment.
• Cheating from any source will result in zero marks in the assignment.
• The submitted assignment does NOT open or the file is corrupted.
• No assignment after the due date will be accepted.
The objective of this assignment is to apply and analyze the concepts of probability distribution
theory for discrete and continuous random variables.
After completing the assignment, the student will be able to solve Probability distribution related
problems for discrete and random variables.
Question No. 1
(25 Marks )
The joint probability function for two discrete random variables X and Y is given by
Find
a. the constant m. , plugging in values of x ( 1 to 4) and y(1 to 3)
Solution:
X(vertical) | Y(horizontal 1 2 3
1 m 2m 3m
2 2m 4m 6m
3 3m 6m 9m
4 4m 8m 12m
since total probability is 1, so adding all the probabilities of all the columns we get 60m
60m = 1 , => m = 1/60 Answer
b. P(X= 2, Y =3)
Virtual University of Pakistan MSCS Spring 2024
Solution:
X(vertical) | Y(horizontal 1 2 3
1 m 2m 3m
2 2m 4m 6m
3 3m 6m 9m
4 4m 8m 12m
X=2 is horizontal line colored green, Y =3 is vertical column colored purple. P(x=2,y=3) is
marked in yellow = 6m,
c.
X(vertical) | Y(horizontal 1 2 3
1 m 2m 3m
2 2m 4m 6m
3 3m 6m 9m
4 4m 8m 12m
Solution: probability of X(between 1 and 4 ) and Y (between 0 and 2) is yellow shaded region
we can take the sume of all the probabilities in shaded region to get the total probability
m + 2m + 3m + 4m +2m + 4m + 6m + 8m = 30m ,
total probability = 60 m
d.
X(vertical) | Y(horizontal 1 2 3 sum of
X
Virtual University of Pakistan MSCS Spring 2024
1 m 2m 3m 6m
2 2m 4m 6m 12m
3 3m 6m 9m 18m
4 4m 8m 12m 24m
sum of Y) 10m 20m 30m 60m
Solution: P( X < 4) = X = 1, 2, 3 is the shaded yellow region in the figure , adding the
probabilities we get 36m
e.
X(vertical) | Y(horizontal 1 2 3
1 m 2m 3m
2 2m 4m 6m
3 3m 6m 9m
4 4m 8m 12m
sum 10m 20m 30m
Solution:
the probability Y < 2 is Y = 1 column shaded yellow. adding all the probabilities in the column
we get 10m , divided by total probability we get
10m/60m = 1/6 Answer
Virtual University of Pakistan MSCS Spring 2024
f.
X(vertical) | Y(horizontal 1 2 3
1 m 2m 3m
2 2m 4m 6m
3 3m 6m 9m
4 4m 8m 12m
Solution: P( X = 4 ) is row shaded yellow in the figure , adding all the probabilities we get
24m, divided by total probability = 60m = 24m/60m = 2/5 Answer
g.
X(vertical) | Y(horizontal 1 2 3
1 m 2m 3m
2 2m 4m 6m
3 3m 6m 9m
4 4m 8m 12m
Solution:
P(Y=3) is column shaded yellow in the figure. Adding all the probabilities we get 30m, divided
by total probability of 60m = > 30m/60m = 1/2 Answer
Solution:
X and Y are independent variables since X=1 or 2 or 3 does not change the probability of Y = 3
these all probabiliities remain 1/10 = P(X = 1, Y= 3 ) = P ( X =1 and Y =3 ) / P ( Y= 3)
P(X=1,Y=3) = (1/20)/(1/2) = 1/10 which is same as P (X=2 , Y=3) so the X does not influence
the outcome Y so both the X and Y are independent random variables.
Virtual University of Pakistan MSCS Spring 2024
j. ….Conditional Probability
Solution:
P(X=2 / Y < 2 ) = P ( X = 2 and Y = 1)/P(Y=1)
X(vertical) | Y(horizontal 1 2 3 sum of
X
1 m 2m 3m 6m
2 2m 4m 6m 12m
3 3m 6m 9m 18m
4 4m 8m 12m 24m
sum of Y) 10m 20m 30m 60m
from the table P(X = 2 and Y = 1 ) is 2m = 2/60 = 1/30
P(Y = 1 ) is 10m = 10/60 = 1/6
solving conditional probability = (1/30) / (1/6) = 1/5 Answer
Virtual University of Pakistan MSCS Spring 2024
Question No. 1
(25 Marks = 5
+10+10)
Find
a. The constant k.
Solution: This is a probability density function , if we take the integral of this equation, it will be
equal to 1 , as sum of all probabiliites is equal to 1.
limx→+∞tan−1(x)=π2
limx→−∞tan−1(x)=−π2
∀ tan−1x∈(−π2,π2), x∈(−∞,∞)
Solution:
= > (4/3pi)(tan-1(1/3) - tan-1(1/3√3) = > (4/3pi) (0.3217 - 0.19) = 0.424*0.13 = 0.055 Answer