Solutions of Assignment 1
Solutions of Assignment 1
Solutions of Assignment 1
2018
Solutions of Assignment 1:
Instructor: Sourav Chakraborty Scribe: Debasmita Bhoumik
Problem 1: Let R, S and T be three sets. Answer whether the following statements
are true or false. In either case present a proof:
(a) (R ∪ S) = (R ∪ T ) =⇒ (S = T )
Answer: FALSE
Proof. (Proof by counter example.)
Let, R = {1, 2, 3, 4}, S = {3}, T = {4}.
R ∪ S = {1, 2, 3, 4}
R ∪ T = {1, 2, 3, 4}
∴R∪S =R∪T
But S 6= T . 2
(b) (R ⊆ S) =⇒ ((R ∩ T ) ⊆ (S ∩ T )))
Answer: TRUE
Proof. Let x ∈ R.
As R ⊆ S, x ∈ S too.
If x ∈ R ∩ T ,
x ∈ R and x ∈ T
=⇒ x ∈ S and x ∈ T
=⇒ x ∈ (S ∩ T )
∴ (R ∩ T ) ⊆ (S ∩ T )
∴ (R ⊆ S) =⇒ ((R ∩ T ) ⊆ (S ∩ T )). 2
(c) (S ⊆ T ) ⇐⇒ ((S ∩ T ) = S)
Answer: TRUE
Proof. This has two parts.
∴ (S ∩ T ) = S
1-1
=⇒ x ∈ (S ∩ T ) [as S ∩ T = S]
=⇒ x ∈ S and x ∈ T
∴x∈T
∴S⊆T
∴ ((S ∩ T ) = S) =⇒ (S ⊆ T )
So (S ⊆ T ) ⇐⇒ ((S ∩ T ) = S) 2
(d) (R ∪ S) = (R ∪ T ) ⇐⇒ ((S-R) = (T -R))
Answer: TRUE
Proof. This has two parts.
∴ (S − R) ⊆ (T − R)
∴ (T − R) ⊆ (S − R)
∴ (T − R) = (S − R)
∴ (R ∪ S) = (R ∪ T ) =⇒ ((S-R) = (T -R))
Now we have to proof the converse.
Proof. Let, x ∈ S ∩ T
∴ x ∈ P (S ∩ T )
1-2
Now, x ⊆ S ∩ T
=⇒ X ⊆ S ∧ x ⊆ T
=⇒ x ∈ P (S) ∧ x ∈ P (T )
=⇒ x ∈ P (S) ∩ P (T )
∴ P (S ∩ T ) ⊆ P (S) ∩ P (T )
∴ P (S) ∩ P (T ) ⊆ P (S ∩ T )
∴ P (S ∩ T ) = P (S) ∩ P (T ). 2
(f) (S × T )c = S c × T c
Answer: FALSE
1-3
(c) The relation “is connected to” for a pair of vertices in an undirected graph is an
equivalence relation.
Answer: TRUE
Proof.
• Reflexive: Let V is the set of vertices, v ∈ V .
Now, v is connected to v.
∴ vRv exists.
• Symmetric: Let u, v ∈ V .
Now, if uRv (u is connected to v) then vRu (v is connected to u) by going
through the edges in the reverse order.
• Transitive: Let u, v, w ∈ V .
Now, if uRv and vRw, then uRw, by first going from u to v and then going
from v to w,
∴ It is an equivalence relation.
2
Problem 3: Is the relation “is at least as popular as” a valid ordering and if so is it a
partial ordering or a total ordering?
Proof.
Proof of non-transitive: (by counter example)
Let us assume it is transitive.
Therefore if there are 3 contestants A, B and C. Then if A > B and B > C then it
1-4
must be A > C.
Let there are 3 voters, namely 1, 2 and 3. Their preferences for contestants are as
follows in Table.
1 2 3
a b c
b c a
c a b
Table 1: Preference
Problem 5: How many functions are there from a domain of size n to a range of size
m?
For each element of domain (=n) we can have m different functions.
D = {x1 , x2 , ...xn }
R = {y1 , y2 , ...ym }
The set of functions S={f (x1 ), f (x2 ), ..., f (xn )}
Now, f (x1 ) can be chosen in m ways, f (x2 ) can be chosen in m ways, and so on..
The number of functions =
m ∗ m ∗ m ∗ ... ∗ m [n times]=mn
Problem 6: How many one to one functions are there from a domain of size n to a
range of size m?
There can be two cases.
1-5
Case 1: If m ≥ n:
There will be m ways to map 1st element, m − 1 ways to map 2nd element, m − 2
ways to map 3rd element, ... , (m − n + 1) way to map nth element.
So, m∗(m−1)∗(m−2)∗....∗(m−n+1) = m!/(m−n)! =m Pn number of into functions.
Case 2: If m < n:
Not possible.
Problem 7: How many onto functions are there from a domain of size n to a range of
size m?
Let S be the domain of size n and R be the range of size m, with m ≤ n. If m > n
then the number of onto functions from S to R is 0.
Let R = {y1 , . . . , ym }.
Any function f from S to R is defined by the sets f −1 (y1 ), . . . , f −1 (ym ).
If f is onto we have the additional property that for all i f −1 (yi ) is non-empty.
So the number of onto functions from S is to R is the number of ways the elements
of S can be partitioned into m non-empty subsets.
This number is
m
i m
X
(−1) (m − i)n .
i
i=0
1-6