Slide 1 Set Theory

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 61

What is Discrete

Mathematics?

1
From http://dictionary.oed.com:
Discrete adj.
1. a. Separate, detached from others, individually distinct.
Opposed to continuous.
2. a. Consisting of distinct or individual parts;
discontinuous.

According to writer Kenneth H. Rosen-


Discrete mathematics is the part of mathematics devoted to the
study of discrete objects.

2
Kind of problems solving using discrete mathematics

• How many ways are there to choose a valid password on a computer system?
• What is the probability of winning a lottery?
• Is there a link between two computers in a network?
• What is the shortest path between two cities using a transportation system?
• How can a list of integers be sorted so that the integers are in increasing order?
• How many steps are required to do such a sorting?
• How can it be proved that a sorting algorithm correctly sorts a list?
• How can a circuit that adds two integers be designed?
• How many valid Internet addresses are there?

3
Application Area

• Advanced algorithms & data • Database management systems


structures • Cryptography
• Programming language compilers & • Error correction codes
interpreters. • Graphics & animation
• Computer networks algorithms, game engines, etc.…
• Operating systems • I.e., the whole field!
• Computer architecture

4
Books?
Discrete Mathematics
Schema’s outline series: Seymour Lipshutz.

Discrete Mathematics and Its Applications


McGraw-Hill: Kenneth H. Rosen

5
Set Theory

6
Every extraordinary feat began in ordinary circumstances. I will start my journey of success from where I am now.
Set Basics
Definition
A set is an unordered collection of objects, called elements or members
of the set. A set is said to contain its elements.

Example
 People in a class: {Jui, Sujit, Salman, Koni}

 Districts in the BD : {Rajshahi, Dhaka, Nator, … }

 Sets can contain non-related elements: {3, a, Potato}

 All positive numbers less than or equal to 5: {1, 2, 3, 4, 5}


Set Basics
Definition

A set is an unordered collection of “objects”

Example
 People in a class: {Trisha, Tanvir, Tonmoy, Keya}

 Districts in the BD : {Rajshahi, Dhaka, Nator, … }

 Sets can contain non-related elements: {3, a, Potato}

 All positive numbers less than or equal to 5: {1, 2, 3, 4, 5}


Set Basics
Definition
A set is an unordered collection of objects, called elements or members
of the set. A set is said to contain its elements.

• We write a ∈ A to denote that a is an element of the set A. ( = belongs to)


