هياكل متقطعة المرحلة الاولى الكورس الاول
هياكل متقطعة المرحلة الاولى الكورس الاول
هياكل متقطعة المرحلة الاولى الكورس الاول
If A ⊆ B, then the disk representing A will be entirely within the disk representing B
as in next figure.
A⊆B U
B A
If A and B are disjoint, then the disk representing A will be separated from the disk
representing B as in the next figure.
U
B A
However, if A and B are two arbitrary sets, it is possible that some objects are in A
but not in B, some are in B but not in A, some are in both A and B, and some are in
neither A nor B; hence in general we represent A and B as in the next figure.
A B
Many verbal statements are essentially statements about sets and can therefore be
described by Venn diagrams. Hence Venn diagrams can sometimes be used to
determine whether or not an argument is valid.
EXAMPLE 1.3 Show that the following argument (adapted from a book on logic by
Lewis Carroll, the author of Alice in Wonderland) is valid:
S1: All my tin objects are saucepans.
S2: I find all your presents very useful.
S3: None of my saucepans is of the slightest use.
S : Your presents to me are not made of tin.
The statements S1, S2, and S3 above the horizontal line denote the assumptions,
and the statement S below the line denotes the conclusion.
The argument is valid if the conclusion S follows logically from the assumptions S1,
S2, and S3.
By S1 the tin objects are contained in the set of saucepans, and by S3 the set of
saucepans and the set of useful things are disjoint. Furthermore, by S2 the set of
“your presents” is a subset of the set of useful things. Accordingly, we can draw the
Venn diagram in the next figure.
The conclusion is clearly valid by the Venn diagram because the set of “your
presents” is disjoint from the set of tin objects.
This section introduces a number of set operations, including the basic operations
of union, intersection, and complement.
Union and Intersection
The union of two sets A and B, denoted by A ∪ B, is the set of all elements which
belong to A or to B; that is,
A ∪ B = {x | x ∈ A or x ∈ B}
Here “or” is used in the sense of and/or. Figure (a) is a Venn diagram in which A ∪ B
is shaded.
The intersection of two sets A and B, denoted by A ∩ B, is the set of elements which
belong to both A and B; that is,
A ∩ B = {x | x ∈ A and x ∈ B}
Figure (b) is a Venn diagram in which A ∩ B is shaded.
Recall that sets A and B are said to be disjoint or nonintersecting if they have no
elements in common or, using the definition of intersection, if A ∩ B = ∅, the empty
set. Suppose
= A ∪ B and A ∩ B = ∅
Then S is called the disjoint union of A and B.
(a) Let A = {1, 2, 3, 4}, B = {3, 4, 5, 6, 7}, C = {2, 3, 8, 9}. Then
A ∪ B = {1, 2, 3, 4, 5, 6, 7}, A ∪ C = {1, 2, 3, 4, 8, 9}, B ∪ C = {2, 3, 4, 5, 6, 7, 8, 9},
A ∩ B = {3, 4}, A ∩ C = {2, 3}, B ∩ C = {3}.
(b) Let U be the set of students at a university, and let M denote the set of male
students and let F denote the set of female students. The U is the disjoint union of M
of F; that is,
U = M ∪ F and M ∩ F = ∅
This comes from the fact that every student in U is either in M or in F, and clearly no
student belongs to both M and F, that is, M and F are disjoint.
The following properties of union and intersection should be noted.
Property 1: Every element x in A∩B belongs to both A and B; hence x belongs to A
and x belongs to B. Thus A ∩ B is a subset of A and of B; namely
A ∩ B ⊆ A and A ∩ B ⊆ B
Property 2: An element x belongs to the union A∪ B if x belongs to A or x belongs
to B; hence every element in A belongs to A ∪ B, and every element in B belongs to
A ∪ B. That is,
A ⊆ A ∪ B and B ⊆ A ∪ B
We state the above results formally:
Theorem 1.3: For any sets A and B, we have:
(i) A ∩ B ⊆ A ⊆ A ∪ B and (ii) A ∩ B ⊆ B ⊆ A ∪ B.
The operation of set inclusion is closely related to the operations of union and
intersection, as shown by the following theorem.
Theorem 1.4: The following are equivalent: A ⊆ B, A ∩ B = A, A ∪ B = B.
This theorem is proved in Problem 1.8. Other equivalent conditions to are given in
Problem 1.31.
Complements, Differences, Symmetric Differences
Recall that all sets under consideration at a particular time are subsets of a fixed
universal set U. The absolute complement or, simply, complement of a set A, denoted
by AC, is the set of elements which belong to U but which do not belong to A. That
is,
AC = {x | x ∈ U, x ∉ A}
ሗ or 𝐴. Fig. (a) is a Venn diagram in which AC
Some texts denote the complement of A by A
is shaded.
The relative complement of a set B with respect to a set A or, simply, the difference of A
and B, denoted by A\B, is the set of elements which belong to A but which do not belong
to B; that is
A\B = {x | x ∈ A, x ∉ B}
The set A\B is read “A minus B.” Many texts denote A\B by A − B or A ∼ B. Fig. (b) is a
Venn diagram in which A\B is shaded.
The symmetric difference of sets A and B, denoted by A ⊕ B, consists of those
elements which belong to A or B but not to both. That is,
A ⊕ B = (A ∪ B)\(A ∩ B) or A ⊕ B = (A\B) ∪ (B\A)
Figure (c) is a Venn diagram in which A ⊕ B is shaded.
Suppose U = N = {1, 2, 3, . . .} is the universal set. Let
A = {1, 2, 3, 4}, B= {3, 4, 5, 6, 7}, C= {2, 3, 8, 9}, E= {2, 4, 6, . . .}
(Here E is the set of even integers.) Then:
AC = {5, 6, 7, . . .}, BC = {1, 2, 8, 9, 10, . . .}, EC = {1, 3, 5, 7, . . .}
That is, EC is the set of odd positive integers. Also:
A\B = {1, 2}, A\C = {1, 4}, B\C = {4, 5, 6, 7}, A\E = {1, 3},
B\A = {5, 6, 7}, C\A = {8, 9}, C\B = {2, 8, 9}, E\A = {6, 8, 10, 12, . . .}.
Furthermore:
A ⊕ B = (A\B) ∪ (B\A) = {1, 2, 5, 6, 7}, B⊕ C = {2, 4, 5, 6, 7, 8, 9},
A ⊕ C = (A\C) ∪ (C\A) = {1, 4, 8, 9}, A⊕ E = {1, 3, 6, 8, 10, . . .}.
Consider n distinct sets A1, A2, …, An. A fundamental product of the sets is a set of
the form
∗ ∗ ∗ ∗ ∗
𝐴1 ∩ 𝐴2 ∩ . . . ∩ 𝐴𝑛 where 𝐴𝑖 = A or 𝐴𝑖 = 𝐴𝐶
We note that:
(i) There are m = 2𝑛 such fundamental products.
(ii) Any two such fundamental products are disjoint.
(iii) The universal set U is the union of all fundamental products.
Thus U is the disjoint union of the fundamental products. There is a geometrical
description of these sets which is illustrated below.
Figure (a) is the Venn diagram of three sets A, B, C. The following lists the m = 23 = 8
fundamental products of the sets A, B, C:
P1 = A ∩ B ∩ C, P2 = A ∩ B ∩ 𝑪𝑪 , P3 = A ∩ 𝑩𝑪 ∩ C, P4 = A ∩ 𝑩𝑪 ∩ 𝑪𝑪
P5 = 𝑨𝑪 ∩ B ∩ C, P6 = 𝑨𝑪 ∩ B ∩ 𝑪𝑪 , P7 = 𝑨𝑪 ∩ 𝑩𝑪 ∩ C, P8 = 𝑨𝑪 ∩ 𝑩𝑪 ∩𝑪𝑪 .
The eight products correspond precisely to the eight disjoint regions in the Venn
diagram of sets A, B, C as indicated by the labeling of the regions in Fig. (b).
First stage, computer science department, college of
science for women, university of Baghdad.
Dr. Amer Al-Mahdawi
Sets under the operations of union, intersection, and complement satisfy various
laws (identities) which are listed in Table 1-1. In fact, we formally state this as:
Theorem 1.5: Sets satisfy the laws in Table 1-1.
Remark: Each law in Table 1-1 follows from an equivalent logical law. Consider, for
example, the proof of DeMorgan’s Law 10(a):
(A ∪ B)C = {x |x ∉ (A or B)} = {x |x ∉ A and x ∉ B} = AC ∩ BC
Here we use the equivalent (DeMorgan’s) logical law:
¬(p ∨ q) = ¬p ∧¬q
where ¬ means “not,” ∨ means “or,” and ∧ means “and.” (Sometimes Venn
diagrams are used to illustrate the laws in Table 1-1 as in Problem 1.17.)
Duality
The identities in Table 1-1 are arranged in pairs, as, for example, (2a) and (2b).We
now consider the principle behind this arrangement. Suppose E is an equation of
set algebra. The dual E∗ of E is the equation obtained by replacing each occurrence
of ∪, ∩, U and ∅ in E by ∩, ∪, ∅, and U, respectively. For example, the dual of
(U ∩ A) ∪ (B ∩ A) = A is (∅ ∪ A) ∩ (B ∪ A) = A
Observe that the pairs of laws in Table 1-1 are duals of each other. It is a fact of set
algebra, called the principle of duality, that if any equation E is an identity then its
dual E∗ is also an identity.
Sets can be finite or infinite. A set S is said to be finite if S is empty or if S contains
exactly m elements where m is a positive integer; otherwise S is infinite.
EXAMPLE 1.7
(a) The set A of the letters of the English alphabet and the set D of the days of the week
are finite sets. Specifically, A has 26 elements and D has 7 elements.
(b) Let E be the set of even positive integers, and let I be the unit interval, that is,
E = {2, 4, 6, . . .} and I = [0, 1] = {x | 0 ≤ x ≤ 1}
Then both E and I are infinite.
A set S is countable if S is finite or if the elements of S can be arranged as a sequence, in
which case S is said to be countably infinite; otherwise S is said to be uncountable. The
above set E of even integers is countably infinite, whereas one can prove that the unit
interval I = [0, 1] is uncountable.
The notation n(S) or |S| will denote the number of elements in a set S. (Some texts
use #(S) or card(S) instead of n(S).) Thus n(A) = 26, where A is the letters in the
English alphabet, and n(D) = 7, where D is the days of the week. Also n(∅) = 0 since
the empty set has no elements.
The following lemma applies.
Lemma 1.6: Suppose A and B are finite disjoint sets. Then A ∪ B is finite and
n(A ∪ B) = n(A) + n(B)
This lemma may be restated as follows:
Lemma 1.6: Suppose S is the disjoint union of finite sets A and B. Then S is finite
and Proof.
n(S) = n(A) + n(B)
In counting the elements of A ∪ B, first count those that are in A. There are n(A) of
these. The only other elements of A ∪ B are those that are in B but not in A. But since
A and B are disjoint, no element of B is in A, so there are n(B) elements that are in B
but not in A. Therefore, n(A ∪ B) = n(A) + n(B).
For any sets A and B, the set A is the disjoint union of A\B and A ∩ B. Thus Lemma
1.6 gives us the following useful result.
Corollary 1.7: Let A and B be finite sets. Then
n(A\B) = n(A) − n(A ∩ B)
For example, suppose an art class A has 25 students and 10 of them are taking a
biology class B. Then the number of students in class A which are not in class B is:
n(A\B) = n(A) − n(A ∩ B) = 25 − 10 = 15
Given any set A, recall that the universal set U is the disjoint union of A and AC.
Accordingly, Lemma 1.6 also gives the following result.
Corollary 1.8: Let A be a subset of a finite universal set U. Then
n(AC) = n(U) − n(A)
For example, suppose a class U with 30 students has 18 full-time students. Then
there are 30−18 = 12 part-time students in the class U.
Inclusion–Exclusion Principle
There is a formula for n(A ∪ B) even when they are not disjoint, called the
Inclusion–Exclusion Principle. Namely:
Theorem (Inclusion–Exclusion Principle) 1.9: Suppose A and B are finite sets.
Then A ∪ B and A ∩ B are finite and
n(A ∪ B) = n(A) + n(B) − n(A ∩ B)
That is, we find the number of elements in A or B (or both) by first adding n(A) and
n(B) (inclusion) and then subtracting n(A ∩ B) (exclusion) since its elements were
counted twice.
We can apply this result to obtain a similar formula for three sets:
Corollary 1.10: Suppose A, B, C are finite sets. Then A ∪ B ∪ C is finite and
n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(A ∩ C) − n(B ∩ C) + n(A ∩ B ∩ C)
Mathematical induction (Section 1.8) may be used to further generalize this result
to any number of finite sets.
EXAMPLE 1.8 Suppose a list A contains the 30 students in a mathematics class,
and a list B contains the 35 students in an English class, and suppose there are 20
names on both lists. Find the number of students: (a) only on list A, (b) only on list B,
(c) on list A or B (or both), (d) on exactly one list.
(a) List A has 30 names and 20 are on list B; hence 30 − 20 = 10 names are only on
list A.
(b) Similarly, 35 − 20 = 15 are only on list B.
(c) We seek n(A ∪ B). By inclusion–exclusion,
n(A ∪ B) = n(A) + n(B) − n(A ∩ B) = 30 + 35 − 20 = 45.
In other words, we combine the two lists and then cross out the 20 names which
appear twice.
(d) By (a) and (b), 10 + 15 = 25 names are only on one list; that is, n(A ⊕ B) = 25.
1.7 CLASSES OF SETS, POWER SETS, PARTITIONS
Given a set S, we might wish to talk about some of its subsets. Thus we would be
considering a set of sets. Whenever such a situation occurs, to avoid confusion, we
will speak of a class of sets or collection of sets rather than a set of sets. If we wish to
consider some of the sets in a given class of sets, then we speak of subclass or
subcollection.
EXAMPLE 1.9 Suppose S = {1, 2, 3, 4}.
(a) Let A be the class of subsets of S which contain exactly three elements of S. Then
A = [{1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4}]
That is, the elements of A are the sets {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, and {2, 3, 4}.
(b) Let B be the class of subsets of S, each which contains 2 and two other elements
of S. Then
B = [{1, 2, 3}, {1, 2, 4}, {2, 3, 4}]
The elements of B are the sets {1, 2, 3}, {1, 2, 4}, and {2, 3, 4}. Thus B is a subclass of A,
since every element of B is also an element of A. (To avoid confusion, we will
sometimes enclose the sets of a class in brackets instead of braces.)
Power Sets
For a given set S , we may speak of the class of all subsets of S. This class is called
the power set of S , and will be denoted by P(S). If S is finite, then so is P(S). In fact,
the number of elements in P(S) is 2 raised to the power n(S). That is,
n(P (S)) =2𝑛(𝑆)
(For this reason, the power set of S is sometimes denoted by 2S.)
EXAMPLE 1.10 Suppose S = {1, 2, 3}. Then
P(S) = [∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, S]
Note that the empty set ∅ belongs to P(S) since ∅ is a subset of S. Similarly, S
belongs to P(S). As expected from the above remark, P(S) has 23 = 8 elements.
Partitions
Let S be a nonempty set. A partition of S is a subdivision of S into nonoverlapping,
nonempty subsets. Precisely, a partition of S is a collection {Ai } of nonempty
subsets of S such that:
(i) Each a in S belongs to one of the Ai .
(ii) The sets of {Ai } are mutually disjoint; that is, if
𝐴𝑗 ≠ 𝐴𝑘 then 𝐴𝑗 ∩ 𝐴𝑘 = ∅
The subsets in a partition are called cells. Figure 1-6 is a Venn diagram of a partition of
the rectangular set S of points into five cells, A1, A2,A3,A4,A5.
That is, the union consists of those elements which belong to at least one of the sets,
and the intersection consists of those elements which belong to all the sets.
EXAMPLE 1.12 Consider the sets
An essential property of the set N = {1, 2, 3, …} of positive integers follows:
Principle of Mathematical Induction I: Let P be a proposition defined on the
positive integers N; that is, P(n)
is either true or false for each n ∈ N. Suppose P has the following two properties:
(i) P(1) is true.
(ii) P(k + 1) is true whenever P(k) is true.
Then P is true for every positive integer n ∈ N.
We shall not prove this principle. In fact, this principle is usually given as one of the
axioms when N is developed axiomatically
EXAMPLE 1.13 Let P be the proposition that the sum of the first n odd numbers is n2; that is,
P(n) : 1 + 3 + 5+・ ・ ・+(2n − 1) = n2
(The kth odd number is 2k −1, and the next odd number is 2k +1.) Observe that P(n) is true for n =
1; namely,
P(1) = 12
Assuming P(k) is true, we add 2k + 1 to both sides of P(k), obtaining
1 + 3 + 5+・ ・ ・+(2k − 1) + (2k + 1) − k2 + (2k + 1) = (k + 1)2
which is P(k + 1). In other words, P(k + 1) is true whenever P(k) is true. By the principle of
mathematical
induction, P is true for all n.
There is a form of the principle of mathematical induction which is sometimes more convenient to
use.
Although it appears different, it is really equivalent to the above principle of induction.
Principle of Mathematical Induction II: Let P be a proposition defined on the
positive integers N such that:
(i) P(1) is true.
(ii) P(k) is true whenever P(j) is true for all 1 ≤ j < k.
Then P is true for every positive integer n ∈ N.
Remark: Sometimes one wants to prove that a proposition P is true for the set of
integers
{a, a + 1, a + 2, a + 3, . . .}
where a is any integer, possibly zero. This can be done by simply replacing 1 by a
in either of the above Principles of Mathematical Induction.
First stage, computer science department, college of
science for women, university of Baghdad.
Dr. Amer Almahdawi
▪ The reader is familiar with many relations such as “less than,” “is parallel to,” “is a
subset of,” and so on. In a certain sense, these relations consider the existence or
nonexistence of a certain connection between pairs of objects taken in a definite
order. Formally, we define a relation in terms of these “ordered pairs.”
▪ An ordered pair of elements a and b, where a is designated as the first element and
b as the second element, is denoted by (a, b). In particular,
▪ (a,b) = (c,d)
▪ if and only if a = c and b = d. Thus (a, b) ≠ (b, a) unless a = b. This contrasts with sets
where the order of elements is irrelevant; for example, {3, 5} = {5, 3}.
▪ Consider two arbitrary sets A and B. The set of all ordered pairs (a, b) where a ∈ A
and b ∈ B is called the product, or Cartesian product, of A and B. A short designation
of this product is A × B, which is read “A cross B.” By definition.
▪ A × B = {(a, b) | a ∈ A and b ∈ B}
▪ One frequently writes A2 instead of A × A.
▪ EXAMPLE 2.1 R denotes the set of real numbers and so R2 = R×R is the set of
ordered pairs of real numbers. The reader is familiar with the geometrical
representation of R2 as points in the plane as in Fig. 2-1. Here each point P
represents an ordered pair (a, b) of real numbers and vice versa; the vertical line
through P meets the x-axis at a, and the horizontal line through P meets the y-axis at
b. R2 is frequently called the Cartesian plane.
▪ EXAMPLE 2.2 Let A = {1, 2} and B = {a, b, c}. Then
▪ A × B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}
▪ B × A = {(a, 1), (b, 1), (c, 1), (a, 2), (b, 2), (c, 2)}
▪ Also, A × A = {(1, 1), (1, 2), (2, 1), (2, 2)}
▪ There are two things worth noting in the above examples. First of all A×B = B ×A.
The Cartesian product deals with ordered pairs, so naturally the order in which the
sets are considered is important. Secondly, using n(S) for the number of elements
in a set S, we have:
▪ n(A × B) = 6 = 2(3) = n(A)n(B)
▪ In fact, n(A×B) = n(A)n(B) for any finite sets A and B. This follows from the
observation that, for an ordered pair (a, b) in A × B, there are n(A) possibilities for a,
and for each of these there are n(B) possibilities for b.
▪ The idea of a product of sets can be extended to any finite number of sets. For any
sets A1,A2, . . . , An, the set of all ordered n-tuples (a1, a2, . . . , an) where a1 ∈ A1, a2 ∈
A2, . . . , an ∈ An is called the product of the sets A1, . . . , An and is denoted by
▪ If R is a relation from a set A to itself, that is, if R is a subset of A2 = A×A, then we say
that R is a relation on A.
▪ The domain of a relation R is the set of all first elements of the ordered pairs which
belong to R, and the range is the set of second elements.
▪ EXAMPLE 2.3
▪ (a) A = (1, 2, 3) and B = {x, y, z}, and let R = {(1, y), (1, z), (3, y)}. Then R is a relation
from A to B since R is a subset of A × B. With respect to this relation,
▪ The nonzero entries in this matrix tell us which elements are related by R◦S. Thus M =
MRMS and MR◦S have the same nonzero entries.
First stage, computer science department, college of
science for women, university of Baghdad.
Dr. Amer Almahdawi
Relations:
Let A and B are two sets, every subset of A×B is called relation from A to B, denoted
by R.
Remark:
1. We say R relation on A if R⊆A×A.
2. If (a,b)∈R, then denoted by a R b.
3. If (a,b)∉ R, then denoted by 𝒂 𝑹 𝒃 .
Example:
1. Let A={1,2,3} and B={a,b}. Then R={(1,a),(1,b),(3,a)} is a relation from A to B.
Furthermore, 1 R a,1 R b,3 R a.
2. Let w={a,b,c}. then R={(a,b),(a,c),(c,c),(c,b)} is a relation in w. Moreover, a R a,b
R a,c R c,a R b.
Reflexive relation: Let 𝑅 be a relation in a set 𝐴, i.e. Let 𝑅 be a subset of 𝐴 × 𝐴. then
𝑅 is called a reflexive relation if for every 𝑎 ∈ 𝐴, (𝑎, 𝑎) ∈ 𝑅. In other words, 𝑅 is
reflexive if every element in 𝐴 is related to its self.
Example:
1. Let V={1,2,3,4} and R={(1,1),(2,4),(3,3),(4,1),(4,4)}. then R is not reflexive since
(2,2) dose not belong to R. Notice that all ordered pairs (a,a) must belong to R in
order for R to be reflexive.
2. Let R be the relation in the real numbers defined by the open sentence " x<y".
Then R is not reflexive since 𝑎 < 𝑎 for every real number a.
3. Let Q be a family of sets, and let 𝑅 be the relation in Q defined by
" 𝑥 𝑖𝑠 𝑎 𝑠𝑢𝑏𝑠𝑒𝑡 𝑜𝑓 𝑦 ". Then 𝑅 is a reflexive relation since every set is a subset of
itself.
Symmetric relation: Let 𝑅 be a relation in a set 𝐴. Then 𝑅 is called a symmetric
relation if (𝑎, 𝑏) ∈ 𝑅 implies (𝑏, 𝑎) ∈ 𝑅 that is, if 𝑎 related to 𝑏, then 𝑏 is also related
to 𝑎.
Example:
1. Let 𝑆 = {1, 2, 3} and let 𝑅 = { 1, 3 , 4, 2 , 2, 4 , 2, 3 , 3, 1 }. Then 𝑅 is not a
symmetric relation since (2, 3) ∈ 𝑅 but (3, 2) ∉ 𝑅.
2. Let 𝑅 be the relation in the natural numbers 𝑁 which is defined by " 𝑥 𝑑𝑖𝑣𝑖𝑑𝑒𝑠 𝑦".
Then 𝑅 is not symmetric since 2 𝑑𝑖𝑣𝑖𝑑𝑒𝑠 4 but 4 𝑑𝑜𝑒𝑠 𝑛𝑜𝑡 𝑑𝑖𝑣𝑖𝑑𝑒𝑠 2. i.e. (2, 4) ∈ 𝑅 but
(4, 2) ∉ 𝑅.
Transitive relation: A relation 𝑅 in a set 𝐴 is called a transitive relation if (𝑎, 𝑏) ∈ 𝑅
and (𝑏, 𝑐) ∈ 𝑅 implies (𝑎, 𝑐) ∈ 𝑅.
Example:
1. Let 𝑅 be the relation in the real numbers defined by "𝑥 < 𝑦 ". Then if 𝑎 < 𝑏 and 𝑏
< 𝑐 implies 𝑎 < 𝑐. Thus 𝑅 is a transitive relation.
2. Let 𝑤 = {𝑎, 𝑏, 𝑐}, and let 𝑅 = { 𝑎, 𝑏 , 𝑐, 𝑏 , 𝑏, 𝑎 , 𝑎, 𝑐 }. Then 𝑅 is not a transitive
relation since (𝑐, 𝑏) ∈ 𝑅 and (𝑏, 𝑎) ∈ 𝑅 but (𝑐, 𝑎) ∉ 𝑅.
Equivalence relation: A relation 𝑅 in a set 𝐴 is an equivalence relation if
1. 𝑅 is reflexive, that is, for every 𝑎 ∈ 𝐴, (𝑎, 𝑎) ∈ 𝑅.
2. 𝑅 is symmetric, that is, (𝑎, 𝑏) ∈ 𝑅 implies (𝑏, 𝑎) ∈ 𝑅.
3. 𝑅 is transitive, that is, (𝑎, 𝑏) ∈ 𝑅 and (𝑏, 𝑐) ∈ 𝑅 implies (𝑎, 𝑐) ∈ 𝑅.
Example: Let 𝐴 = {1, 2, 3}. Determine whether the relation is reflexive, symmetric or transitive.
1. 𝑅 = 1,1 , 1,2 , 2,1 , 2,2 , 3,3 .
2. 𝑅 = 1,3 , 1,1 , 3,1 , 1,2 , 3,3 .
3. 𝑅 = 1,2 , 1,3 , 3,1 , 1,1 , 3,3 , 3, 2 .
4. 𝑅 = { 1,2 , 1,3 , 2,3 , 1,1 , 3,1 , 3,3 , 2,1 , (2,2)}.
5. 𝑅 = 1,3 , 3,1 , 2,2 .
Solution:
1. Reflexive, symmetric, transitive.
2. Not reflexive, not symmetric, not transitive.
3. Not reflexive, not symmetric, transitive.
4. Reflexive, not symmetric, not transitive.
5. Not reflexive, symmetric, not transitive.
Example:
Consider the relation 𝑅 that is define on 𝑍 by 𝑎 𝑅 𝑏 ↔ ∃ 𝑘 ∈ 𝑍, 𝑎 − 𝑏 = 3𝑘 .
Solution:
(3, 0) ∈ 𝑅 since 3 − 0 = 3 = 3 1 , 𝑘 = 1
(0, 3) ∈ R since 0 − 3 = −3 = 3 −1 , 𝑘 = −1
(15, 9) ∈ 𝑅 since 15 − 9 = 6 = 3 2 , 𝑘 = 2
1
(−1, −2) ∉ 𝑅 since −1 − −2 = 1 = 3𝑘, 𝑘 = ∉𝑍
3
Now,
1. 𝑅 is reflexive?
Let 𝑎 ∈ 𝑍 → 𝑎 − 𝑎 = 0 = 3 0 , 𝑘 = 0 → 𝑎 𝑅 𝑎. So that, 𝑅 is reflexive.
2. 𝑅 is symmetric?
Let 𝑎 𝑅 𝑏, we have to show 𝑏 𝑅 𝑎?
Since 𝑎 𝑅 𝑏 → ∃ 𝑘 ∈ 𝑍; 𝑎 − 𝑏 = 3𝑘
Now,
𝑏 − 𝑎 = − 𝑎 − 𝑏 = −3𝑘 = 3 −𝑘 = 3𝑘1 s.t. 𝑘1 = −𝑘
∴ 𝑏 − 𝑎 = 3𝑘1 → 𝑏 𝑅 𝑎 so that 𝑅 is symmetric.
3. 𝑅 is transitive?
Let 𝑎 𝑅 𝑏 ∧ 𝑏 𝑅 𝑐, we have to show 𝑎 𝑅 𝑐?
𝑎 − 𝑏 = 3𝑘1 ∧ 𝑏 − 𝑐 = 3𝑘2 ; 𝑘1 , 𝑘2 ∈ 𝑍
𝑎 − 𝑐 = 𝑎 − 𝑏 + 𝑏 − 𝑐 = 3𝑘1 + 3𝑘2 = 3 𝑘1 + 𝑘2 = 3𝑘; 𝑤ℎ𝑒𝑟𝑒 𝑘 = 𝑘1 + 𝑘2
∴𝑎𝑅𝑐
So that from (1), (2), and (3) 𝑅 is equivalence relation.
Problem:
Let 𝐴 = {1, 2, 3, 4, 5} and 𝑅 is defined on 𝐴 by 𝑅 = { 𝑥, 𝑦 , 𝑥 + 𝑦 = 5}. Is 𝑅 an
equivalence relation.
Example:
Let 𝐴 = 𝑍 × 𝑍 − {0}, we define the relation 𝑅 on 𝐴 by 𝑎, 𝑏 𝑅 𝑐, 𝑑 ↔ 𝑎𝑑 = 𝑏𝑐.
Solution:
(0,1) R (0,2)
(2,4) R (10,20)
(5,15) R (25,10)
1. 𝑅 is reflexive relation?
Let (𝑎, 𝑏) ∈ 𝐴, it is clear that 𝑎, 𝑏 𝑅 (𝑎, 𝑏) since 𝑎𝑏 = 𝑏𝑎.
2. 𝑅 is symmetric relation?
Let 𝑎, 𝑏 𝑅 𝑐, 𝑑 → 𝑎𝑑 = 𝑏𝑐 → 𝑏𝑐 = 𝑎𝑑 → 𝑐𝑏 = 𝑑𝑎 → 𝑐, 𝑑 𝑅 (𝑎, 𝑏).
3. 𝑅 is transitive relation?
Let 𝑎, 𝑏 𝑅 𝑐, 𝑑 ∧ 𝑐, 𝑑 𝑅 (𝑒, 𝑓), we have to show that 𝑎, 𝑏 𝑅 𝑒, 𝑓 ?
𝑎𝑑 𝑎𝑑
Since 𝑎𝑑 = 𝑏𝑐 ∧ 𝑐𝑓 = 𝑑𝑒 → 𝑐 = → 𝑐𝑓 = 𝑓 = 𝑑𝑒 → 𝑎𝑑𝑓 = 𝑏𝑑𝑒 →
𝑏 𝑏
𝑎𝑓 = 𝑏𝑒, ∴ 𝑎, 𝑏 𝑅 (𝑒, 𝑓) so that by (1), (2), and (3) 𝑅 is equivalence relation.
Functions
Definition: Let 𝑓 be a relation defined from a set 𝐴 to set 𝐵, then 𝑓 is called a
function " 𝑑𝑒𝑛𝑜𝑡𝑒𝑑 𝑏𝑦 𝑓: 𝐴 → 𝐵 " if the following holds:
1. ∀𝑎 ∈ 𝐴, ∃ 𝑏 ∈ 𝐵 such that (𝑎, 𝑏) ∈ 𝑓.
2. If 𝑎, 𝑏1 ∈ 𝑓 𝑎𝑛𝑑 𝑎, 𝑏2 ∈ 𝑓 𝑡ℎ𝑒𝑛 𝑏1 = 𝑏2 .
The set 𝐴 is called the domain of the function 𝑓, and 𝐵 is called the co-domain or
range of 𝑓. Further, if 𝑎 ∈ 𝐴 then the element in 𝐵 which is assigned to 𝑎 is called
image of 𝑎 and is denoted by 𝑓(𝑎).
Example:
1. Let 𝐴 = {𝑎, 𝑏, 𝑐, 𝑑} and 𝐵 = {𝑎, 𝑏, 𝑐}. Define a function 𝑓 of 𝐴 into 𝐵 be the
correspondence 𝑓 𝑎 = 𝑏, 𝑓 𝑏 = 𝑐, 𝑓 𝑐 = 𝑐 𝑎𝑛𝑑 𝑓 𝑑 = 𝑏 . By this definition, the
image for example are 𝑏 𝑎𝑛𝑑 𝑐.
2. Let 𝐴 = {1, 2, 3}, 𝑔: 𝐴 → 𝐴 defined by 𝑔 = { 1, 2 , 3, 1 } is not function because not
for each 𝑎 ∈ 𝐴, i.e. 2 ∈ 𝐴, ∄𝑏 ∈ 𝑠. 𝑡 (2, 𝑏) ∈ 𝑔.
3. ℎ: 𝐴 → 𝐴 define by ℎ: { 1, 3 , 2, 1 , 1, 2 , 3, 1 } is not function since (1, 2) ∈ ℎ and
(1, 3) ∈ ℎ but 2 ≠ 3.
Example: Let 𝐴 = {𝑚, 𝑛, 𝑜, 𝑝} and 𝐵 = {1, 2}. Determine whether the relation 𝑅 from
𝐴 𝑡𝑜 𝐵 is a function. If it is function, give its range.
1. 𝑅 = { 𝑚, 1 , 𝑛, 1 , 𝑜, 1 , 𝑝, 1 }.
2. 𝑅 = 𝑚, 1 , 𝑛, 2 , 𝑚, 2 , 𝑜, 1 , 𝑝, 2 .
3. 𝑅 = 𝑚, 2 , 𝑝, 1 , 𝑛, 1 , 𝑜, 1 , 𝑚, 1 .
Solution:
1. Yes function, 𝑅𝑎𝑛𝑔𝑒 𝑅 = {1}.
2. No.
3. No.
Problem: Let 𝐴 = {𝑤, 𝑥, 𝑦, 𝑧} and 𝐵 = {1, 2}. Determine whether the relation 𝑅 from
𝐴 𝑡𝑜 𝐵 is a function. If it is function, give its range.
1. 𝑅 = { 𝑤, 2 , 𝑥, 2 , 𝑦, 2 , 𝑧, 2 }.
2. 𝑅 = 𝑤, 1 , 𝑥, 2 , 𝑤, 2 , 𝑦, 1 , 𝑧, 2 .
3. 𝑅 = 𝑤, 2 , 𝑧, 1 , 𝑥, 1 , 𝑦, 1 , 𝑤, 1 .
Equal function
If 𝑓 𝑎𝑛𝑑 𝑔 are two functions defined on the same domain 𝐷 and if 𝑓 𝑎 = 𝑔(𝑎) for
every 𝑎 ∈ 𝐷, then the functions 𝑓 𝑎𝑛𝑑 𝑔 are equal and we write 𝑓 = 𝑔.
Example:
Let 𝑓 𝑥 = 𝑥 2 where 𝑥 is a real number. Let 𝑔 = 𝑥 2 where 𝑥 is a complex number,
then the function 𝑓 is not equal to 𝑔 since they have different domains.
Example: Let the function 𝑓 be defined by the diagram
1
1
2
3
2 4
Then 𝑓 is not a constant function since the range of 𝑓 consists of both 1 𝑎𝑛𝑑 2.
Definition: Let 𝑓 be a function of 𝐴 into 𝐵. Then 𝑓 is called
1. One – one [injective]
If 𝑥1 ≠ 𝑥2 → 𝑓(𝑥1 ) ≠ 𝑓(𝑥2 )
or
If 𝑓 𝑥1 = 𝑓 𝑥2 → 𝑥1 = 𝑥2
2. Onto [surjective]
If for each 𝑏 ∈ 𝐵, there exists 𝑎 ∈ 𝐴 such that 𝑓 𝑎 = 𝑏. i.e. 𝑓 𝐴 = 𝐵.
3. Bijective
If 𝑓 is both injective and surjective.
Example:
1. The identity function is injective since 𝐼 𝑥1 = 𝐼 𝑥2 → 𝑥1 = 𝑥2 .
2. The identity function is surjective since for each 𝑏 ∈ 𝐵, ∃ 𝑎 ∈ 𝐴 such that 𝑓 𝐴 = 𝐵.
3. Let 𝐴 = {𝑎, 𝑏, 𝑐, 𝑑}, 𝐵 = {𝑎, 𝑏, 𝑐}. Define by 𝑓 𝑎 = 𝑏, 𝑓 𝑏 = 𝑐, 𝑓 𝑐 = 𝑐 and 𝑓 𝑑 = 𝑏
then 𝑓 𝐴 = {𝑏, 𝑐} ≠ 𝐵 so that 𝑓 is not onto. x
a
4. Let A = 𝑎, 𝑏, 𝑐, 𝑑 , 𝐵 = {𝑥, 𝑦, 𝑧}, Let 𝑓: 𝐴 → 𝐵 define by b y
c
z
d
A C
(𝑔𝑜𝑓)
Example: B C
A
Let 𝑓: 𝐴 → 𝐵 𝑎𝑛𝑑 𝑔: 𝐵 → 𝐶 be defined by the diagram a x r
Then 𝑓 −1 𝑥 = 𝑏, 𝑐 , 𝑓 −1 𝑦 = 𝑎 , 𝑓 −1 𝑧 = ∅. b
y
c z
Graph Theory
Graph theory began in 1936 when Leonhard Euler solved a problem that had been
puzzling the good citizens of the town Kaliningrad in Russia. The river Pregl
divides the town into four sections, and in The Euler's days seven bridges
connected these sections. The people wanted to know if it were possible to start at
any location in town, cross every bridge exactly once, and return to the starting
location. Euler showed that it is impossible to take such a walk.
A problem in graph theory that attracted considerably more attention is the four-
color map problem. Frank Guthrie, a former student of Augustus De Morgan,
observed that he was able to color the map England so that no two adjacent
counties have the same color by using four different colors. He asked his brother,
who in 1852 was a student of De Morgan, to ask De Morgan whether his conjecture
that four colors will suffice to color every map so that no two adjacent counties
have the same color was true.
In 1879, Alfred Bray Kempe, a lawyer who had studied mathematics at Cambridge
University, published a proof of the four-color conjecture that was highly
acclaimed. Unfortunately, his proof had a fatal error. The theorem was finally
proved by the American mathematicians Kenneth Appel and wolfgang Haken at the
University of Illinois.
Graph
A graph is a nonempty finite set of vertices V along with a set E of 2-element
subsets of V. The elements of V are called vertices, and the elements of E are edges.
Mathematically, G=(V, E). where, E={(𝑣𝑖 , 𝑣𝑗 ), 𝑣𝑖 , 𝑣𝑗 ∈ 𝑉}.
Let us consider 𝑉 = {𝑃, 𝑄, 𝑇, 𝑆, 𝑅} and E={(P,Q), (P, T), (T,S), (Q,S), (Q,R), (S,R)}.
Hence, the graph G=(V, E) becomes as G G:
Example:
Let V={v_1,v_2 ,v_3,v_4,v_5,v_6} and E={(v_1,v_2), (v_1,v_3), (v_1,v_4), (v_4,v_5),
(v_5,v_6)}.
Hence, the graph becomes as G G:
Order and Size
The number of vertices in a graph G=(V, E) is called its order, and the number of
edges its size. That is the order of G is 𝑉 and its size 𝐸
Consider the following graph G G:
Adjacent Vertices
Two vertices are adjacent if they are joined by an edge. In other words, there is an
edge in the graph that has both vertices as endpoints.
Consider the graph G as
Here the vertices a and b are adjacent, b and c are adjacent,
G:
a and c are adjacent, c and d are adjacent. Vertices a and d
are not adjacent.
Parallel Edges
Two or more edges are called parallel edges when they have same end vertices.
Consider the graph G as G:
Here the edges p and q are parallel
Loop
A graph that contain an edge from a vertex to itself;
such an edge is referred to as loop.
Consider the graph G as
G:
It is clear that the edge 𝑒1 is a loop.
Simple and Multi Graph
If a graph has no loops and parallel edges then it's known as a simple graph,
otherwise a multi graph.
Consider the graphs G and D as G D:
Weighted Graph
In many applications, each edge of a graph has an associated numerical value,
called a weight.
Consider the graph G as
G:
Example:
Let us consider V={1, 2, 3, 4, 5} and E={𝑒1 , 𝑒2 , 𝑒3 , 𝑒4 , 𝑒5 }, where, 𝑒1 =(1, 2), 𝑒2 =(1, 3),
𝑒3 =(2, 4), 𝑒4 =(3, 4), 𝑒5 =(4, 5) and w(𝑒1 )=3, w(𝑒2 )=5, w(𝑒3 )=2, w(𝑒4 )=4, w(𝑒5 )=1. Find
the graph G.
Degree of Vertex
The degree of vertex is the number of edges having that vertex as an end point.
Isolated Vertex
A vertex with degree 0 is called an isolated vertex.
Example:
Consider the following graphs G and D
G:
In the graph in Figure G, the vertex A has
D:
degree 2, vertex B has degree 4, and vertex
E has degree 3. In Figure D, vertex a has
degree 4, vertex e (isolated degree) has
degree 0, and vertex b has degree 2.
Path
A path in a graph is a sequence of v_1 , v_2,…, v_k of vertices each adjacent to the
next, and a choice of an edge between each v_i and v_(i+1) so that no edge is
chosen more than once.
Consider the graph G as
Path is a, b, c, d or can use a, c, d G:
2. Draw a picture of the graph G=)V, E), where V={a, b, c, d, e}, E={𝑒1 , 𝑒2 , 𝑒3 , 𝑒4 , 𝑒5 , 𝑒6 },
and 𝑒1 = 𝑒5 = {𝑎, 𝑐}, 𝑒2 = {𝑎, 𝑑}, 𝑒3 = {𝑒, 𝑐}, 𝑒4 = {𝑏, 𝑐}, and 𝑒6 = {𝑒, 𝑑}.
3. Give the degree of each vertex in Figure a in 1.
4. Give the degree of each vertex in Figure c in 1.
5. List all paths that begin at a in Figure b in 1.
6. List three circuits that begin at 5 in Figure d in 1.
7. Which of the graphs in 1(a, b, or c) are regular?
If there is a path containing one or more edges which starts from a vertex 𝑣 and
terminates into the same vertex, then the path is known as a cycle.
Example
Consider the graph G as G:
0 0 3 0
5 0 1 7
the ordering A, B, C, and D is given as 𝐴 =
2 0 0 4
0 6 8 0
Example:
Consider the graph G as G:
Find the adjacency matrix of the graph with respect to the
ordering A, B, C and D.
Suppose that G be a simple undirected graph with 𝑚 vertices and 𝑛 edges, then the
incidence matrix I=[𝑎𝑖𝑗 ] is a matrix of order (𝑚 × 𝑛) where the element 𝑎𝑖𝑗 is
defined as
1; 𝑖𝑓 𝑣𝑒𝑟𝑡𝑒𝑥 𝑖 𝑏𝑒𝑙𝑜𝑛𝑔𝑠 𝑡𝑜 𝑒𝑑𝑔𝑒𝑠 𝑗
𝑎𝑖𝑗 =
0; 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Consider the graph G as G:
Two statements are said to be logically equivalent if their truth table are identical.
We denote the logical equivalent of 𝑝 𝑎𝑛𝑑 𝑞 by " ≡ ".
Example:
The truth tables of 𝑝 → 𝑞 ∧ 𝑞 → 𝑝 𝑎𝑛𝑑 𝑝 ↔ 𝑞 are as follows:
p q 𝒑→𝒒 𝒒→𝒑 𝒑 → 𝒒 ∧ (𝒒 → 𝒑)
T T T T T
T F F T F
F T T F F
F F T T T
p q 𝑝↔𝑞
T T T
T F F
F T F
F F T
Hence, 𝑝 → 𝑞 ∧ 𝑞 → 𝑝 ≡ 𝑝↔𝑞
Example:
The truth tables below show that 𝑝 → 𝑞 𝑎𝑛𝑑 ∿𝑝 ∨ 𝑞 are logically equivalent, i.e. 𝑝
→ 𝑞 ≡ ∿𝑝 ∨ 𝑞
p q 𝒑→𝒒 p q ∿𝒑 ∿𝒑 ∨ 𝒒
T T T T T F T
T F F T F F F
F T T F T T T
F F T F F T T
Problems
Show that
1. ∿(𝑝 ∧ 𝑞) ≡ ∿𝑝 ∧ ∿𝑞
2. ∿(𝑝 → 𝑞) ≡ 𝑝 ∧ ∿𝑞