Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Study Material_DM Unit-01_Set Theory & Logic_Part-01-Set Theory_SY B.tech Comp

The document is a study material for a Discrete Mathematics course focusing on Sets and Logics, prepared by Jameel Ahmad Ansari. It covers definitions, operations, and properties of sets, including set notation, cardinality, subsets, and various set operations like union, intersection, and difference. The material also references textbooks and provides examples to illustrate the concepts discussed.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Study Material_DM Unit-01_Set Theory & Logic_Part-01-Set Theory_SY B.tech Comp

The document is a study material for a Discrete Mathematics course focusing on Sets and Logics, prepared by Jameel Ahmad Ansari. It covers definitions, operations, and properties of sets, including set notation, cardinality, subsets, and various set operations like union, intersection, and difference. The material also references textbooks and provides examples to illustrate the concepts discussed.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Vishwakarma University

Faculty of Science &Technology Engineering


Department of Computer Engineering
S.Y.B.Tech Computer Engg Sem-III A.Y.2022-23
Study Material_Unit No.1 Sets and Logics
Course Name: Discrete Mathematics Topic: Sets
Course Instructor: Jameel Ahmad Ansari

Topics: Set, Naïve Set Theory (Cantorian Set Theory),.


Representation of Sets–Venn Diagrams, Roster Method. Set Operations – Intersection,
Union, Difference, Complement, Symmetric difference. Cardinality of set, Principle of
inclusion and exclusion, Multisets-operations & properties, Cartesian product

Text Books :
1. Kenneth H. Rosen, “Discrete Mathematics and its Applications”, 6th edition,
McGraw-Hill, 2007. ISBN 978-0-07-288008-3
2. C. L. Liu and D. P. Mohapatra, “Elements of Discrete Mathematics”, Six Edition,
Tata McGraw-Hill, 2008, ISBN 10:0-07-066913-9
Reference Books:
1. R. Johnsonbaugh, “Discrete Mathematics”, 5th Edition, Pearson Education, 2001,
ISBN 81 – 7808 – 279 - 9 (Recommended for Unit I and Unit II)
2. N. Deo, “Graph Theory with application to Engineering and Computer Science”,
Prentice Hall of India,1990, 0 – 87692 – 145 – 4
3. B. Kolman, R. Busby and S. Ross, “Discrete Mathematical Structures”, 4th Edition,
Pearson Education,2002, ISBN 81-7808-556-9
4. Semyour Lipschutz & Marc Lipson, “ Discrete Mathematics”, McGraw-Hill, 3rd
Special Indian Edition,ISBN-13 : 978-0-07-060174-1
5. N. Biggs, “Discrete Mathematics”, 3rd Edition, Oxford University Press, ISBN 0 –
19 –850717 – 8
6. E. Goodaire and M. Parmenter, “Discrete Mathematics with Graph Theory”, 2nd
edition, Pearson Education,2003 ISBN 81 – 7808 – 827 – 4

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
SET:
Definition: A set is a collection of well defined objects. These objects are called elements or
members of the set. or A set is an unordered collection of objects, called elements or
members of the set. or
A set is a collection of distinct objects. This means that {1, 2, 3} is a set but
{1, 1, 3} is not because 1 appears twice in the second collection. The second collection is
called a multiset. Sets are often specified with curly brace notation. The set of even
integers can be written:
{2n : n is an integer}

The opening and closing curly braces denote a set, 2n specifies the members of
the set, the colon says “such that” or “where” and everything following the colon are
conditions that explain or refine the membership. All correct mathematics can be
spoken in English. The set definition above is spoken “The set of twice n where n is an
integer”. The only problem with this definition is that we do not yet have a formal
definition of the integers. The integers are the set of whole numbers, both positive and
negative: {0, ±1, ±2, ±3, . . .}. We now introduce the operations used to manipulate sets,
using the opportunity to practice curly brace notation.

Naïve Set Theory (Cantorian Set Theory):

A naive theory in the sense of "naive set theory" is a non-formalized theory, that is,
a theory that uses a natural language to describe sets and operations on sets. The
words and, or, if ... then, not, for some, for every are treated as in ordinary mathematics.
As a matter of convenience, use of naive set theory and its formalism prevails even in
higher mathematics – including in more formal settings of set theory itself.

According to naive set theory, any definable collection is a set.


