Discrete Structure

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

DISCRETE STRUCTURES 1 mathematics with a focus on the CS

perspective.
Introduction to Discrete Structures and Set
Theory P1
Discrete SET THEORY
- Constituting a separate entity and consisting of - Set theory was developed by mathematicians to
distinct or unconnected elements. be able to talk or discuss about collections of
objects.
Examples of Discrete Data:
- It has turned out to be an invaluable tool for
 Number of boys in the class defining some of the most complicated
 Number of candies in a packet mathematical structures.
 Number of suitcases lost by an airline
SET
Continuous
- A set is a collection of objects.
- Something that is going on or extending without
interruption or break; Examples of a set:
- Unbroken and connected
 A deck of cards
Examples of Continuous Data:  All students enrolled in IT1103
 The collection of all even integers
 Height of a person
 Time in a race - The objects belonging to the set are called the
 Distance traveled by a car elements of the set.
Examples of elements:

 The two of diamonds is an element of the


set consisting of a deck of cards
 One particular student is an element of the
set of all students enrolled in IT1103
 The number 8 is an element of the set of
even integers
DISCRETE STRUCTURES VS DISCRETE
MATHEMATICS - Capital letters such as S are used to denote
sets.
Discrete Structures
- Lower case letters such as s are used to denote
- These are structures that are used in describing the elements.
discrete mathematics.
Example:
- These structures are composed of a set of
discrete elements on which certain operations  S = {s1,s2,s3,s4}
are defined.
Discrete Mathematics
Definition 1
- A branch of mathematics dealing with objects
that can assume only distinct, separated - Given a set A, if u is an element of A, we
values. write
- It is the study of mathematical structures that  u ∈ A.
are fundamentally discrete rather than - If the element u is not in the set A, we write
continuous.  u ∉ A.
- It makes use of discrete structures. Common Universal Sets
IMPORTANT NOTES  R = real numbers
- In reality, discrete mathematics is a math that  Real numbers are simply the
deals with discrete values. Discrete structures combination of rational and irrational
are somewhat like constructs for discrete numbers, in the number system.
mathematics. The two, however, as a course
name, describe the same thing.  N = natural numbers = {1, 2, 3, . . . }, the
- The terms are used so interchangeably and are counting numbers
so vague that the people asking for this likely
don't realize what they are asking. There are no  Q = rational numbers
resources that give a clear cut answer, but  Z = all integers = {. . , -3, -2, -1, 0, 1, 2, 3, 4,
probably what one wants to do is teach discrete . .}
 Z+ = the set of positive integers Example:

 2Z = the set of even integers 1. Given:

Category Definition Example A set A contains the odd counting numbers


Natural Contain all counting All numbers such as between 2 and 12.
Numbers numbers which start 1, 2, 3, 4,5,6,…..…  Asked:
from 1.
N = {1,2,3,4,……} Describe the set of odd counting numbers between
2 and 12 using the 3 methods. Use the lowercase
Whole Collection of zero and All numbers letter x to denote the property variable in the set-
Numbers natural number. including 0 such as builder notation.
W = {0,1,2,3,…..} 0, 1, 2, 3,
4,5,6,…..… Answers:
Integers The collective result of Includes: -infinity (- Word description
whole numbers and ∞),……..-4, -3, -2, -
negative of all natural 1, 0, 1, 2, 3, 4, • the set of odd counting numbers between 2
numbers. ……+infinity (+∞) and 12
Rational Numbers that can be Examples of rational Roster Method
Numbers written in the form of numbers are ½, 5/4
p/q, where q≠0. and 12/6 etc.
• A={3,5,7,9,11}
Set Builder
Irrational All the numbers which Irrational numbers
Numbers are not rational and are non-terminating • {x ∈ N│x is odd, and 2 < x < 12}
cannot be written in and non-repeating
the form of p/q. in nature like √2

2. Given:
Practice: Define Sets using Element Notation
X = {2,4,6,8,10}
Example:
 Asked:
 The element 18 is an integer, thus, we can
write: Describe the given set using set-builder notation.
Use the lowercase letter n to denote the property
18 ∈ Z variable.
Write the definition of some of the following Answer
elements of some universal sets:
X = {n ∈ Z | n is even, and 2 ≤ n ≤ 10 or X = {n
a) The number 6 is an even integer. ∈ 2Z | 2 ≤ n ≤ 10}

b) The number 5 is an odd integer. Important Notes: Describing Sets
 - Use curly braces to designate sets
