Spring 2024 - CS723 - 2 - SOL

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Virtual University of Pakistan MSCS Spring 2024

CS723 – Probability and Stochastic Processes


Assignment No.1 (Graded)

Maximum Marks: 50
Instructions
Due Date: 29 April 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.

Objective & Learning Outcome

The objective of this assignment is to apply and analyze set theory and initial concepts of
probability theory.

After completing the assignment, the student will be able to solve a Set/Probability related
problem.

Question No. 1 (25 Marks


= 15 + 10)
Virtual University of Pakistan MSCS Spring 2024

a) Assuming Universal set U = Set of integers, set A = Set of whole numbers, B = Set of
natural numbers and D= Set of +ive integers.
E = (A \ B) ∩ Dc
Where Dc is complement of D.
i. What will be E? Write all steps.
ii. Represent it in Venn diagram.

b) We have the following two binary relations represented in the form of ordered pairs.
f(x) = {(-3,11), (-2,6), (-1,3), (0,2), (1,3), (2,6)}
g(x) = {(-2,-3), (-1,-2), (0,-1), (1,0), (2,1), (3,2)}

You have to :
i. Show both of these binary relations are functions.
ii. Write the composition of these two functions i.e. f(g(x)).
iii. Write domain and range of these three functions.
iv. Try to deduce the composite function g(f(x)).

U =Set of Integers= { 0 ,± 1 , ±2 , ±3 ,± 4 ,± 5 , … }

A=Set of Whole Numbers={ 0 , 1 ,2 , 3 , 4 , 5 , … }


B=Set of Natural Numbers= {1 , 2 ,3 , 4 ,5 ,… }
+¿= {+1 ,+2 ,+3 ,+4 ,+5 , … }¿
D=Set of Positive Integers=Z
A ¿=A−B
A ¿={ 0 ,1 , 2 ,3 , 4 , 5 , … }− {1 , 2 ,3 , 4 ,5 , … }
A ¿={ 0 }
c
D =U −D

D = {0 ,± 1 ,± 2 , ±3 , ± 4 , ± 5 , … }−{+1 ,+2 ,+3 ,+4 ,+5 , …}


c

c
D ={0 ,−1 ,−2,−3 ,−4 ,−5 , … }

( A ¿ ) ∩ Dc ={0 }∩{0 ,−1 ,−2 ,−3 ,−4 ,−5 , … }


( A ¿ ) ∩ Dc ={0 }
( A ¿ ) ∩ Dc =E={0} THIS QUESTION IS TAKEN FROM
MC210202031
Virtual University of Pakistan MSCS Spring 2024

E={0 }
Virtual University of Pakistan MSCS Spring 2024
Virtual University of Pakistan MSCS Spring 2024

Venn Diagram

You have to :
i. Show both of these binary relations are functions.

f(x)
A B

-3
-2 11
-1 6
0 3
1 2
2 6

A relation f from a set A to a set B is said to be a function if every element of


set A has one and only one image in set B. In other words, no two distinct
elements of B have the same pre-image. We observed that Domian f = A and
every element of set A has one and only one image in set
B.
So the given above relation f(x) is a function.
We see that by putting different values the function f ( x )=x 2 +2…that’s
what…if you can…

g(x)

C D
Virtual University of Pakistan MSCS Spring 2024

-2
-3
-1
-2
0
-1
1
0
2
1
3
2

A relation f from a set C to a set D is said to be a function if every element of


set C has one and only one image in set D. In other words, no two distinct
elements of D have the same pre-image. We observed that Domian f = C and
every element of set C has one and only one image in set
D.
So the given above relation g(x) is a function.
We see that by putting different values the function g ( x )=x−1…that’s
what…if you can…

ii. We compute the value of f at outputs of g:


f(g(-2)) = f(-3) = 11
f(g(-1)) = f(-2) = 6
f(g(0)) = f(-1) = 3
f(g(1)) = f(0) = 2
f(g(2)) = f(1) = 3
f(g(3)) = f(2) = 6

f(g(x))= {(-2,11), (-1,6), (0,3), (1,2), (2,3), (3,6)}….Thats what I was