The first development of set theory was a naive set theory. It was created at the end
of the 19th century by Georg Cantor as part of his study of infinite sets and developed
by Gottlob Frege in his Begriffsschrift.
Naive set theory may refer to several very distinct notions. It may refer to
Informal presentation of an axiomatic set theory, e.g. as in Naive Set Theory by Paul
Halmos.
Define Naive Set Theory (NST) as the theory of predicate logic with a
binary predicate ∈ and the following axiom schema of unrestricted comprehension:
∃𝑦∀𝑥(𝑥 ∈ 𝑦 ⟺ 𝜑(𝑥))
for any formula 𝜑 with only the variable 𝑥 free. Substitute 𝑥 ∉ 𝑥 for (𝑥) . Then
by existential instantiation (reusing the symbol y) and universal instantiation we
have 𝑦 ∈ 𝑦 ⟺ 𝑦 ∉ 𝑦
(For more details Refer the topics: Russell's paradox, Zermelo–Fraenkel set theory,
Naive Set Theory by Paul Halmos)

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Notation:
Usually A, B,..., X, Y will denote sets and a, b, ..., x, y, ... will denote
elements. If a is an element of A, we write a ∈ A. If a is not an element of A write a ∉ A.
There are several ways to describe a set. One way is to list all the members of a set,
when this is possible. We use a notation where all members of the set are listed between
braces. For example, the notation {a, b, c, d} represents the set with the four elements a,
b, c, and d. This way of describing a set is known as the roster method.
e.g. The set V of all vowels in the English alphabet can be written as V = {a, e, i, o, u}.

The set of positive integers less than 100 can be denoted by {1, 2, 3, . . . , 99}.
Another way to describe a set is to use set builder notation. We characterize all those
elements in the set by stating the property or properties they must have to be members.
For instance, the set A of all odd positive integers less than 10 can be written as
A = {x | x is an odd positive integer less than 10},
or, specifying the universe as the set of positive integers, as
A = {x ∈ Z+ | x is odd and x < 10}.

e.g. of set:
The set of books in the Library.
The Greek alphabet.
The set of natural numbers with 0.
The set {1, 2, 3, 4} =
{x | x is an integer where x>0 and x<5 } =
{x | x is a positive integer whose square is >0 and <25}

Recall the notation for intervals of real numbers. When a and b are real numbers with
a < b, we write
[a, b] = {x | a ≤ x ≤ b}
[a, b) = {x | a ≤ x < b}
(a, b] = {x |a < x ≤ b}
(a, b) = {x |a < x < b}
Note that [a, b] is called the closed interval from a to b and (a, b) is called the open
interval from a to b.

Empty Set:
The empty set is a set containing no objects. It is written as a pair of curly braces
with nothing inside {} or by using the symbol ∅.
the empty set is a handy object. It is also quite strange. The set of all humans that
weigh at least eight tons, for example, is the empty set. Sets whose definition contains a
contradiction or impossibility are often empty.

Remarks:
1. The empty set, denoted by ∅, is the set that has no element.
2. N = {1, 2, . . .} = the set of Natural numbers;
3. W= {0, 1, 2, . . .} = the set of Whole numbers:
3. Z = {. . . ,−2,−1, 0, 1, 2, . . .} = the set of Integers;
4. Q = {p/q : p, q ∈ Z, q ≠ 0} = the set of Rational numbers;
5. R = Set of rational union set of Irrational numbers = the set of Real numbers; and
6. C = {𝑎 + 𝑖𝑏/ 𝑎 𝑎𝑛𝑏 𝑏 𝑎𝑟𝑒 𝑟𝑒𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟𝑠} = the set of Complex numbers.
Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
Cardinality:
The cardinality of a set is its size. For a finite set, the cardinality of a set is the
number of members it contains. In symbolic notation the size of a set S is written |A|.
A set A is said to have finite cardinality, denoted |A| or n(A), if the number of
distinct elements in A is finite, else the set A is said to have infinite cardinality.
for e.g.
1. If A = {lower case letters of the alphabet}, | A | = 26.
2. The cardinality of the empty set equals 0. That is, |∅| = 0.
3. Fix a positive integer n and consider the set A = {1, 2, . . . , n}. Then |A| = n.
4. Let S = {2x ∈ Z : x ∈ Z}. Then S is the set of even integers and it’s cardinality is infinite.

Subset: A set A is a subset of a set B, if all the elements in the set A also lie in the set B.
Denoted by A  B.(i. e. A  B if for all xA, xB)

Let A be a set. If B is a set such that each element of B is also an element of the set A,
then B is said to be a subset of the set A, denoted B ⊆ A and set B called as superset of A.
𝑺 ⊆ 𝑻 (S is a subset of T): every element of S is also an element of T
𝑺 ⊂ 𝑻 (S is a proper subset of T): S is a subset of T and 𝑆 ≠ 𝑇.

Equal Sets:
We say two sets are equal if they have exactly the same members.
Or Two sets A and B are said to be equal if A ⊆ B and B ⊆ A, denoted A = B.

e.g. If S = {1, 2, 3} then 3 ∈ S and 4 ∉ 𝑆. The set membership symbol is often used in
defining operations that manipulate sets. The set T = {2, 3, 1} is equal to S because they
have the same members: 1, 2, and 3. While we usually list the members of a set in a
“standard” order (if one is available) there is no requirement to do so and sets are
indifferent to the order in which their members are listed.

Complement of a set: Let A be a subset of a set U . Then the complement of A in U ,


denoted by A′ or 𝐴̅, is a set that contains every element of U that is not an element of A.
Specifically, A′ or 𝐴̅ = {x ∈ U : x ∉ A}.

e.g.:
i) Let the universal set be the integers. Then the compliment of the even
integers is the odd integers.
ii) Let the universal set be {1, 2, 3, 4, 5}, then the compliment of S = {1, 2, 3} is
𝑆 𝑐 = {4, 5} while the compliment of T = {1, 3, 5} is 𝑇 𝑐 = {2, 4}.

Union of two sets: The union of two sets A and B, written A ∪ B, is the set of elements
that are in A or in B (or both). A ∪ B = {x : x ∈ A or x ∈ B}.

e.g.:
Suppose S = {1, 2, 3}, T = {1, 3, 5}, and U = {2, 3, 4, 5}. Then:
S ∪ T = {1, 2, 3, 5}, S ∪ U = {1, 2, 3, 4, 5}, and T ∪ U = {1, 2, 3, 4, 5}

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Intersection of two sets: The intersection of two sets A and B, written A ∩ B, is the
set of elements that are in A and in B. A ∩ B = {x : x ∈ A and x ∈ B}.

e.g.:
Suppose S = {1, 2, 3, 5}, T = {1, 3, 4, 5}, and U = {2, 3, 4, 5}. Then:
S ∩ T = {1, 3, 5}, S ∩ U = {2, 3, 5}, and T ∩ U = {3, 4, 5}.

Disjoint Sets:
If A and B are sets and A ∩ B = ∅ then we say that A and B are disjoint, or disjoint sets.
Or Two sets are said to be disjoint if they have no elements in common (i.e A ∩ B = ∅).
e.g.:
1) the set of all even integers and set of all odd integers are disjoint sets.
2) the set of rational and set of irrational are disjoint sets.

Difference of two sets:


The difference of two sets A and B (also known as the set-theoretic difference of A and B,
or the relative complement of B in A) is the set of elements that are in A but not in B.

This is written 𝐴 − 𝐵, or sometimes A\B. 𝐴 − 𝐵 = {x : x ∈ A and x ∉ B} and


𝐵 − 𝐴, or sometimes B \A. 𝐵 − 𝐴 = {x : x ∈ B and x ∉ A}.

Symmetric difference of two sets:


The symmetric difference of two sets A & B is denoted by 𝐴∆𝐵 𝑜𝑟 𝐴 ⊕ 𝐵 & defined as
𝐴∆𝐵 𝑜𝑟 𝐴 ⊕ 𝐵 = (𝐴 − 𝐵) ∪ (𝐵 − 𝐴).

Example:
Let S be the set of non-negative multiples of two that are no more than twenty four. Let
T be the nonnegative multiples of three that are no more than twenty four.
i.e. 𝑆 = {0, 2,4,6,8,10,12,14,16,18,20,22,24}
𝑇 = {0, 3,6,9,12,15,18,21,24}

𝑆 − 𝑇 = {2,4,8,10,14,16,20,22} 𝑎𝑛𝑑 𝑇 − 𝑆 = {3,9,15,21}

Then 𝑆∆𝑇 = (𝑆 − 𝑇) ∪ (𝑇 − 𝑆) = {2, 3, 4, 8, 9, 10, 14, 15, 16, 20, 21, 22}

Remarks:
1. Let A be a set. Then A ⊆ A.
2. The empty set is a subset of every set.
Note: Set itself and empty set are called improper subet and other subsets called as
proper subsets.
3. Observe that N ⊆ Z ⊆ Q ⊆ R ⊆ C.
4. Let A be the set of odd integers and B be the set of even integers. Then A ∩ B = ∅ and
A∪B = Z. Thus, it also follows that the complement of A, in Z, equals B and vice-versa.
6. Let A = {{b, c}, {{b}, {c}}} and B = {a, b, c} be subsets of a set . Then A ∩ B = ∅ and
Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
A ∪ B = {a, b, c, {b, c}, {{b}, {c}} }.

Power Set: Let A be a non empty set . Then the set that contains all subsets of A is called
the power set of A and is denoted by P(A).

Examples:
1. Let A = {∅}. Then P(A) = {∅,A} = {∅, {∅}}.
2. Let A = {a, b, c}. Then P(A) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}.

3. The power set P({0, 1, 2}) is the set of all subsets of {0, 1, 2}. Hence,

P({0, 1, 2}) = {∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}.
Note that the empty set and the set itself are members of this set of subsets.

Q) What is the power set of the empty set? What is the power set of the set {∅}?
Solution: The empty set has exactly one subset, namely, itself. Consequently,
P(∅) = {∅}.
The set {∅} has exactly two subsets, namely, ∅ and the set {∅} itself. Therefore,
P({∅}) = {∅, {∅}}.

if 𝐴 = ∅ then |A| = 0 then | P(A)| = 20 = 1

Result: if |A| = n then | P(A)| = 2𝑛

Venn diagram :
A Venn diagram can be a useful way of illustrating relationships between sets.
In a Venn diagram:
• The universal set is represented by a rectangle. Points inside the rectangle
represent elements that are in the universal set; points outside represent things
not in the universal set. You can think of this rectangle, then, as a 'fence' keeping
unwanted things out - and concentrating our attention on the things we're
talking about.
• Other sets are represented by loops, usually oval or circular in shape, drawn
inside the rectangle. Again, points inside a given loop represent elements in the
set it represents; points outside represent things not in the set.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Set Laws:
1. (𝐴′ )′ = A Law of Double Complement
2. (𝐴 ∪ 𝐵)′ = 𝐴′ ∩ 𝐵 ′ De Morgan’s Laws
(𝐴 ∩ 𝐵)′ = 𝐴′ ∪ 𝐵 ′

3. A  B = B  A Commutative Laws

AB=BA

4. A  (B  C) = (A  B)  C Associative Laws

A  (B  C) = (A  B)  C

5. A  (B  C) = (A  B)  (A  C) Distributive Laws

A  (B  C) = (A  B)  (A  C)

6. A  A = A, A  A = A Idempotent Laws

7. A   = A, A  U = A Identity Laws

8. A  𝐴′ = U, A  𝐴′ =  Inverse Laws

9. A  U = U, A   =  Domination Laws

10. A  (A  B) = A Absorption Laws

A  (A  B) = A

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
De Morgan’s Laws:
Suppose that A and B are sets. De-Morgan’s Laws state that
1) (𝐴 ∪ 𝐵)𝑐 = 𝐴𝑐 ∩ 𝐵 𝐶 2) (𝐴 ∩ 𝐵)𝑐 = 𝐴𝑐 ∪ 𝐵 𝐶

Proof:
Let 𝑥 ∈ (𝐴 ∪ 𝐵)𝑐 ; then 𝑥 is not a member of A or B . Since 𝑥 is not a member of A we
see that ∈ 𝐴𝑐 . Similarly 𝑥 ∈ 𝐵 𝑐 . Since 𝑥 is a member of both these sets we see that
𝑥 ∈ 𝐴𝑐 ∩ 𝐵 𝐶 and we see that (𝐴 ∪ 𝐵)𝑐 ⊆ 𝐴𝑐 ∩ 𝐵 𝐶 ........(1)
Let 𝑦 ∈ 𝐴𝑐 ∩ 𝐵 𝐶 Then the definition of intersection tells us that 𝑦 ∈ 𝐴𝑐 and 𝑦 ∈ 𝐵 𝑐 .
This in turn lets us deduce that 𝑦 is not a member of ∪ 𝐵 , since it is not in either set, and
so we see that 𝑦 ∈ (𝐴 ∪ 𝐵)𝑐 . This demonstrates that 𝐴𝑐 ∩ 𝐵 𝐶 ⊆ (𝐴 ∪ 𝐵)𝑐 ...........(2)
From (1) and (2), we get that (𝐴 ∪ 𝐵)𝑐 = 𝐴𝑐 ∩ 𝐵 𝐶 and we have proven part 1). The
proof of part 2) is left as an exercise.

Q) Disproof by counter example Prove that the statement 𝐴 ∪ 𝐵 = 𝐴 ∩ 𝐵 is false.


Answer: Let A = {1, 2} and B = {3, 4}. Then A ∩ B = ∅ while A ∪ B = {1, 2, 3, 4}. The sets A
and B form a counter-example to the statement. Result is true only if both A and B are
empty sets.

The Inclusion–Exclusion principle:


The inclusion–exclusion principle is a counting technique which generalizes the
familiar method of obtaining the number of elements in the union of two finite sets;
symbolically expressed as
1) |A ∪ B| = |A| + |B| − |A ∩ B|. or 𝑛(𝐴 ∪ 𝐵) = 𝑛(𝐴) + 𝑛(𝐵) − 𝑛(𝐴 − 𝐵)
2) |A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |B ∩ C| − |A ∩ C| + |A ∩ B ∩ C|
Or 𝑛(𝐴 ∪ 𝐵) = 𝑛(𝐴) + 𝑛(𝐵) + 𝑛(𝐶) − 𝑛(𝐴 ∩ 𝐵) − 𝑛(𝐴 ∩ 𝐶) − 𝑛(𝐵 ∩ 𝐶) + 𝑛(𝐴 ∩ 𝐵 ∩ 𝐶)

Remark:
Let A = {𝑎1 ,𝑎2 , 𝑎3 , . . . , 𝑎𝑚 } and B = {𝑏1 ,𝑏2 , 𝑏3 , . . . , 𝑏𝑚 } be two finite subsets of a set ,
with |A| = m and B| = n. Also, assume that A ∩ B = ∅. Then, by definition it follows that A
∪ B = {𝑎1 ,𝑎2 , 𝑎3 , . . . ,𝑎𝑚 , 𝑏1 ,𝑏2 , 𝑏3 , . . . , 𝑏𝑚 } and hence |A ∪ B| = |A| + |B|.

Example 01:
In a class of 100 students, 35 like science and 45 like math. 10 like both. How many
like either of them and how many like neither?
Solution:
Total number of students, n(µ) = 100

Number of science students, n(S) = 35

Number of math students, n(M) = 45

Number of students who like both, n(M∩S) = 10


Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
Number of students who like either of them,

n(MᴜS) = n(M) + n(S) – n(M∩S)

→ 45+35-10 = 70

Number of students who like neither = n(µ) – n(MᴜS) = 100 – 70 = 30

The easiest way to solve problems on sets is by drawing Venn diagrams, as shown
below.

As it is said, one picture is worth a thousand words. One Venn diagram can help solve
the problem faster and save time. This is especially true when more than two categories
are involved in the problem.

Example 02: There are 30 students in a class. Among them, 8 students are learning
both English and French. A total of 18 students are learning English. If every student is
learning at least one language, how many students are learning French in total?
Solution:
The Venn diagram for this problem looks like this.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Every student is learning at least one language. Hence there is no one who fall in the
category ‘neither’.

So in this case, n(EᴜF) = n(µ).

It is mentioned in the problem that a total of 18 are learning English. This DOES NOT
mean that 18 are learning ONLY English. Only when the word ‘only’ is mentioned in the
problem should we consider it so.

Now, 18 are learning English and 8 are learning both. This means that 18 – 8 = 10 are
learning ONLY English.

n(µ) = 30, n(E) = 10

n(EᴜF) = n(E) + n(F) – n(E∩F)

30 = 18+ n(F) – 8

n(F) = 20

Therefore, total number of students learning French = 20.

Note: The question was only about the total number of students learning French and
not about those learning ONLY French, which would have been a different answer, 12.
Finally, the Venn diagram looks like this.

