Docsity

Sets and Functions, Exercises of Pre-Calculus

Partial preview of the text

Download Sets and Functions and more Exercises Pre-Calculus in PDF only on Docsity!

CSCE 222

Discrete Structures for Computing

Sets and Functions

Dr. Hyunyoung Lee Based on slides by Andreas Klappenecker

Sets

Sets are the most fundamental discrete structure on

which all other discrete structures are built.

We use naive set theory, rather than axiomatic set theory, since this approach is more intuitive. The drawback is that one can construct paradoxes using the naive set theory approach unless one is careful. The set theoretic complications have little bearing on the subsequent material, though, since we are mostly concerned with finite and countable sets.

Much Ado about Nothing

We denote the empty set {} by ∅. A set can be an element of another set. {∅} is the set containing one element, namely ∅. Note that ∅ and {∅} are different sets, since they contain different elements (the first one none, and the second one contains the element ∅). The set {∅,{∅}} contains two elements.

Common Sets

N = {0,1,2,3,4,...} natural numbers (according to our book) [Note that in 50% of the literature N contains 0 and in the other 50% it does not. This will not change, since each view has its merits.] Z = {..., -2,-1,0,1,2,...} set of integers R , set of real numbers C , set of complex numbers

Equality of Sets

Two sets A and B are called equal if and only if they have the same elements. A = B if and only if ∀ x ( x ∈ A ↔ x ∈ B ) [To prove A=B, it is sufficient to show that both ∀ x ( x ∈ A → x ∈ B ) and ∀ x ( x ∈ B → x ∈ A ) hold. Why? ]

Subset

A set A is a subset of B, written A ⊆ B, if and only if every element of A is an element of B. Thus, A ⊆ B if and only if ∀ x ( x ∈ A → x ∈ B )

Cardinality of a Set

Let S be a set with a finite number of elements. We say that the set has cardinality n if and only if S contains n elements. We write |S| to denote the cardinality of the set. For example, | ∅ | = 0_._

Power Sets

Given a set S, the power set P ( S ) of S is the set of all subsets of S. Example: P ( {1} ) = { ∅ , {1} } P ( {1,2} ) = { ∅ , {1}, {2}, {1,2} } P (∅) = { ∅ } since every set contains the empty set as a subset, even the empty set. P ({∅}) = {∅, {∅}}.

Cartesian Products

Let A and B be sets. The Cartesian product of A and B, denote A x B, is the set of all pairs ( a,b ) with a ∈ A and b ∈ B. A x B = { ( a,b ) | a ∈ A ⋀ b ∈ B }

Quiz

Let A= {1,2,3}. What elements does the set A x ∅ contain?

Answer: None

Union and Intersection

Let A and B be sets. The union of A and B, denoted A ∪ B, is the set that contains those elements that are in A or in B, or in both_._ The intersection of A and B, denoted A ∩ B, is the set that contains those elements that are in both A and B.

Set Difference Let A and B be sets_._ The difference between A and B, denoted A-B or A\B, is the set A-B = { x ∈ A | x ∉ B }.

Set Identities

Let U be the universal set. Identity laws: A ∩ U = A A ∪ ∅ = A Domination laws: A ∪ U = U A ∩ ∅ = ∅ Idempotent laws: A ∪ A = A A ∩ A = A Also: Commutative Laws Associative Laws Distributive Laws

De Morgan Laws

A \ B = A [ B P roof : A \ B = {x | x 62 A \ B} by definition of complement = {x | ¬(x 2 A \ B)} = {x | ¬(x 2 A ^ x 2 B)} by definition of intersection = {x | ¬(x 2 A) _ ¬(x 2 B)} de Morgan’s law from logic = {x | (x 62 A) _ (x 62 B)} by definition of 62 = {x | x 2 A _ x 2 B} by definition of complement = {x | x 2 A [ B} by definition of union = A [ B