expecting…

OR….

Write the composition of these two functions i.e. f(g(x)).


Virtual University of Pakistan MSCS Spring 2024

f ( g ( x ) )=?
f ( g ( x ) )=f ( x−1 )
2
we know that : g ( x )=x−1∧f ( x )=x +2
f ( g ( x ) )=(x−1) + 2
2

f ( g ( x ) )=x +1−2 x +2
2

f ( g ( x ) )=x −2 x +3
2

iii. Domain and Range of f, g, and f(g)


f(x): Domain = {-3, -2, -1, 0, 1, 2}, Range = {11, 6, 3, 2}
g(x): Domain = {-2, -1, 0, 1, 2, 3}, Range = {-3, -2, -1, 0, 1, 2}
f(g(x)): Domain = {-2, -1, 0, 1, 2, 3}, Range = {11, 6, 3, 2}

OR…

For f ( x )=x 2 +2
Domain f ( x )=(−∞ ,+∞ )
Range f ( x )=¿

For g ( x )=x−1
Domain g ( x )=(−∞ ,+ ∞)
Range g ( x )=(−∞ ,+∞ )

For f ( g ( x ) )=x 2−2 x +3

Domain f ( g ( x ) )= (−∞ ,+ ∞ )
Range f ( g ( x ) )= [ +2 ,+ ∞ )

iv. Try to deduce the composite function g(f(x)).


We TRY to compute the value of g at outputs of f :
g(f(-3)) = f(11) = ?
g(f(-2)) = f(6) = ?

…From given info, its not possible to GET g(f(x))…

OR…
Virtual University of Pakistan MSCS Spring 2024

g ( f ( x ) )=g ( x 2 +2 )
g ( f ( x ) )=x +2−1
2

g ( f ( x ) )=x +1
2

Domain g ( f ( x ) )= (−∞ ,+ ∞ )
Range g ( f ( x ) )=¿

Question No. 2 (25 Marks


= 10+15)

a) A bag contains 3 red ,7 Blue and 10 green balls. three balls are drawn at random
without replacement.
i. If the second ball is red, what is the probability that the first and third balls are
green?
ii. what is the probability that the first two balls are blue?
Sol:
i. R=3, B=7, G=10
Since second ball drawn is red….means its done…it has happened…means P(R2)=1.
So, now # of red balls left for the first and third balls to be green to happen are 2.
Total # of balls = 19
P(G1)=10/19
P(G3)=9/18
P(G1G3)=10/19 * 9/18
=5/19

OR

A=first ball is green


B=second ball is red……………Its given that its done.
C=third ball is green

We need to find:
P ( B )
( A ∩C ) P ( A ∩ B ∩C )
=
P ( B)
P(A ∩ B ∩ C) = P(A) P(C/A) P(B/A∩C)
Virtual University of Pakistan MSCS Spring 2024

= (10/20) (9/19) (3/18)


= 3/36

P ( ( A ∩C
B ) 3/20
) 3/76
= P(B) = 3/20

= 5/19

ii. S = {BBR, BBB, BBG}


E = first two balls are blue
P(E) = P(BBR) + P(BBB) + P(BBG)
= (7/20)(6/19)(3/18) + (7/20)(6/19)(5/16) + (7/20)(6/19)(10/18)
= (7/20)(6/19){(3/18) + (5/16) + (10/18)}
= 21/190

b) A factory produces two types of silicon chips: type A(0.5mm), type B(0.4mm).
It produces the two types in a 20:80 mix. Though defectiveness is pretty low,
still estimates show that 2% of type A while 3% of type B are defective.
If a randomly chosen product is found, what is the probability that it belongs to type
A?

Solution:
20
Type A: ×100=20
100
80
Type B: ×100=80
100
Let A be the event that selected product is of type A
P¿

…Some of students took the following …

“If a randomly chosen product is found, what is the probability that it belongs to
type A?
AS
Virtual University of Pakistan MSCS Spring 2024

If a randomly chosen product is found to be defective, what is the probability that it


belongs to type A?

I awarded marks…

You might also like