Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Discrete Mathematics Unit I

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

Sets

A set is an unordered collection of objects, which are called the ‘elements’ of the set
 a ∈ A means that ‘a’ is an element of A (A is the set)
 sets are equal if and only if they have the same elements
 order and repetition don’t matter for sets
 note that a set doesn’t equal its elements, i.e. {a} ≠ a
Cardinality
The cardinality of a set is the number of elements in the set
 cardinality is denoted by |A|
For example if A={1,2,3,4,5,6} then |A|=6
Empty set
 the empty set is denoted by {} or ∅
Universal set
The universal set is the set containing all elements of all sets needed to discuss a topic
 denoted by U
 e.g. U might be ℝ in Calculus, or ℂ in algebra
Basic notation
The following format is used to indicate a set
S={x∈A…}
Which is read as “x is an element of A (x ∈ A) such that (|) some property is true (…).
For example, S = { x ∈ ℤ | –2 < x < 5 } which is equal to { –1, 0, 1, 2, 3, 4 }.
Venn diagrams
 when solving a problem using Venn diagrams, you must state what each of the
subsets means before you draw the diagram
 note that often you can use inclusion-exclusion principle (covered later) rather than
Venn Diagrams
Subset
A is a subset of B if and only if every element of A is also an element of B
 A ⊆ B indicates that A is a subset of the set B
 A is the proper subset of B, A ⊂ B, if A ⊆ B but A ≠ B
The following properties are useful:
 if A = B then A ⊆ B and B ⊆ A
 if A ⊂ B then A ⊆ B
 if A ⊆ B and B ⊆ A then A = B (this is used to prove that two sets are equal)
 A is a proper subset of B if it is a subset of B and B has at least one element that is
not also in A
The subset relationship only exists between two sets, i.e. for A ⊆ B, A must be a set.
Proving A is a subset of B
1. Show that any element of A is also an element of B
2. “Let x ∈ LHS” and work to show that x ∈ RHS also.
3. “Thus we have shown that any element of the LHS is also an element of the RHS,
therefore LHS ⊆ RHS”
Proving A is a proper subset of B
1. Prove A ⊆ B as above
2. Then find one or more example of an element that is in B but not in A
Proving A = B
1. Show A ⊆ B and B ⊆ A, i.e. two iterations of the process above
Power set
The power set of a set is the set of all subsets of the set.
 given a set A, then power set of A is the set of all of the subsets of the set S
 the power set of S is denoted by P(S)
For example,
P({ 0, 1, 2 }) = {
∅,
{ 0 }, { 1 }, { 2 },
{ 0, 1 }, { 1, 2 },
{ 0, 1, 2 },
}
Note: For a set X, X ∈ P(S) and X ⊆ S mean the same thing
Cardinality of a power set
If | A | = n then | P(A) | = 2n
Or, in English, the size of the power set is equal to 2n where n is the number of elements in
the set.
Set algebra
Union
The union of the sets A and B is the set that contains the elements that are either in A or in B,
or in both.
 denoted by A ∪ B
A ∪ B = { x x ∈ A or x ∈ B }
Intersection
The set containing elements that in both A and B
 A∩B
Disjoint sets
Two sets are disjoint if their intersection is the empty set (i.e. they have no elements in
common)
Set difference
The difference of A and B, A – B, is the set containing elements in A but not in B.
 Note that A – B ≠ B – A
 Note that A ∩ B = A – B
Complement
The complement of A is A . A = U – A is the set of elements in U but not in A.

Laws of set algebra


1. Commutative laws: A ∪ B = B ∪ A and A ∩ B = B ∩ A
2. Associative laws: A ∪ (B ∪ C) = (A ∪ B) ∪ C and A ∩ (B ∩ C) = (A ∩ B) ∩ C
3. Distribute laws: A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) and A ∪ (B ∩ C) = (A ∪ B) ∩ (A
∪ C)
4. Idempotent laws: A ∪ A = A and A ∩ A = A
5. Double complement laws: ( A )c = A
6. De Morgan’s laws: A ∪ B = A ∩ B and A ∩ B = A ∪ B
7. Identity laws: A ∪ ∅ = A and A ∩ U = A
8. Domination laws: A ∪ U = U and A ∩ ∅ = ∅
9. Intersection and union with complement: A ∩ A = ∅ and A ∪ A = U
10. Alternative representation for set difference: A – B = A ∩ B

