CS F222: Discrete Structures For Computer Science: Tutorial - 4 (Set Theory and Functions)
CS F222: Discrete Structures For Computer Science: Tutorial - 4 (Set Theory and Functions)
CS F222: Discrete Structures For Computer Science: Tutorial - 4 (Set Theory and Functions)
• If x ∈ S ∩ T , then x ∈ S.
• If x ∈ S − T , then also x ∈ S
(a) Let A = {a, b, c} and P(A) be the power set of A. Find the set P(A) × A.
(b) Find a set A such that A ⊆ A × A.
(c) Let A, B, C and D be sets such that A ⊆ C and B ⊆ D, show that A × B ⊆ C × D.
1
(d) Let A, B, C and D be sets such that A × B ⊆ C × D. Prove or disprove that A ⊆ C and B ⊆ D.
Solution: (a) Here, A = {a, b} and P(A) = {φ, {a}, {b}, {a, b}}.
Thus, P(A) × A = {(φ, a), (φ, b), ({a}, a), ({a}, b), ({b}, a), ({b}, b), ({a, b}, a), ({a, b}, b)}
(b) A = φ. Note that A × A = φ when A = φ.
(c) We know that A ⊆ C and B ⊆ D. To show that A × B ⊆ C × D, let (a, b) ∈ A × B where a ∈ A
and B ∈ B. Since A ⊆ C and B ⊆ D, a ∈ C and b ∈ D. Thus, (a, b) ∈ C × D. Hence, A × B ⊆ C × D.
(d) Not true. Let A = {a}, B = ∅, C = {c}, and D = {d}. In this case, A × B = φ, hence
A × B ⊆ C × D. But, A is not a subset of C.
2
5. Let A be a set with n elements. Prove that there are 2n binary relations on A by using mathemat-
ical induction. Also, compute that number of ternary relations on A and prove the correctness by
mathematical induction.
Solution:
We prove this by induction on number of elements in A i.e., n.
Base Case: If n = 0 then, number of relations is 20 = 1 (Empty set). If n = 1 then, number of binary
relations is 21 = 2 In particular, if A = {x} then, A × A = {(x, x)}).
Hypothesis: Assume that the statement is true for all sets with at most k elements where k ≥ 1.
Induction Step: Let A be the set with k + 1 elements, k ≥ 1. Let A = {x1 , x2 , ..., xk , xk+1 }. From hy-
2
pothesis, we know that for k elements, number of binary relations are 2k . For (k+1)th element, we have
the following 2k+1 binary elements: (x1 , xk+1 ), (x2 , xk+1 ), ..., (xk , xk+1 ), (xk+1 , x1 ), (xk+1 , x2 ), ..., (xk+1 , xk ), (xk+1 , xk+1
2 2 2
Therefore, number of binary relations for the set A = 2k × 22k+1 = 2k +2k+1 = 2(k+1)
3
The number of ternary relations on A are 2n .
6. Determine whether each of the following function is a bijection from R to R.
(a) f (x) = 2x + 1
(b) f (x) = −3x2 + 7
(c) f (x) = (x2 + 1)/(x2 + 2)
(d) f (x) = (x + 1)/(x + 2)
Solution:
(a) Yes. One-to-one: Let f (x1 ) = f (x2 ), which implies 2x1 + 1 = 2x2 + 1. Thus, x1 = x2 .
Onto function. Let y be a real number (in co-domain) such that f (x) = y, which gives us 2x + 1 = y.
Thus, x = (y − 1)/2 is also a real number. Thus, for any real number y in the co-domain, there exists
a pre-image (y − 1)/2 in the domain.
(b). No. The function is not one-to-one function. For x = 1 and x = −1, the function maps to the
same number 4 in the co-domain.
(c). No. The function is not one-to-one function. For x = 1 and x = −1, the function maps to the
same number 2/3 in the co-domain.
(d) No. The function is not define at x = −2.