Methods of Defining or Describing Sets - Use commas to separate set elements
- The variable in the set–builder notation doesn’t
Word description have to be x
- Use ellipses (. . . ) to indicate a continuation of
- Describing a set by using words in a sentence
a pattern established before the ellipses, i.e. {1,
Roster method (listing method) 2, 3, 4, . . . , 100}
- The symbol | is read as “such that”
- Describing a set by listing the elements - An element or member of a set is an object
Set-builder notation method that belongs to the set.
- The symbol ∈ means “is an element of” .
- Describing a set by defining its property - The symbol ∉ means “is not an element of” .
Notation: - Generally, capital letters are used to represent
sets and lowercase letters are used for other
 A = { x | x  S, P(x) } or objects, i.e. S = {2, 3, 5, 7}
 A = { x  S | P(x) } - Thus, a ∈ S means a is an element of S
 Is 2 ∈ {0, 2, 4, 6}?
(A is the set of all elements x of S, such that x
 Is 2 ∈ {1, 3, 5, 7, 9}?
satisfies the property P)
Set Cardinality
- The cardinality of a set is the number of Singleton Set
distinct elements in the set.
- A set with only one element.
- The cardinality of a set A is denoted by n(A)
or |A|. Example:
Example:  H={4}
1. Given: n(H) = |H| = 1

Consider the following sets:


Finite Set
A = {2, 4, 6, 8, 10}
- It is a set with limited elements.
E = {x | x is odd and x < 14}
Example:
P = {red, blue, yellow}
 Given:
 Asked:
Set F is the set of counting numbers less than 6.
Find the cardinality of the given sets.
 Asked:
Answer:
a) Describe set F using the roster method.
n(A) = | A | = 5
b) Find the cardinality of set F.
n(E) = | E | = 7
a)F={1,2,3,4,5}
n(P) = | P | = 3 b) n(F) = | F | = 5
Important Notes
- Sets do not care about the order or how many Infinite Set
times an object is included.
- It is a set with unlimited elements.
- Thus, {1, 2, 3, 4}, {2, 3, 1, 4}, and {1, 2, 2, 3, 3,
3, 4, 4} all describe the same set. Example:

 Given:

Types of Sets Set N is the set of counting numbers.

 Empty Set  Asked:


 Singleton Set a) Describe set N using the roster method.
 Finite Set
 Infinite Set b) Find the cardinality of set N.
 Equal Sets Answers:
 Equivalent Sets
 Universal Set (a) N = {1,2,3,4, …}
 Subset (b) n(N) = | N | = Infinite = ∞
 Proper Subset
 Superset
 Proper Superset Equal Sets
 Power Set
- Two sets are equal if they have exactly the
Empty Set same elements, denoted A = B.
- The empty set is the set with no elements, and - If A and B are not equal, we write A ≠ B.
is denoted by the symbol Ø , or by { }. Example:
- It is also called as the null set.
- The empty set is a subset of every set.  Given:
Set E is the set of letters in the word “earth”. Set H
 Notation: is the set of letters in the word “heart”.
E={} E=Ø
 Asked:
 Cardinality: a) Describe the two sets E and H using the
n(E) = | E | = 0 roster method.
b) Determine if they are equal sets.
Answers:  Asked:
a) E = {e,a,r,t,h} Determine the set that is a subset of the other set.
H = {h,e,a,r,t} Answer:
b) E = H A⊆B
Example:
Equivalent Sets  Given:
- Sets that have different elements but have the Let A = {7,8,10}
same number of elements.
 Asked:
Example:
a) List all the subsets of A.
 Given:
b) Find the total number of all the possible
Set F is the set of counting numbers less than 6. subsets of the given set.
Set H is the set of letters in the word “heart”.
Note:
 Asked:
If a set has n elements, the total number of all its
a) Describe the two sets F and H using the possible subsets is 2n .
roster method.
a)
b) Find the cardinality of the two sets then 1.
{7,8,10 }
determine if they are equivalent sets. 2. {7}
3. {8}
Answers:
4. {10}
a) F = {1,2,3,4,5} ; H = {h,e,a,r,t} 5. (7,8}
b) = 5; |H| = 5 ; Therefore, F ≈ H. 6. {7,10}
7. {8,10}
8. {}
Universal Set (b) |A| = 3 = n so 23 = 8 possible subsets
- It is the set containing all elements and of
which, all other sets are subsets.
Proper Subset
- It is represented by capital letter U.
- Set A is a proper subset of Set B if there is at
 Consider Sample 1: least one element in B that is not contained in