• The notation a ∈ A denotes that a is not an element of the set A. (

• It is common for SETS to be denoted using uppercase letters.


• Lowercase letters are usually used to denote elements of sets.
Set Basics
Definition
A set is an unordered collection of objects, called elements or members
of the set. A set is said to contain its elements.

• We write a ∈ Ato denote that a is an element of the set A. ( = belongs to)


• The notation a ∈ A denotes that a is not an element of the set A. (

• It is common for SETS to be denoted using uppercase letters.


• Lowercase letters are usually used to denote elements of sets.
Set and Elements
Let, A = { 1, a, e, u, i, o, 2, 3}
• Name of the Set?
• 1 (true or false)
• a A (true or false)

11
Mathematical symbols
• Mention the logic symbols in maths.
• The logic symbols in maths are:
AND (∧) Conjunction
OR (∨) Disjunction
NOT (¬) Negation
Implies (⇒) (only if; if - then)
Equivalent (⇔) (if and only if, Biconditional in
logic)
For all (∀)
There exists (∃)
L5 12
How to describe a Set?
Three popular methods

1. Word description
Set of even counting numbers less than 10
2. The listing method / Roster method
{2, 4, 6, 8}
3. Set-builder notation
{x | x is an even counting number less than 10}
13
How to describe a Set?
1. Word description
• Make a word description of the set.

14
How to describe a Set?
2. Roster Method
• Represented by listing its elements between braces {}
• Example :
• Sometime use ellipses (...) rather than listing all elements.
• The set of positive integers less than 100 can be denoted by
{1,2,3,...,99}.

15
How to describe a Set?
3. Set-builder notation
• characterize all elements in the set by stating the property or properties they must have to
be members.
• the set O of all odd positive integers less than 10 can be written as
O = { x | x is an odd positive integer less than 10 }
O = { x ∈ Z+ | x is odd and x < 10 }

Example: B = {x | x is an even integer, x > 0}


• Read as “B is the set of x such that x is an even integer and x is greater than 0”
• | is read as “such that” and comma as “and”.
16
How to describe a Set?
3. Set-builder notation with interval
• 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} or {a,b} = {x ∈ R | 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. 17
Often used sets
• N = {0, 1, 2, 3, …} is the set of natural numbers (all positive numbers)
• Z = {…, -2, -1, 0, 1, 2, …} is the set of integers (all positive and negative whole numbers)
• Z+ = {1, 2, 3, …} is the set of positive integers (a.k.a whole numbers)
– Note that people disagree on the exact definitions of whole numbers and natural numbers

• Q = {p/q | p  Z, q  Z, q ≠ 0} is the set of rational numbers


– Any number that can be expressed as a fraction of two integers (where the bottom one is not zero)

• R is the set of real numbers ( includes all numbers on the number line)
• R+ the set of positive real numbers
• C the set of complex numbers. A combination of a real number (a) and an imaginary
number (bi). 1+2i,1,i,−3i,0,−5+i1+2i,1,i,−3i,0,−5+i.
18
Specifying
Specifying Sets Set
(cont.)
• A = {a, e, i, o, u}

A = {x | x is a letter in English, x is a vowel}

• B = {x | x is an even integer, x > 0}

B = {2, 4, 6, …….}

• E = {x | }

E = {1, 2}
19
Specifying
Specifying Sets Set
(cont.)
• A = {x: x  Z, x is even, x <15 }

A = {… -8, -6, -4, -2, 0, 2, 4, …., 14}

• B = {x: x  Z, x + 4 = 3 }

B = {-1}
• C = {x: x  Z, x2 + 2 = 6 }
E = {-2, +2}
20
Set - properties

Order does not matter


– {1, 2, 3, 4, 5} is equivalent to {3, 5, 2, 4, 1}

Frequency does not matter


- Consider the list of students in this class
• It does not make sense to list somebody twice

21
Set Terminology : The universal set

Definition
U is the universal set – the set of all of elements (or the “universe”) from
which given any set is drawn

• For the set {-2, 0.4, 2}, U would be the real numbers
• For the set {0, 1, 2}, U could be the N, Z, Q, R depending on the context
• For the set of the vowels of the alphabet, U would be all the letters of the
alphabet

22
Set Terminology : The Empty Set
Definition
If a set has zero elements, it is called the empty (or null) set

• Written using the symbol 


• Thus,  = { }  VERY IMPORTANT
• It can be a element of other sets
{ , 1, 2, 3, x } is a valid set

• ≠{}
The first is a set of zero elements
The second is a set of 1 element [A set with one element is called a singleton set]
23
Venn diagrams
• Represents sets graphically
– The box represents the universal set
– Circles represent the set(s)
• Consider set S, which is the set of all b c d f
U
vowels in the alphabet g h j S
• The individual elements are usually not k l m

written in a Venn diagram n p q a e i

r s t
o u
v w x
y z

24
Set Terminology : Subset
Definition
The set A is a sub set of B if and only if every element of A is also an
element of B.

• We use the notation A ⊆ B to indicate that A is a subset of the set B.

We see that A ⊆ B if and only if the quantification ∀x (x∈ A → x ∈ B) is true

25
Set Terminology : Subset
Example
• If A = {2, 4, 6} and B = {1, 2, 3, 4, 5, 6, 7}; A is a subset of B
• If A = {1, 2, 3, 4} and B = {1, 2, 3, 4}; A is a subset of B

• Every nonempty set S has at least two subset


For any set S, S  S (S S  S)
For any set S,   S (S   S)

26
Set Terminology : Proper Subset
Definition
When a set A is a subset of a set B but that A B, we write A ⊂ B and say
that A is a proper subset of B.
• For A ⊂ B to be true, it must be the case that A ⊆ B and there must exist an
element y of B that is not an element of A.

That is, A is a proper subset of B if and only if


∀x (x ∈ A → x ∈ B) ∧ ∃y (y ∈ B ∧ y A) is true
∀x, ∀y = for all x, for all y
∃x, ∃y = there exist an x, there exist a y
27
Set Terminology : Proper Subset
Example
• If A = {2, 4, 6} and B = {1, 2, 3, 4, 5, 6, 7}; A is a subset of B and also proper subset
A B and A B both are true.
• If A = {1, 2, 3, 4} and B = {1, 2, 3, 4}; A is not a proper subset of B but subset.
A B but A B.

28
Set Terminology : Set Equality
Definition
Two sets are equal if and only if (↔) they have the same elements. We
write A = B if A and B are equal sets.

• Therefore, if A and B are sets, then A and B are equal if and only if
∀x (x ∈ A ↔ x ∈ B)

29
Set Terminology : Set Equality
Example
• Let two sets A = {1, 2, 3} and B = {3, 2, 1}
then A = B (true or false?)
• Let two sets A = {1, 2, 3} and B = {3, 3, 2, 1, 2, 1}
then A = B (true or false?)

A = {x: x is an odd positive integer less than 10}


B = {1, 3, 5, 7, 9}

A=B?
30
Set Terminology : Set Cardinality
Definition
Let S be a set. If there are exactly n distinct elements in S where n is a
nonnegative integer, we say that S is a finite set and that n is the
cardinality of S. The cardinality of S is denoted by |S|.

The term cardinality comes from the common usage of the term cardinal number as
the size of a finite set.

31
Set Terminology : Set Cardinality
Example

• Let A be the set of odd positive integers less than 10. Then |A| = 5.

• Let S be the set of letters in the English alphabet. Then |S| = 26

• Let R = {1, 2, 3, 4, 5}. Then |R| = 5.

• || = 0

• = 1

32
Set Terminology : Finite Set and Infinite
Set
Definition : Finite Set

Let S be a set. If there are exactly n distinct elements in S where n is a


nonnegative integer, we say that S is a finite set
• R = {1, 2, 3, 4, 5} finite set

Definition : Infinite Set

A set is said to be infinite if it is not finite.

• The set of positive integers is infinite.

33
Set Terminology : Power Set
Definition
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).

• What is the power set of the set {0,1,2}?

• What is the power set of the empty set?

• What is the power set of the set{∅}?

34
Set Terminology : Cartesian Product

Definition
Let A and B be sets. The Cartesian product of A and B, denoted by A x B,
is the set of all ordered pairs (a, b) where a  A and b B.
Hence A×B = {(a, b) | a ∈ A ∧ b ∈ B}.

Let, A = {1, 2} and B = {a, b, c}


A x B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}
BxA= ?

