Professional Documents
Culture Documents
Spring 2024 - CS723 - 2 - SOL
Spring 2024 - CS723 - 2 - SOL
Spring 2024 - CS723 - 2 - SOL
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.
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.
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 , … }
c
D ={0 ,−1 ,−2,−3 ,−4 ,−5 , … }
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
g(x)
C D
Virtual University of Pakistan MSCS Spring 2024
-2
-3
-1
-2
0
-1
1
0
2
1
3
2
OR….
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
OR…
For f ( x )=x 2 +2
Domain f ( x )=(−∞ ,+∞ )
Range f ( x )=¿
For g ( x )=x−1
Domain g ( x )=(−∞ ,+ ∞)
Range g ( x )=(−∞ ,+∞ )
Domain f ( g ( x ) )= (−∞ ,+ ∞ )
Range f ( g ( x ) )= [ +2 ,+ ∞ )
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 ) )=¿
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
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
P ( ( A ∩C
B ) 3/20
) 3/76
= P(B) = 3/20
= 5/19
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¿
“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
I awarded marks…