Example 3: Among a group of students, 50 played cricket, 50 played hockey and 40


played volley ball. 5 played both cricket and hockey, 10 played both hockey and volley
ball, 5 played cricket and volley ball and 10 played all three. If every student played at
least one game, find the number of students and how many played only cricket, only
hockey and only volley ball?

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Solution:
n(C) = 50, n(H) = 50, n(V) = 40

n(C∩H) = 5

n(H∩V) = 10

n(C∩V) = 5

n(C∩H∩V) = 10

No. of students who played atleast one game

n(CᴜHᴜV) = n(C) + n(H) + n(V) – n(C∩H) – n(H∩V) – n(C∩V) + n(C∩H∩V)

= 50 + 50 + 40 – 5 – 10 – 5 + 10

Total number of students = 130.

No. of students who played only cricket = n(C) – [n(C∩H) + n(C∩V) + n(C∩H∩V)] = 50 –
(5+5+10) = 30.

No. of students who played only hockey = n(H) – [n(C∩H) + n(H∩V) + n(C∩H∩V)]
= 50 – (5+10+10) = 25.
No. of students who played only volley ball = n(V) – [n(H∩V) + n(C∩V) +n(C∩H∩V)]
=40-(10+5+10) = 15.

Alternatively, we can solve it faster with the help of a Venn diagram.


The Venn diagram for the given information looks like this.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Subtracting the values in the intersections from the individual values gives us the
number of students who played only one game.

Countable set:
a countable set is a set with the same cardinality (number of elements) as
some subset of the set of natural numbers. A countable set is either a finite set or a
countably infinite set. Whether finite or infinite, the elements of a countable set can
always be counted one at a time and, although the counting may never finish, every
element of the set is associated with a unique natural number.
A set S is countable if there exists an injective function (one to one) f from S to
the natural numbers N = {0, 1, 2, 3, ...}.

Uncountable set :
an uncountable set (or uncountably infinite set) is an infinite set that contains too
many elements to be countable. The uncountability of a set is closely related to
its cardinal number. A set is uncountable if its cardinal number is larger than that of the
set of all natural numbers.
A set S is uncountable if there does not exists an injective function (one to one)
f from S to the natural numbers N = {0, 1, 2, 3, ...}.

Results:
1) Z (the set of all integers) and Q (the set of all rational numbers) are countable.
2) Any finite union of countable sets is countable.
3) The union of countably many countable sets is countable.
4) The set of all finite-length sequences of natural numbers is countable.
5) Any finite set is countable.
6) Any subset of a countable set is countable.
7) If A and B are countable sets then A ∪ B is countable
8) If an uncountable set X is a subset of set Y, then Y is uncountable.

Q) Show that the set of all integers is countable.


Solution: We can list all integers in a sequence by starting with 0 and alternating
between positive and negative integers: 0, 1,−1, 2,−2, . . . . Alternatively, we could find a
one-to-one correspondence between the set of positive integers and the set of all
integers. Set a function from integers to natural numbers such that f (n) = n/2 when n is
even and f (n) = −(n − 1)/2 when n is odd(to show that the function 1-1 and onto).
Consequently, the set of all integers is countable.

Q) Show that the set of odd positive integers is a countable set.