35
Set Operations

36
Every extraordinary feat began in ordinary circumstances. I will start my journey of success from where I am now.
Set Operation
Operations
• Union ()
• Intersection ()
• Difference (-)
• Complement (“—”)
• Symmetric Difference ()

Operation into tow sets A and B give us new sets


• AB,
• AB,
• A-B,
• AB, and
37
Set Operation : Union

Definition
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.

A U B = { x | x A x B }

A = {1, 2, 5, 7}, B = {3, 4, 5, 6} AUB= { 1, 2, 3, 4, 5, 6, 7}

38
Set Operation : Intersection

Definition
Let A and B be sets. The intersection of the sets A and B, denoted by
A∩B, is the set containing those elements in both A and B.

A B = { x | x A x B }

A = {1, 2, 5, 7}, B = {3, 4, 5, 6} AB= {5}

39
Union and Intersection in VD

40
Set Operation : Union and Intersection

Examples
A = {1, 2, 3, 4}, B = {3, 4, 5, 6, 7}, C = {2, 3, 5, 7}

• AUB= ?
• AUC= ?
• A∩B= ?
• B∩C=?

41
Disjoint Sets
Definition
Two sets are called disjoint if their intersection is the empty set.
i.e. A  B =  .

{a, b} and {3, 4} are disjoint U

A B

42
Disjoint Union
Definition
• When A and B are disjoint, the disjoint union operation is well defined.
The circle above the union symbol indicates disjointedness.

 U
A B
A B

43
Set Operation : principle
of inclusion–exclusion

44
Set Operation : Difference
Definition
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 called the complement of B with respect to A.

A − B = { x | x ∈ A ∧ x B}

• The difference of A and B is also called the complement of B with respect to A.


• The difference of sets A and B is sometimes denoted by A \ B.

45
Set Operation : Difference
Example
• Let A = {1, 3, 5}, B = {1, 2, 3}
A – B = {5}
• Let A = {1, 3, 5, 6}, B = {1, 2, 3,9,10}
A – B = {5, 6}

46
Set Operation : Complement
Definition
Let U be the universal set. The complement of the set A, denoted by , is
the complement of A with respect to U. Therefore, the complement of the
set A is U−A.

A = {x ∈ U | x A}.

47
Set Operation : Symmetric Difference

Definition
Let A and B be sets. The symmetric difference of A and B, denoted by A
B, is the set containing those elements that are either in A or in
AB, but not
in both. B
A B = { x | x ∈ A x B x (A }
U
All elements x such that x is an element of A OR x is an element of B AND x is not an A B
element of A intersection B

(^ = AND), (∨ =
OR)
A B = (A ∪ - (A

48
How to Prove a Set identities
Five Methods

• Use the basic set identities

• Use membership tables

• Prove each set is a subset of each other

• Use set builder notation and logical equivalences

• Use Venn Diagram

49
Set identities

A = A AU = U
Identity Law Domination law
AU = A A = 
AA = A
Idempotent Law (Ac)c = A Complement Law
AA = A
AB = BA (AB)c = Ac  Bc
Commutative Law De Morgan’s Law
AB = BA (AB)c = Ac  Bc

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


Associative Law Distributive Law
A(BC) = (AB)C A(BC) = (AB)(AC)

A(AB) = A A  Ac = U
Absorption Law Complement Law
A(AB) = A A  Ac = 
Set identities: (A  B )  C = A  (B  C )
Using set definition and set builder notation

Proof : (AB )C = {x | x  A B  x  C } (by def.)


= {x | (x  A  x  B )  x  C } (by def.)
= {x | x  A  ( x  B  x  C ) } (logical assoc.)
= {x | x  A  (x  B  C ) } (by def.)
= A(B C ) (by def.)


51
Set identities =∪
Use set builder notation and logical equivalences

52
Set identities : A ∩ (B∪C) = (A∩B) ∪ (A∩C)
Use a membership table

53
Set identities = (∪)
Use set identity law

54
Set Identities via Venn

It’s often simpler to understand an identity by drawing a Venn


Diagram.
For example DeMorgan’s first law
A  B A  B
can be visualized as follows.

55
Visual DeMorgan

A: B:

56
Visual DeMorgan

A: B:

A B :

57
Visual DeMorgan

A: B:

L5 58
Visual DeMorgan

A: B:

A: B:

59
Visual DeMorgan

A: B:

A: B:

AB :
60
Visual DeMorgan

AB 

=
AB 
L5 61

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy