Module 1 DM
Module 1 DM
2. Another way to describe a set is to use set builder notation. We characterize all
read “the set of all x such that x has property P.” For instance, the set O of all odd
Write the following sets using the roster method and set builder method:
set,or null set, and is denoted by ∅. The empty set can also be denoted by{ }
EMPTY SET There is a special set that has no elements. This set is called the empty
confuse the empty set ∅ with the set {∅}, which is a singleton set.
Singleton set A set with one element is called a singleton set. A common error is to
Power Sets Given a set S, the power set of S is the set of all subsets of the set S. The
power set of S is denoted by P(S).
Cartesian Products
A × B = {(a, b) ∣ a ∈ A ∧ b ∈ B}.
Question: What is the Cartesian product A × B × C, where A = {0, 1}, B = {1, 2},
and C = {0, 1, 2}?
∈ A,
Solution: The Cartesian product A × B × C consists of all ordered triples (a, b, c), where a
b ∈ B, and c ∈ C. Hence,
A × B × C = {(0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 2, 0), (0, 2, 1), (0, 2, 2),
(1, 1, 0), (1, 1, 1), (1, 1, 2), (1, 2, 0), (1, 2, 1), (1, 2, 2)}. ◂
Set Operations
Set operations can be defined as the operations that are performed on two or more sets
to obtain a single set containing a combination of elements from both the sets being
operated upon.
Union Let A and B be sets. The union of the sets A and B, denoted by A ∪ B, is the set
that contains those elements that are either in A or in B, or in both.
An element x belongs to the union of the sets A and B if and only if x belongs to A or x
belongs
A ∪ B = {x ∣ x ∈ A ∨ x ∈ B}.
to B. This tells us that
Intersection Let A and B be sets. The intersection of the sets A and B, denoted by A ∩
A ∩ B = {x ∣ x ∈ A ∧ x ∈ B}.
B, is the set containing those elements in both A and B.
The intersection of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 3}; that is,
{1, 3, 5} ∩ {1, 2, 3} = {1, 3}.
Difference Let A and B be sets. The difference of A and B, denoted by A − B, is the set
containing those elements that are in A but not in B. The difference of A and B is also
An element x belongs to the difference of A and B if and only if x ∈ A and x ∉ B. This tells
called the complement of B with respect to A.
A − B = {x ∣ x ∈ A ∧ x ∉ B}.
us that
A - B = {0,1}
Example: A={0,1,2} and B={2,3,4} set are given. Find A-B and B-A
B – A = {3,4}
Complement Let U be the universal set. The complement of the set A, denoted by Ac, is
the complement of A with respect to U. Therefore, the complement of the set A is U − A.
Remark: The definition of the complement of A depends on a particular universal set U.
This definition makes sense for any superset U of A. If we want to identify the universal
Ac = {x ∈ U ∣ x ∉ A}.
Example :Let A = {a, e, i, o, u} (where the universal set is the set of letters of the English
alphabet). Then Ac = {b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z}.
The symmetric difference between two sets A and B, which is denoted by A ⊕ B, is the
symmetric difference
A ⊕ B = (A ∪ B) - (A ∩ B)
set of elements that are in either of the sets but not in their intersection.
A ⊕ B = (A - B) ∪ (B - A)
A ⊕ B = {0,1,3,4}
Example: The symmetric difference of A={0,1,2} and B={2,3,4} is
Set Identies
Let U be the universal set, A,B and C are subsets of the universal set U.
A∩B=B∩A ; A∪B=B∪A
1. Commutative Laws.
(A ∪ B) ∪ C = A ∪ (B ∪ C) ; (A ∩ B) ∩ C = A ∩ (B ∩ C)
2. Associative Laws.
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
3. Distributive Laws
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C).
A ∪ ∅ = A; A ∩ U = A
4. Identity Laws
A ∪ A' = U ; A ∩ A' = ∅
5. Complement Laws
A∪A=A; A∩A=A
7. idempotent laws
A ∪ U = U; A ∩ ∅ = ∅
8. Universal Bound Law
A ∪ (A ∩ B) = A ; A ∩ (A ∪ B) = A
10. Absorption Laws.
∅’ = U And U’ = ∅
11. complement law
How to prove: A = B
1. Prove A ⊆ B: Assume an arbitrary element 'x' is in set A (x ∈ A). Then, using logical
reasoning and set theory definitions and laws, show that 'x' must also be in set B (x ∈ B).
2. Prove B ⊆ A: Assume an arbitrary element 'y' is in set B (y ∈ B). Then, using logical
reasoning and set theory definitions and laws, show that 'y' must also be in set A (y ∈ A).
3. Conclusion: If both subset relationships are proven, then you can conclude that A = B.
Example:
Q. prove that if A and B are sets, and A ⊆ B, then A ∪ (B - A) = B.
Part a. Prove A ∪ (B - A) ⊆ B:
Sol.
Assume x ∈ A ∪ (B - A).
This means x ∈ A or x ∈ (B - A).
If x ∈ A, since A ⊆ B, then x ∈ B.
If x ∈ (B - A), then x ∈ B and x ∉ A.
In either case, x ∈ B.
Therefore, A ∪ (B - A) ⊆ B.
Part b. Prove B ⊆ A ∪ (B - A):
Assume x ∈ B.
If x ∈ A, then x ∈ A ∪ (B - A).
If x ∉ A, then x ∈ (B - A), which means x ∈ A ∪ (B - A).
Therefore, B ⊆ A ∪ (B - A).
Conclusion: Since A ∪ (B - A) ⊆ B and B ⊆ A ∪ (B - A), then A ∪ (B - A) = B
|AUB∣ = ∣A∣+∣B∣-∣A∩B∣
For two sets A and B
Q. In a room of 50 people whose dresses have either red or white color, 30 are wearing
red dress, 16 are wearing a combination of red and white. How many are wearing
dresses that have only white color?
Sol: Total people: |RUW∣ = 50
Red dresses: |R∣ =30
| RUW ∣ = ∣R∣+∣W∣-∣R∩W∣
Red and white dresses: |R∩W∣ = 16
Q. In a survey of 60 people, it was found that 25 eat Apple, 26 eat Orange | 10 and 26 eat Banana
fruit. Also 9 eat both Apple and Banana, 11 eat both Orange and Apple, and 8 eat both Orange and
Banana. 8 eat no fruit at all. Then determine
1. the number of people who eat all three fruit.
2. the number of people who eat exactly two fruit.
3. the number of people who eat exactly one fruit
Sol.
We are given:
Part 2:
Exactly Apple and Banana = A∩B−x=9−3=6
Exactly Apple and Orange = A∩O−x=11−3=8
Exactly Orange and Banana = O∩B−x=8−3=5
number of people who eat exactly two fruits = 6 + 8 +5 =19
Part 3:
Exactly One=Total eating at least one−(Exactly Two+All Three)=52−(19+3)=30
∣AUBUC∣ = ∣A∣+∣B∣+∣C∣-∣A∩B∣-∣A∩C∣-∣B∩C∣+∣A∩B∩C∣
the union is:
We are given:
∣F∪B∪C∣=∣F∣+∣B∣+∣C∣−∣F∩B∣−∣B∩C∣−∣F∩C∣+∣F∩B∩C∣
∣F∪B∪C∣=70+60+50−30−25−20+15
=180−75+15=120
Relations
Let A and B be sets. A binary relation from A to B is a subset of A × B.
In other words, a binary relation from A to B is a set R of ordered pairs, where the first
use the notation aRb to denote that (a, b) ∈ R and a R b to denote that (a, b) ∉ R.
element of each ordered pair comes from A and the second element comes from B. We
Q- Each of these relations on the set {1, 2, 3, 4}, decide whether it is reflexive, whether
it is symmetric, whether it is antisymmetric, and whether it is transitive.
a) {(2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (3, 4)}
b) {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
c) {(2, 4), (4, 2)}
d) {(1, 2), (2, 3), (3, 4)}
e) {(1, 1), (2, 2), (3, 3), (4, 4)}
f ) {(1, 3), (1, 4), (2, 3), (2, 4), (3, 1), (3, 4)}
Solution:
a) Transitive
b) Reflexive, symmetric, transitive
c) Symmetric
d) Antisymmetric
e) Reflexive, symmetric, antisymmetric, transitive
f) None of these properties
Combining Relations
Q-Let A = {1, 2, 3} and B = {1, 2, 3, 4}. The relations R1 = {(1, 1), (2, 2), (3, 3)} and
R2 = {(1, 1), (1, 2), (1, 3), (1, 4)} can be combined to obtain.
R1 ∪ R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)},
Solution:
R1 ∩ R2 = {(1, 1)},
R1 − R2 = {(2, 2), (3, 3)},
R2 − R1 = {(1, 2), (1, 3), (1, 4)}.
Composition of Relations
composite of R and S is the relation consisting of ordered pairs (a, c), where a ∈ A, c ∈ C,
Let R be a relation from a set A to a set B and S a relation from B to a set C. The
and for which there exists an element b ∈ B such that (a, b) ∈ R and (b, c) ∈ S. We
denote the composite of R and S by S ◦R.
Question: What is the composite of the relations R and S, where R is the relation from
{1, 2, 3} to {1, 2, 3, 4} with R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)} and S is the relation
from {1, 2, 3, 4} to {0, 1, 2} with S = {(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)}?
Solution: S ◦R is constructed using all ordered pairs in R and ordered pairs in S, where
the second element of the ordered pair in R agrees with the first element of the ordered
pair in S. For example, the ordered pairs (2, 3) in R and (3, 1) in S produce the ordered
pair (2, 1) in S ◦R. Computing all the ordered pairs in the composite, we find
S ◦ R = {(1, 0), (1, 1), (2, 1), (2, 2), (3, 0), (3, 1)}.
Inverse Relation
Complementary Relation
The complement of a relation R (often denoted as R' or R ) includes all the pairs from the
universal set (A x B, where the relation is from A to B) that are not present in R.
Question: Let R be the relation R ={(a,b) ∣ a divides b} on the set of positive integers.
Find a) R-1 b) Rc
a) {(a,b) ∣ b divides a} .
Solution:
Let A={a1,a2,a3} and B={b1,b2,b3,b4,b5}.Which ordered pairs are in the relation R represented by
the matrix
0 1 00 0
MR = 1 0 1 1 0
1 0 10 1
Solution : R={(a1,b2),(a2,b1),(a2,b3),(a2,b4),(a3,b1),(a3,b3),(a3,b5)}.
Find the matrix representing a) R1∪ R2. b) R1∩ R2. c) R2◦ R1. d) R1◦ R1 e) R1⊕ R2
1 0 1 1 1 1
Solution:
0 1 0 1 1 1
MR1∪ R2 =1 1 1 MR1◦ R1 = 11 1
1 1 1 0 1 0
0 1 0 0 0 0
MR1∩ R2=0 1 1 MR1⊕ R2 = 10 0
1 0 0 0 1 1
0 1 1
M R2◦ R1 = 1 1 0
1 0 1
Closure of Relations
for each a ∈ A.
1. Reflexive Closure The reflexive closure of a relation R on A is obtained by adding (a, a) to R
b) ∈ R.
2. Symmetric Closure The symmetric closure of R is obtained by adding (b, a) to R for each (a,
Q-Let R be the relation on the set {0, 1, 2, 3} containing the ordered pairs(0, 1),(1, 1),(1, 2),(2, 0),
(2, 2),(3, 0). Find the reflexive symmetric closure
Solution:
a) reflexive closure of R We need to add (a, a) in R to make a reflexive closure.
{(0, 0),(0, 1),(1, 1),(1, 2),(2, 0),(2, 2),(3, 0),(3, 3)}
b) symmetric closure of R We need to add (b, a) for each (a, b) in R to make a symmetric
closure.
{(0, 1),(0, 2),(0, 3),(1, 0),(1, 1),(1, 2),(2, 0),(2, 1),(2, 2),(3, 0)}
Functions
Let A and B be nonempty sets. A function f from A to B is an assignment of exactly one
element of B to each element of A. We write f (a) = b if b is the unique element of B
assigned by the function f to the element a of A. If f is a function from A to B, we write f :
A → B.
Remark: Functions are sometimes also called mappings or transformations.
If f is a function from A to B, we say that A is the domain of f and B is the codomain of f.
If f (a) = b, we say that b is the image of a and a is a pre-image of b. The range, or
image, of f is the set of all images of elements of A. Also, if f is a function from A to B, we
say that f maps A to B.
Question -Determine whether the function f (x) = x2 from the set of integers to the
set of integers is one to-one.
Solution: The function f (x) = x2 is not one-to-one because, for instance, f (1) = f (−1)
= 1, but 1 ≠ −1.
Question -Determine whether the function f (x) = x + 1 from the set of real
numbers to itself is one-to-one.
Solution: Suppose that x and y are real numbers with f (x) = f (y), so that x + 1 = y
+ 1. This means that x = y. Hence, f (x) = x + 1 is a one-to-one function from R to R.
Surjective (Onto) Function
Question -Is the function f (x) = x2 from the set of integers to the set of integers onto?
Solution: The function f is not onto because there is no integer x with x2 = −1, for
instance.
Question -Is the function f (x) = x + 1 from the set of integers to the set of integers
onto?
Solution: This function is onto, because for every integer y there is an integer x such that
f (x) = y.
To see this, note that f (x) = y if and only if x + 1 = y, which holds if and only if x = y −
1. (Note that y − 1 is also an integer, and so, is in the domain of f .)
Solution:
a) For function f(x) = -3x + 4, we check if it is one-to-one. Assume f(a) = f(b): -3a + 4 = -3b +
4. Simplifying gives -3a = -3b, which implies a = b. Thus, f is one-to-one .
Next, we check if f(x) = -3x + 4 is onto. For any y in R, we can solve -3x + 4 = y.
Rearranging gives x = (4 - y)/3, which is in R. Thus, f is onto. Therefore, f is a
bijection.
b) For function f(x) = -3x^2 + 7, we check if it is one-to-one. Assume f(a) = f(b): -
3a^2 + 7 = -3b^2 + 7. Simplifying gives -3a^2 = -3b^2, or a^2 = b^2. This
implies a = b or a = -b, so f is not one-to-one. Since f(x) = -3x^2 + 7 is not one-
to-one, it cannot be onto either. Therefore, f is not a bijection.
c) For function f(x) = (x + 1)/(x + 2), we check if it is one-to-one. Assume f(x₁) = f(x₂)
(x₁ + 1)/( x₁ + 2)= (x₂ + 1)/( x₂ + 2), Simplifying gives x₁x₂ + 2x₁ + x₂ + 2 = x₁x₂ +
x₁ + 2x₂ + 2 indicates x₁ = x₂ Thus, f is one-to-one.
Next, we check if f(x) = (x + 1)/(x + 2), is onto. For any y in R, we can solve (x
+ 1)/(x + 2) = y
Solving for x: x+1 = y(x+2) => x+1 = y.x + 2y => x – y.x = 2y - 1 =>
x(1-y) = 2y-1 => x = (2y-1)/(1-y) . Since y can be any real number
except 1, the value of x is well-defined and real. Thus, for every y in the
codomain, there exists an x in the domain such that f(x) = y, proving the function
is onto. Therefore, f is a bijection.
d) For function f(x) = x5+1, we check if it is one-to-one. Assume f(x₁) = f(x₂):
x15+1= x25+1. Simplifying gives x₁ = x₂. Thus, f is one-to-one.
The function f(x) = x5+1 is an onto function because for every y∈R. Therefore, f is
a bijection.
For function f(x) = (x2 + 1) ∕ ( x2 + 2).we check if it is one-to-one. Assume f(x₁) = f(x₂)
(x₁2 + 1)/( x₁2 + 2)= (x₂2 + 1)/( x₂2 + 2), Simplifying gives x₁2 x22 + x₂2+ 2x₁2+ 2= x₁2
x22 + x12+ 2x22+ 2 => -x₂2 + x12 = 0 => x12 = x22 => x1=x2 & x1=-x2
Hence f(x) is not one to one function
Note that x2>=0 so x2 +1 >=1 & x2 +2 >=2 Also x2 +1 < x2 +2 so (x2
1
+ 1) ∕ ( x2 + 2)<1. As x → ∞,f(x) → 1 The range of f(x) is [ ,1] Since the range is not
2
all of R ,f(x) is not surjective
Inverse Function :
Let f be a one-to-one correspondence from the set A to the set B. The inverse function of
f is the function that assigns to an element b belonging to B the unique element a in A
such that f (a) = b. The inverse function of f is denoted by f −1. Hence, f −1(b) = a when f
(a) = b. A one-to-one correspondence is called invertible because we can define an
inverse of this function. A function is not invertible if it is not a one-to-one
correspondence, because the inverse of such a function does not exist.
Q1-Let f : Z → Z be such that f (x) = x + 1. Is f invertible, and if it is, what is its inverse?
Solution: The function f has an inverse because it is a one-to-one correspondence
. To reverse the correspondence, suppose that y is the image of x, so
that y = x + 1. Then x = y − 1. This means that y − 1 is the unique element of Z that is
sent to y by f . Consequently, f −1 (y) = y − 1.
Composition of functions
to the set C. The composition of the functions f and g, denoted for all a ∈ A by f
Let g be a function from the set A to the set B and let f be a function from the set B
Question: Let f and g be the functions from the set of integers to the set of integers
defined by f (x) = 2x + 3 and g(x) = 3x + 2. What is the composition of f and g?
What is the composition of g and f ?
Solution: Both the compositions f ◦g and g◦f are defined. Moreover,
( f ◦g)(x) = f (g(x)) = f (3x + 2) = 2(3x + 2) + 3 = 6x + 7 and
(g◦f )(x) = g( f (x)) = g(2x + 3) = 3(2x + 3) + 2 = 6x + 11.
2
Question: Functions f , g : R → R are defined, respectively, by f (x) = x + 3x + 1,
g (x) = 2x – 3, find (i) f ◦ g (ii) g ◦ f (iii) f ◦ f (iv) g ◦ g
2 2
Solution: f ◦ g = f(g(x)) = f(2x – 3) = (2x – 3) + 3. (2x – 3) + 1 = 4 x - 6 x +1
2
g ◦ f = g(f(x)) = g(x + 3x + 1) = 2 x2 + 6 x -1
2 2 2
f ◦ f = f(f(x)) = f(x + 3x + 1) = (x + 3x + 1)2 + 3 (x + 3x + 1) +1
4 3 2
= x +6x + 14. x + 15x + 5
g ◦ g= g(g(x)) =g(2x – 3) = 2(2x – 3)-3= 4x - 9
2
Question: Functions f , g ,h: R → R are defined, respectively, by f (x) = 3x + 2,
g (x) = 7x – 5 and h (x) = 1/x
find (i) f ◦ g ◦ h(x) (ii) g ◦ g (x) (iii) g ◦ h (x)
Solution: (f∘g∘h)(x)=f(g(h(x)))
Step 1: h(x)=1/x
Step 2: g(h(x))=g(1/x)=7⋅1/x−5 =7/x-5
147 210
Step 3: f(g(h(x)))=f(7/x−5) =3(7/x−5)2 +2 = 2 − + 77
x x
g ◦ g (x) =g(g(x)) =
Step 1: g(x)=7x−5
Step 2: g(g(x))=g(7x−5)=7(7x−5)−5=49x−35−5=49x−40
g ◦ h (x) = g(h(x))
1
Step 1: h(x)=
x
1 1 7
Step 2: g(h(x))=g( )=7⋅ −5=⋅ −5
x x x
Mathematical Induction
In general, mathematical induction∗ can be used to prove statements that assert that
P(n) is true for all positive integers n, where P(n) is a propositional function. A proof by
mathematical induction has two parts, a basis step, where we show that P(1) is true,
and an inductive step, where we show that for all positive integers k, if P(k) is true,
then P(k + 1) is true.
To complete the inductive step of a proof using the principle of mathematical induction,
we assume that P(k) is true for an arbitrary positive integer k and show that under this
assumption, P(k + 1) must also be true. The assumption that P(k) is true is called the
inductive hypothesis.
P(n) is true for all positive integers n, that is, we have shown that ∀nP(n) is true where
Once we complete both steps in a proof by mathematical induction, we have shown that
∀k(P(k) → P(k + 1)) is true, where again, the domain is the set of positive integers.
the quantification is over the set of positive integers. In the inductive step, we show that
1 ⋅ 2⋅3+2⋅3⋅4+⋯+n(n+1)(n+2) = n(n+1)(n+2)(n+3)∕4.
Question: Prove that for every positive integer n,
Solution:
Step 1: Base Case (n = 1)
LHS:1.2.3=6
RHS: 1(1+1)(1+2)(1+3)∕4 = [Link]/4 = 6
BASIS STEP: P(1) is true, because 1 < 21 = 2. This completes the basis step.
INDUCTIVE STEP: We first assume the inductive hypothesis that P(k) is true for an
arbitrary
positive integer k. That is, the inductive hypothesis P(k) is the statement that k < 2k. To
complete the inductive step, we need to show that if P(k) is true, then P(k + 1), which is
the statement that k + 1 < 2k+1 is true. That is, we need to show that if k < 2k, then k + 1
< 2k+1. To show that this conditional statement is true for the positive integer k, we first
k + 1< 2k +1 ≤ 2k + 2k = 2 ⋅ 2k = 2k+1
add 1 to both sides of k < 2k, and then note that 1 ≤ 2k. This tells us that
This shows that P(k + 1) is true, namely, that k + 1 < 2k+1, based on the assumption that
P(k)
is true. The induction step is complete.
Therefore, because we have completed both the basis step and the inductive step, by
the principle of mathematical induction we have shown that n < 2n is true for all positive
integers n.
Proof Methods
Proof by Contraposition
Proofs by contraposition make use of the fact that the conditional statement p → q is
equivalent to its contrapositive, ~q → ~p. This means that the conditional statement p
→ q can be proved by showing that its contrapositive, ~q → ~p, is true.
Proofs by Contradiction
Proofs by Counter-examples
A proof by counterexample is not technically a proof. It is merely a way of showing that a
given statement cannot possibly be correct by showing an instance that contradicts a
universal statement.
Q-Show that the statement “Every positive integer is the sum of the squares of two
integers” is false.
Solution: To show that this statement is false, we look for a counterexample, which is a
particular integer that is not the sum of the squares of two integers. It does not take long
to find a counterexample, because 3 cannot be written as the sum of the squares of two
integers.
To show this is the case, note that the only perfect squares not exceeding 3 are 0 2 = 0
and 12 = 1. Furthermore, there is no way to get 3 as the sum of two terms each of which
is 0 or 1. Consequently, we have shown that “Every positive integer is the sum of the
squares of two integers” is false.