U = {a,e,i,o,u} A.
- It is denoted by A ⊂ B.
A = {a,e,i} and B = {i,o,u}
Example:
Thus, A and B are proper subsets of U.
 Given:
 Consider Sample 2:
A = {h,a,b,i,t}
Set U is the set of counting numbers.
B = {a,b,i,t}
A = {1,3,5,7} ; B = {2,4,6}; C = {1,2,3,4,5,6,7,8,9,10}
C = {b,i,t}
Thus, A, B and C are proper subsets of U.
D = {i,t}

 Asked:
Subset
Find the proper subsets.
- Set A is a subset of Set B if and only if every
element in A is also an element in B. Answers:
- It is denoted by A ⊆ B. B⊂A
Example: C⊂A
 Given: D⊂A
A = {1,2,3}
B = {0,1,2,3,4,5,6}
Example: Set S = {s,i,r}

 Given:  Asked:
Let A = {s,i,r} a) Determine P(S).

 Asked: b) Find the number of elements (cardinality)


that the power set of S have.
a) List all the proper subsets of A.
Answers:
b) Find the total number of all the possible proper
subsets of the given set. a) P(S) = {{s,i,r},{s,i},{s,r}, {i,r}, {s}, {i}, {r}, { }}

Note: b) |S| = 3 = n so n(P(S)) = |P(S)| = (2 to the n)


= (2 to the 3) = 8 elements
- If a set has n elements, the total number of all
its possible proper subsets is 2n – 1.

- A set itself is not a proper subset. Disjoint Sets

Answers: - These are two or more sets which have no


elements in common.
a) - These are also called as Non-Overlapping
1. {s,i} Sets.
2. {s,r} - The intersection of these sets is empty.
3. {i,r} Example:
4. {s}
5. {i} A = {a,b,c}
6. {r}
B = {d,e,f}
7. {}
Therefore, the sets A and B are disjoint sets (A ∩
b) |A| = 3= n so [(2 to the n) - 1)] = [(2 to the 3) –
B = ∅).
1)] = 7 proper subsets

Pairwise Disjoint Sets


Superset
- A collection of sets is pairwise disjoint or
- A set containing all of the elements of another
mutually disjoint, if any two sets in the
set.
collection are disjoint.
- Set A is a superset of Set B if every element in
B is also in A. Examples:
- It is denoted by A ⊇ B.
- This is just a reverse of Subset. a) S = { {a}, {b,d}, {e,f,g} }

Sample: b) S = { {b,c}, {c,d} }

A = {9,14,28} ⊇ B = {9,14,28} Answer:


a) S is a pairwise disjoint set.
A⊃B. For example, if A is the set {♢,♡,♣,♠} and B
is the set {♢,♣,♠}, then A⊃B but B⊅A. b) S is not a pairwise disjoint set because c
element is common in the two sets.

Proper Superset
Standard Symbols (Denote Sets of Numbers)
- Set A is a proper superset of Set B if Set A is
a superset of Set B and A ≠ B.  N : The set of all natural numbers (i.e., all
- It is denoted by A ⊃ B. positive integers)
 Z : The set of all integers
Sample:
 Z+ : The set of all positive integers
A = {9,14,28} ⊃ B = {9,14}  Z* : The set of all nonzero integers
 E : The set of all even integers
 Q : The set of all rational numbers
Power Set  Q* : The set of all nonzero rational numbers
 Q+ : The set of all positive rational numbers
- The set of all the subsets of a set.
 R : The set of all real numbers
Example:  R* : The set of all nonzero real numbers
 R+ : The set of all positive real numbers
 Given:
 C : The set of all complex numbers
 C* : The set of all nonzero complex
numbers

Important Notes
- Any set is a subset of itself
- Any set is a subset of the universal set
- The empty set is a subset of every set including
itself
DISCRETE STRUCTURES 1  It is the set of elements common to both
sets.
Set Theory: Operations on Sets Venn diagram
 It is denoted by A  B.
Set Operations
 The intersection of A and B is:
Operation:
A  B = {x | x  A and x  B}
 It is a rule or procedure by which one or
more objects are used to obtain another  In other words, for an object to be in A  B,
object (usually a set or number). it must be a member of both A and B.
Operation on Set: Example:
 It is where two sets are combined to  Given the sets:
produce a third set.
A = {2,3,4,5}
 It is the finding of intersections, unions,
differences and complements of sets. B = {4,5,6,7,8}
C = {3,6,7,8,9}