Proof of De Morgan’s laws:


De Morgan's law of Intersection can be mathematically proved using the following steps:
Let G = (A ∩ B)' and H = A' U B'
Let an element y belong to G. y ∈ G.
⇒ y ∈ (A ∩ B)'
⇒ y ∉ (A ∩ B)
⇒ y ∉ A or y ∉ B
⇒ y ∈ A' or y ∈ B'
⇒ y ∈ A' U B'
⇒y∈G
This implies that G ⸦ H ...(1)
If z is an arbitrary element of H then z ∈ H
⇒ z ∈ A' U B'
⇒ z ∈ A' or z ∈ B'
⇒ z ∉ A or z ∉ B
⇒ z ∉ (A ∩ B)
⇒ z ∈ (A ∩ B)'
⇒z∈H
Therefore, H ⸦ G ...(2)
Now when we combine (1) and (2) we can say that G = H or (A ∩ B)’ = A’ ∪ B’. Hence,
we have successfully proved the law.

Cartesian Product
The Cartesian product of two sets, A and B, consists of all the ordered pairs that can be
constructed with the first element coming from the first set, A, and the second element
coming from the second set, B.
Example: if A={a,b,c} and B={1,2,3} Then Cartesian product of A and B denoted by AXB
will be
AXB={(a,1),(a,2),(a,3),(b,1),(b,2),(b,3),(c,1),(c,2),(c,3)}
And BXA=={(1,a),(2,a),(3,a),(1,b),(2,b),(3,b),(1,c),(2,c),(3,c)}
Note that AXB≠BXA

Relations
A relation defines the relationship between two different sets. If two sets are considered, the
relation between them will be established if there is a connection between the elements of
two or more non-empty sets.
In the morning assembly at schools, students are supposed to stand in a queue in ascending
order of the heights of all the students. This defines an ordered relation between the students
and their heights.
Therefore, we can say,
‘A set of ordered pairs is defined as a relation.’
This mapping depicts a relation from set A into set B. A relation from A to B is a subset of A
x B. The ordered pairs are (1,c),(2,n),(5,a),(7,n). For defining a relation, we use the notation
where,
set {1, 2, 5, 7} represents the domain.
set {a, c, n} represents the range.

Relations on a Set
Relations from a set A to itself are of special interest.
A relation on the set A is a relation from A to A. In other words a relation on a set A is a
subset of A x A.
Example: Let A be the set {1,2,3,4}. Which ordered pairs are in the relation R={(a,b)|a
divides b}?
Solution: Because (a,b) is in R if and only a and b are positive integer not exceeding 4 such
that a divides b, we see that
R={(1,1),(1,2),(1,3),(1,4),(2,2),(2,4),(3,3),(4,4)}

Problem: Consider these relations on the set of integers:


R1={(a,b) | a ≤ b)}
R2={(a,b) | a > b)}
R3={(a,b) | a = b or a = -b)}
R4={(a,b) | a = b)}
R5={(a,b) | a = b + 1)}
R6={(a,b) | a + b = 3)}
Which of the relations contain each of the pairs (1,1), (1,2), (2,1), (1,-1) and (2,2)?

Representing Relations Using Matrices:


A relation between finite sets can be represented using a zero-one matrix. Suppose R is a
relation from A = {a1 , a2 , …, am} to B = {b1 , b2 , …, bn }. The elements of the two sets can
be listed in any particular arbitrary order. When A = B, we use the same ordering. The
relation R is represented by the matrix MR = [mij], where
m ij ={ ( i j )
1 if a , b ∈ R
0 otherwise
The matrix representing R has a 1 as its (i,j) entry when a i is related to bj and a 0 if ai is not
related to bj.
Example: Suppose that A = {1,2,3} and B = {1,2}. Let R be the relation from A to B
containing (a,b) if a ∈ A, b ∈ B, and a > b. What is the matrix representing R (assuming the
ordering of elements is the same as the increasing numerical order)? Solution: Because R =
{(2,1), (3,1),(3,2)}, the matrix is

[ ]
0 0
M R= 1 0
1 1

Properties of Relations
A relation R on a set A is called reflexive if (a,a) ∊ R for every element a ∊ A
Example: The following relations on the integers are reflexive:
R1 = {(a,b) | a ≤ b},
R3 = {(a,b) | a = b or a = −b},
R4 = {(a,b) | a = b}.
The following relations are not reflexive:
R2 = {(a,b) | a > b} (note that 3 ≯ 3),
R5 = {(a,b) | a = b + 1} (note that 3 ≠3 + 1),
R6 = {(a,b) | a + b ≤ 3} (note that 4 + 4 ≰ 3)

A relation R is symmetric if and only if (b,a) ∊ R whenever (a,b) ∊ R for all a,b ∊ A.
Written symbolically, R is symmetric if and only if
∀a∀b [(a,b) ∊R ⟶ (b,a) ∊ R]
Example: The following relations on the integers are symmetric:
R3 = {(a,b) | a = b or a = −b},
R4 = {(a,b) | a = b},
R6 = {(a,b) | a + b ≤ 3}.
The following are not symmetric:
R1 = {(a,b) | a ≤ b} (note that 3 ≤ 4, but 4 ≰ 3),
R2 = {(a,b) | a > b} (note that 4 > 3, but 3 ≯ 4),
R5 = {(a,b) | a = b + 1} (note that 4 = 3 + 1, but 3 ≠4 + 1).

A relation R on a set A is called antisymmetric when ∀ a,b ∊ A, (a,b) ∊ R and (b,a) ∊ R


implies a=b
Example: The following relations on the integers are antisymmetric:
R1 = {(a,b) | a ≤ b},
R2 = {(a,b) | a > b}
R4 = {(a,b) | a = b},
R5 = {(a,b) | a = b + 1}.

A relation R on a set A is called transitive if whenever (a,b) ∊ R and (b,c) ∊ R then (a,c) ∊ R,
∀ a, b, c ∊ A.
Example: The following relations on the integers are transitive:
R1 = {(a,b) | a ≤ b},
R2 = {(a,b) | a > b}
R3 = {(a,b) | a = b or a = −b},
R4 = {(a,b) | a = b}.

A relation on set A is called an equivalence relation if it is reflexive, symmetric and


transitive.

Example: Let R be the relation on the set of real numbers such that (a,b) ∊ R if and only if a-b
is an integer. Prove R is an equivalence relation.
Solution: As a-a=0 is an integer for all real numbers a, (a,a) ∊ R for all real numbers a. Hence,
R is reflexive. Now, suppose that (a,b) ∊ R. Then a-b is an integer, so b-a is also an integer.
Hence, (b,a) ∊ R. It follows that R is symmetric. If (a,b) ∊ R and (b,c) ∊ R then a-b and b-c are
integers. Therefore, a-c = (a-b)+(b-c) is also an integer. Hence (a,c) ∊ R. Thus, R is
transitive. Consequently R is an equivalence relation.

Problem: Suppose that R is the relation on the set of strings of English letters such that (a,b) ∊
R if and only if l(a) = l(b), where l(x) is the length of the string x. Show that R is an
equivalence relation.

Problem: Show that “divides” relation is on the set of positive integers is not an equivalence
relation.

Problem: Let R be the relation on the set of real numbers such that (a,b) ∊ R if and only if a
and b are real numbers that differ by less than 1, that is |a-b|<1. Show that R is not an
equivalence relation.

Functions:
Let A and B be two 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 an 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.
A function f: A → B can also be defined in terms of a relation from A to B. A relation from
A to B that contains one, and only one, ordered pair (a,b) for every element a ∊ A, defines a
function f from A to B. This function is defined by the assignment f(a) = b, where (a,b) is the
unique ordered pair in the relation that has a as its first element.
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 preimage of b. The range 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.

One-to-One Functions: A function f is said to be one-to-one, or injective, if and only if


f(a)=F(b) implies that a = b for all a and b in the domain of f. A function is said to be
injective if it is one-to-one.
a 1
b 2
c 3
d 4
5
A One-to-One Function
Onto Functions: A function f from A to B is called onto, of surjective, if and only if for every
element b ∊ B there is an element a ∊ A with f(a) = b. A function is called surjective if it is
onto.

a 1
b 2
c 3
d 4
5
A Onto Function

One-to-One Correspondence Function: The function f is a one-to-one correspondence, or a


bijection, it is both one-to-one and onto.

a 1
b 2
c 3
d 4
A One-to-One and onto Function

Inverse Function: An inverse function or an anti function is defined as a function, which can
reverse into another function. In simple words, if any function “f” takes x to y then, the
inverse of “f” will take y to x. If the function is denoted by ‘f’ or ‘F’, then the inverse
function is denoted by f-1 or F-1.
If f and g are inverse functions, then f(x) = y if and only if g(y) = x
If you consider functions, f and g are inverse, f(g(x)) = g(f(x)) = x. A function that consists of
its inverse fetches the original value.
Example: f(x) = 2x + 5 = y
Then, g(y) = (y-5)/2 = x is the inverse of f(x).

Compositions of Functions
Consider functions, f: A → B and g: B → C. The composition of f with g is a function from
A into C defined by (gof) (x) = g [f(x)] and is defined by gof.
To find the composition of f and g, first find the image of x under f and then find the
image of f (x) under g.
Example:
Let X = {1, 2, 3}
Y = {a, b}
Z = {5, 6, 7}.
Consider the function f = {(1, a), (2, a), (3, b)} and g = {(a, 5), (b, 7)} as in figure. Find the
composition of gof.
Solution: The composition function gof is shown in fig:

(gof) (1) = g[f(1)] = g(a) = 5,


(gof) (2) = g[f(2)] = g(a) = 5,
(gof) (3) = g[f(3)] = g(b) = 7
Problem: 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?

If 𝐴 is any set, then χA(x) is the characteristic function defined by


1 x∈ A
χ A ( x )={
0 x∉ A
Example: if A={a,e,i,o,u} then the characteristic function is defined by 1 when a character is
vowel and 0 otherwise.

Mathematical Induction is a mathematical technique which is used to prove a statement, a


formula or a theorem is true for every natural number.
The technique involves two steps to prove a statement, as stated below −
Step 1(Base step) − It proves that a statement is true for the initial value.
Step 2(Inductive step) − It proves that if the statement is true for the n th iteration (or
number n), then it is also true for (n+1)th iteration ( or number n+1).

How to Do It

Step 1 − Consider an initial value for which the statement is true. It is to be shown that the
statement is true for n = initial value.
Step 2 − Assume the statement is true for any value of n = k. Then prove the statement is true
for n = k+1. We actually break n = k+1 into two parts, one part is n = k (which is already
proved) and try to prove the other part.
Problem 1
3n−1 is a multiple of 2 for n = 1, 2, ...
Solution
Step 1 − For n=1,31−1=3−1=2 which is a multiple of 2
Step 2 − Let us assume 3n−1is true for n=k, Hence, 3k−1 is true (It is an assumption)
We have to prove that 3k+1−1 is also a multiple of 2
3k+1−1=3×3k−1=(2×3k)+(3k−1)
The first part (2×3k) is certain to be a multiple of 2 and the second part (3k−1) is also true as
our previous assumption.
Hence, 3k+1–1 is a multiple of 2.
So, it is proved that 3n–1 is a multiple of 2.

Problem 2
1+3+5+...+(2n−1)=n2 for n=1,2,….
Solution
Step 1 − For n=1,1=12, Hence, step 1 is satisfied.
Step 2 − Let us assume the statement is true for n=k.
Hence, 1+3+5+⋯+(2k−1)=k2 is true (It is an assumption)
We have to prove that 1+3+5+...+(2(k+1)−1)=(k+1)2 also holds
1+3+5+⋯+(2(k+1)−1)
=1+3+5+⋯+(2k+2−1)
=1+3+5+⋯+(2k+1)
=1+3+5+⋯+(2k−1)+(2k+1)
=k2+(2k+1)
=(k+1)2
So, 1+3+5+⋯+(2(k+1)−1)=(k+1)2 hold which satisfies the step 2.
Hence, 1+3+5+⋯+(2n−1)=n2 is proved.

Assignment Questions
1. What are set, cardinality, subset, and power set?
2. State and prove De Morgan’s law.
3. Let A = R – {3}, B = R – {1}. Let be defined by
Show that f is bijective.

4. Prove 1+3+5+...+(2n−1) = n2 for n=1,2, … using mathematical induction.


5. What is equivalence relation? Give example

You might also like