Solution: To show that the set of odd positive integers is countable, we will show a one-
to-one correspondence between this set and the set of positive integers. Consider the
function f (n) = 2n – 1 from Z+ to the set of odd positive integers. We show that f is a
one-to-one correspondence by showing that it is both one-to-one and onto. To see that
it is one-to-one, suppose that f (n) = f (m). Then 2n − 1 = 2m − 1, so n = m. To see that it is
onto, suppose that t is an odd positive integer. Then t is 1 less than an even integer 2k,
where k is a natural number. Hence t = 2k − 1 =f (k).

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Multiset:
A multiset is a collection of unordered numbers (or other elements), where every
element x occurs a finite number of times. The positive integer number of instances,
given for each element is called the multiplicity of this element in the multiset
The difference between sets and multisets is in how they address multiples: a set
includes any number at most once, while a multiset allows for multiple instances of the
same number. There is just one set with elements a and b, the set {a,b}, but there are
many multisets: {a, b, b}, {a, a, b}, and {a, a, a, a, b, b} are just a few.
In multiset {a, a, b}, the element a has multiplicity 2, and b has multiplicity 1.
In multiset {a, a, a, b, b, b}, a and b both have multiplicity 3.
The cardinality of a multiset is constructed by summing up the multiplicities of all its
elements. For example, in the multiset {a, a, b, b, b, c} the multiplicities of the
members a, b, and c are respectively 2, 3, and 1, and therefore the cardinality of this
multiset is 6.
Let A and B are multisets in a given universe U, with multiplicity
functions Am and Bm &
mA (x) = multiplicity of x in set A,
Subset: A is subset of B if mA (x) ≤ mB (x), for all x in U.
Union: the union of A and B is the multiset C with multiplicity function
mC (x) = max(mA (x), mB (x)), for all x in U.
Intersection: the intersection of A and B is the multiset C with multiplicity function
mC (x) = min(mA (x), mB (x)), for all x in U.
Sum: the sum of multisets may be viewed as a generalization of the disjoint union of
setsnand is defined by
mC (x) = mA (x) + mB (x), for all x in U.

Example: Let 𝐴 = {𝑎, 𝑎, 𝑎, 𝑎, 𝑎, 𝑎, 𝑏, 𝑏, 𝑏, 𝑏, 𝑏, 𝑐, 𝑐, 𝑐, 𝑐, 𝑑, 𝑑, 𝑑, 𝑒, 𝑒, 𝑒, ℎ, ℎ, ℎ}

𝐵 = {𝑎, 𝑎, 𝑎, 𝑎, 𝑎, 𝑏, 𝑏, 𝑏, , 𝑐, 𝑐, 𝑐, 𝑐, 𝑐, 𝑑, 𝑑, 𝑒, 𝑒, 𝑒, 𝑒, 𝑓, 𝑓} be two multisets then


find i) |𝐴| ii) |𝐵| iii) |𝐴 ∪ 𝐵| iv) |𝐴 ∩ 𝐵|

Solution: we Know that mA (x) = multiplicity of x in set A


Therefore
mA (a) = 6, mA (b) = 5, mA (c) = 4, mA (d) = 3, mA (e) = 3, mA (f) = 0, mA (h) = 3

mB (a) = 5, mB (b) = 3, mB (c) = 5, mB (d) = 2, mB (e) = 4, mB (f) = 2, mB (h) = 0

By definition, |𝐴| = mA (a) + mA (b) + mA (c) + mA (d) + mA (e) + mA (h)


Therefore |𝐴| = 6 + 5 + 4 + 3 + 3 + 3 = 24

By definition, |𝐵| = mB (a) + mB (b) + mB (c) + mB (d) + mB (e) + mB (f)


Therefore |𝐵| = 5 + 3 + 5 + 2 + 4 + 3 = 21

And 𝐴 ∪ 𝐵 = {𝑎, 𝑎, 𝑎, 𝑎, 𝑎, 𝑎, 𝑏, 𝑏, 𝑏, 𝑏, 𝑏, 𝑐, 𝑐, 𝑐, 𝑐, 𝑐, 𝑑, 𝑑, 𝑑, 𝑒, 𝑒, 𝑒, 𝑒, 𝑓, 𝑓, ℎ, ℎ, ℎ}

𝐴 ∩ 𝐵 = {𝑎, 𝑎, 𝑎, 𝑎, 𝑎, 𝑏, 𝑏, 𝑏, 𝑐, 𝑐, 𝑐, 𝑐, 𝑑, 𝑑, 𝑒, 𝑒, 𝑒}
After Calculation we get |𝐴 ∪ 𝐵| = 27 𝑎𝑛𝑑 |𝐴 ∩ 𝐵| = 17
Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
Cartesian product:
Let A and B be two sets. Then their Cartesian product is denoted by A × B, is defined as
A × B = {(a, b) / a ∈ A and b ∈ B}.
Example:
1) Let A = {a, b, c} and B = {1, 2, 3, 4}. Then
A × A = {(a, a), (a, b), (a, c), (b, a), (b, b), (b, c), (c, a), (c, b), (c, c)}.
A × B = {(a, 1), (a, 2), (a, 3), (a, 4), (b, 1), (b, 2), (b, 3), (b, 4), (c, 1), (c, 2), (c, 3), (c, 4)}.
2) The Euclidean plane, denoted R2 = R × R = {(x, y) / x ∈ R}.

Note that the Cartesian products 𝐴 × 𝐵 and 𝐵 × 𝐴 are not equal, unless 𝐴 = ∅ 𝑜𝑟 𝐵 = ∅
(so that 𝐴 × 𝐵 = ∅) or 𝐴 = 𝐵.

e.g. What is the Cartesian product 𝐴 × 𝐵 × 𝐶, where A = {0, 1}, B = {1, 2}, and
C = {0, 1, 2} ?
Solution: The Cartesian product 𝐴 × 𝐵 × 𝐶 consists of all ordered triples (a, b, c), where
a ∈ A, b ∈ B, and c ∈ C. Hence,
𝐴 × 𝐵 × 𝐶 = {(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)}.

Remark:
1) Note that when A, B, and C are sets, (𝐴 × 𝐵) × 𝐶 is not the same as 𝐴 × 𝐵 × 𝐶.
2) If A and B are two non empty set with |𝐴| = 𝑚 𝑎𝑛𝑑 |𝐵| = 𝑛 then |𝐴 × 𝐵| = 𝑚 × 𝑛

Computer Representation of Sets:


There are various ways to represent sets using a computer. One method is to
store the elements of the set in an unordered fashion. However, if this is done, the
operations of computing the union, intersection, or difference of two sets would be
time-consuming, because each of these operations would require a large amount of
searching for elements. We will present a method for storing elements using an
arbitrary ordering of the elements of the universal set. This method of representing sets
makes computing combinations of sets easy.
Assume that the universal set U is finite (and of reasonable size so that the
number of elements of U is not larger than the memory size of the computer being
used). First, specify an arbitrary ordering of the elements of U, for instance 𝑎1 ,𝑎2 , 𝑎3 , . . .
, 𝑎𝑛 . Represent a subset A of U with the bit string of length n, where the ith bit in this
string is 1 if ai belongs to A and is 0 if 𝑎𝑖 does not belong to A. Following example
illustrates this technique.
EXAMPLE: Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, and the ordering of elements of U has the
elements in increasing order; that is, 𝑎𝑖 = 𝑖. What bit strings represent the subset of all
odd integers in U, the subset of all even integers in U, and the subset of integers not
exceeding 5 in U?
Solution: The bit string that represents the set of odd integers in U, namely, {1, 3, 5, 7,
9}, has a one bit in the first, third, fifth, seventh, and ninth positions, and a zero
elsewhere. It is 10 1010 1010.
(We have split this bit string of length ten into blocks of length four for easy reading.)
Similarly,
we represent the subset of all even integers in U, namely, {2, 4, 6, 8, 10}, by the string
01 0101 0101.
Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
The set of all integers in U that do not exceed 5, namely, {1, 2, 3, 4, 5}, is represented by
the string 11 1110 0000.
Using bit strings to represent sets, it is easy to find complements of sets and unions,
intersections, and differences of sets. To find the bit string for the complement of a set
from the bit string for that set, we simply change each 1 to a 0 and each 0 to 1, because
x ∈ A if and only if 𝑥 ∉ 𝐴̅. Note that this operation corresponds to taking the negation of
each bit when we associate a bit with a truth value—with 1 representing true and 0
representing false.
EXAMPLE: We have seen that the bit string for the set {1, 3, 5, 7, 9} (with universal set
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) is 10 1010 1010.
What is the bit string for the complement of this set?
Solution: The bit string for the complement of this set is obtained by replacing 0s with
1s and vice versa. This yields the string
01 0101 0101,
Which corresponds to the set {2, 4, 6, 8, 10}.
To obtain the bit string for the union and intersection of two sets we perform bitwise
Boolean operations on the bit strings representing the two sets. The bit in the 𝑖 𝑡ℎ
position of the bit string of the union is 1 if either of the bits in the 𝑖 𝑡ℎ position in the
two strings is 1 (or both are 1), and is 0 when both bits are 0. Hence, the bit string for
the union is the bitwise OR of the bit strings for the two sets. The bit in the ith position
of the bit string of the intersection is 1 when the bits in the corresponding position in
the two strings are both 1, and is 0 when either of the two bits is 0 (or both are). Hence,
the bit string for the intersection is the bitwise AND of the bit strings for the two sets.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari

You might also like