Set Union  Asked:

 The union of two sets A and B is the set of Find each of the following sets:
all elements of A together with all elements
a) A  B
of B.
b) B  C
 It is the set of elements belonging to either
of the sets. Answers:
 It is denoted by A  B. a) A = {2,3,4,5}
b) B = {4,5,6,7,8}
The union of A and B is: c) C = {3,6,7,8,9}
 A  B = {x | x  A or x  B} (a) A  B = {4,5}
 In other words, for an object to be in A  B,
it must be a member of either A or B. (b) B  C = {6,7,8}

Example:

 Given the sets: Complement of a Set

A = {1,2,3,4}  It is the set of all elements in the given


universal set such as U that are not
B = {1,2,3,4,5,6,7,8} contained in a given set such as A.
C = {1,3,6,9}
 It is denoted by A’ .
 Asked:
 The complement of A is:
Find each of the following sets:
A’ = {x | x  U and x  A}
a) A  B
Example:
b) B  C
 Given the sets:
Answers:
U = {1,2,3,4,5,6,7,8,9,10}
 A = {1,2,3,4} A = {1,2,3,4}
 B = {1,2,3,4,5,6,7,8}
 C = {1,3,6,9} B = {3,6,7,8,9}

a) A  B = {1,2,3,4,5,6,7,8} = B  Asked:

b) B  C = {1,2,3,4,5,6,7,8,9} Find each of the following sets:


a) A’

Set Intersection b) B’

 The intersection of two sets A and B is the Answers:


set of elements which are common to A and a) A’ = {5,6,7,8, 9.10}
B.
b) B’= {1,2,4,5,10} Example:

 Given the sets:


Set Difference A = {1,2,3,4,5,6,7,8}
 It is the set of elements belonging to one set B = {1,3,5,6,7,8,9}
and not to the other set.
 Asked:
 For the two sets A and B, the difference
between the two sets is the set of all Find the symmetric difference of the two given sets
elements in A that are not in B. using the listing/roster method.
 It is denoted by A – B.
Answers: A – B = {2, 4}, B – A = {9} and
The difference of sets A and B is:
A △ B = {2, 4, 9}
A – B = {x | x  A and x  B}
Example:
Venn Diagram
 Given the sets:
 It is an illustration of the relationships
A = {a,b,c,d} and B = {b,d,e} between and among sets or groups of
objects that share something in common.
G = {t,a,n} and H = {n,a,t}
 It is a diagram that uses the circles to
 Asked:
represent sets in which the relations
Find each of the following sets: between the circles are represented by the
arrangements of the circles.
a) A – B
 It can be used to represent sets and their
b) B – A relationships to each other.
c) G – H
 It is also called primary diagram, set
Answers: diagram or logic diagram.

A = {a,b,c,d} and B = {b,d,e}  This type of diagram is used in scientific and


engineering presentations, in theoretical
G = {t,a,n} and H = {n,a,t} mathematics, in computer applications, and
a) A – B = {a,c} in statistics.

b) B – A = {e}  It was introduced in 1880 by John Venn.

c) G – H = {} John Venn

 (4 August 1834 – 4 April 1923) was an


English mathematician, logician and
Symmetric Set Difference philosopher noted for introducing the
 It is the set of all those elements that belong Venn diagram.
either to A or to B but not to both.  Venn diagram is used in the fields of set
 It is the set of elements which are in either theory, probability, logic, statistics,
of the sets and not in their intersection. competition math, linguistics, and computer
 It is also known as the disjunctive union of science.
the sets.
 It is commonly denoted by:  In 1866, Venn published The Logic of
Chance, a ground-breaking book which
A ∆ B or A ⊖ B or A ⊕ B. espoused the frequency theory
of probability, offering that probability
The symmetric difference of two sets A and B
should be determined by how often
is:
something is forecast to occur as opposed
A △ B = (A – B) ∪ (B – A) = {x | x ∉ A ∩ B} to “educated” assumptions.

or  Venn then further developed George


Boole’s theories in the 1881 work Symbolic
A △ B = {x | [x ∈ A and x ∉ B] or [x ∈ B and x ∉ A]} Logic, where he highlighted what would
Important Notes: become known as Venn diagrams.

A △ ∅ = A (for all subset A)  Uses any simple closed figure (circle,


triangle, oval) to represent sets.
A △ A = ∅ (for all subset A)
 Uses a rectangle to represent a universal
set (denoted by the capital letter U).
Example:
Represent the following sets in a Venn diagram:

 A⊂U
 B⊂A

You might also like