Docsity

Sets, Logic, Algorithms, Slides of Discrete Structures and Graph Theory

Partial preview of the text

Download Sets, Logic, Algorithms and more Slides Discrete Structures and Graph Theory in PDF only on Docsity!

Chapter 1:

Foundations: Sets, Logic, and Algorithms

Discrete Mathematics:

Theory and Applications (Revised Edition)

Learning Objectives

Learn about sets

Explore various operations on sets

Become familiar with Venn diagrams

Learn how to represent sets in computer

memory

Learn about statements (propositions)

Discrete Mathematics: Theory and Applications (Revised Edition)

Definition: Well-defined collection of distinct objects

Members or Elements: part of the collection

Extensional definition: Description of a set by listing

the elements, enclosed with braces

 Examples:

 Vowels = {a,e,i,o,u}

 Primary colors = {red, blue, yellow}

Membership examples

 “a belongs to the set of Vowels” is written as: a  Vowels

 “j does not belong to the set of Vowels: j  Vowels

Discrete Mathematics: Theory and Applications (Revised Edition)

Intensional definition

 A = { x | x  S, P(x) } or A = { x  S | P(x) }

 A is the set of all elements x of S, such that x

satisfies the property P

 Example:

 If X = {2,4,6,8,10}, then in set-builder notation, X can

be described as

X = {n  Z | n is even and 2  n  10}

Discrete Mathematics: Theory and Applications (Revised Edition)

Subsets

“X is a subset of Y” is written as X  Y

“X is not a subset of Y” is written as X Y

Example:

 X = {a,e,i,o,u}, Y = {a, i, u} and z = {b,c,d,f,g}

 Y  X, since every element of Y is an element of X

 Y Z, since a  Y, but a  Z

Discrete Mathematics: Theory and Applications (Revised Edition)

Superset

X and Y are sets. If X  Y, then “X is contained in

Y” or “Y contains X” or Y is a superset of X, written

Y  X

Proper Subset

X and Y are sets. X is a proper subset of Y if X 

Y and there exists at least one element in Y that is

not in X. This is written X  Y.

Example:

 X = {a,e,i,o,u}, Y = {a,e,i,o,u,y}

 X  Y , since y  Y, but y  X

Discrete Mathematics: Theory and Applications (Revised Edition)

Finite and Infinite Sets

X is a set. If there exists a nonnegative integer n

such that X has n elements, then X is called a

finite set with n elements.

If a set is not finite, then it is an infinite set.

Examples:

 Y = {1,2,3} is a finite set

 P = {red, blue, yellow} is a finite set

 E the set of all even integers, is an infinite set

  , the Empty Set, is a finite set with 0 elements

Discrete Mathematics: Theory and Applications (Revised Edition)

Cardinality of Sets

Let S be a finite set with n distinct elements,

where n ≥ 0. Then |S| = n , where the cardinality

(number of elements) of S is n

Example:

 If P = {red, blue, yellow}, then |P| = 3

Singleton

 A set with only one element is a singleton

 Example:

 H = { 4 }, |H| = 1, H is a singleton

Discrete Mathematics: Theory and Applications (Revised Edition)

Venn Diagrams

 Abstract visualization

of a Universal set, U as

a rectangle, with all

subsets of U shown as

circles.

 Shaded portion

represents the

corresponding set

 Example:

 In Figure 1.1, Set X,

shaded, is a subset of

the Universal set, U

Discrete Mathematics: Theory and Applications (Revised Edition)

Union of Sets

Example:

If X = {1,2,3,4,5} and Y = {5,6,7,8,9}, then

X ∪Y = {1,2,3,4,5,6,7,8,9}

Discrete Mathematics: Theory and Applications (Revised Edition)

Disjoint Sets

Example:

If X = {1,2,3,4,} and Y = {6,7,8,9}, then X ∩ Y = 

Discrete Mathematics: Theory and Applications (Revised Edition)

The union and intersection of three, four, or even

infinitely many sets can be considered

 (^) For a finite collection of n sets, X

1

, X

2

, … X

n

where n

Discrete Mathematics: Theory and Applications (Revised Edition)

Example:

If U = {a,b,c,d,e,f} and X = {c,d,e,f}, then X’ = {a,b}

Discrete Mathematics: Theory and Applications (Revised Edition)

Discrete Mathematics: Theory and Applications (Revised Edition)