Download CSC 125 - Discrete Math I, Spring 2017

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CSC 125 - Discrete Math I, Spring 2017
Sets
Sets
A set is well-defined, unordered collection of objects
The objects in a set are called the elements, or members, of
the set
A set is said to contain its elements
The notation a ∈ A denotes that a is an element of the set A
The notation a ∈
/ A denotes that a is not an element of the
set A
The Roster Method of Describing a Set
The syntax for the roster method is:
S = {a, b, c, d}
where the members of a set are delimited by curly braces and
separated by commas
The order does not matter:
S = {a, b, c, d} = {b, c, a, d}
Listing an element more than once does not change the set:
S = {a, b, c, d} = {a, b, a, b, c, d, c}
Ellipses (. . .) can be used when there is a clear pattern:
S = {a, b, c, . . . , z}
Set-Builder Notation
Set-Builder notation is a method of describing sets where the
properties that all members must meet are specified:
S = {x | x > 0 ∧ x < 100}
Reading set-builder notation:
such that
defined as
S
|{z}
name of set
z}|{
= {
x
|{z}
all elements
z}|{
|
P(x) }
| {z }
P(x) is true
Interval Notation
[a, b] = {x | a ≤ x ≤ b} (closed interval)
[a, b) = {x | a ≤ x < b}
(a, b] = {x | a < x ≤ b}
(a, b) = {x | a < x < b} (open interval)
Some Important Sets
N: the set of natural numbers
Z: the set of integers
Z+ : the set of positive integers
R: the set of real numbers
R+ : the set of positive real numbers
C: the set of complex numbers
Q: the set of rational numbers
The Universal Set and Empty Set
The universal set, U, is the set containing everything currently
under consideration
The empty set, denoted as ∅ or {}, is the set with no elements
Note: the empty set is different than the set containing the
empty set:
∅=
6 {∅}
Set Equality
Definition: Two sets are equal if and only if they have the
same elements
That is, the sets A and B are equal if and only if
∀x(x ∈ A ↔ x ∈ B)
Subsets
Definition: The set A is a subset of B if and only if every
element of A is also an element of B
The notation A ⊆ B is used to indicate that A is a subset of B
A ⊆ B holds if and only if ∀x(x ∈ A → x ∈ B)
Because a ∈ ∅ is always false, ∅ ⊆ S, for every set S
Because a ∈ S → a ∈ S, S ⊆ S, for every set S
Showing Things About Subsets
To show that A ⊆ B, show that if x ∈ A, then x ∈ B
To show that A 6⊆ B, find an element x ∈ A with x 6∈ B
Set Equality with Subset Notation
Recall A = B iff ∀x(x ∈ A ↔ x ∈ B)
Using logical equivalences, we have A = B iff
∀x[(x ∈ A → x ∈ B) ∧ (x ∈ B → x ∈ A)]
This is equivalent to:
A⊆B ∧B ⊆A
Proper Subsets
Definition: If A ⊆ B, but A 6= B, then we say A is a proper
subset of B, denoted by A ⊂ B
If A ⊂ B, then ∀x(x ∈ A → x ∈ B) ∧ ∃x(x ∈ B ∧ x 6∈ A) is
true
Set Cardinality
Definition: If there are exactly n distinct elements in the set
S where n is a nonnegative integer, we say that S is finite
otherwise S is infinite
Definition: The cardinality of a finite set A, denoted by |A|,
is the number of (distinct) elements in A
Power Sets
Definition: The set of all subsets of a set A, denoted P(A),
is called the power set of A
Example: If A = {a, b}, then
P(A) = {∅, {a}, {b}, {a, b}}
If a set has n elements, then the cardinality of the power set is
2n
Tuples
The ordered n-tuple, denoted as (a1 , a2 , . . . , an ) is an ordered
collection the has a1 as its first element, a2 as its second
element and so until an as its last element
Two n-tuples are equal if and only if their corresponding
elements are equal
2-tuples are called ordered pairs
The ordered pairs (a, b) and (c, d) are equal iff a = c and
b=d
Cartesian Product
Definition: The Cartesian Product of two sets A and B,
denoted by A × B is the set of ordered pairs (a, b) where
a ∈ A and b ∈ B
That is,
A × B = {(a, b) | a ∈ A ∧ b ∈ B}
Example:
A = {a, b}, B = {1, 2, 3}
A × B = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)}
Cartesian Product
Definition: The Cartesian products of the sets
A1 , A2 , . . . , An , denoted by A1 × A2 × . . . × An , is the set of
ordered n-tuples (a1 , a2 , . . . , an ) where ai ∈ Ai for i = 1, . . . n
A1 × A2 × . . . × An =
{(a1 , a2 , . . . , an ) | ai ∈ Ai for i = 1, 2, . . . , n}
Truth Sets of Quantifiers
Given a predicate P and a domain D, we define the truth set
of P to be the set of elements in D for which P(x) is true
The truth set is denoted by
{x ∈ D | P(x)}
Example: the truth set of P(x) where the domain is the
integers and P(x) is “|x| = 1” is the set {−1, 1}
Boolean Algebra
Propositional logic and set theory are both instances of
Boolean Algebra
The operators in set theory are analogous to the
corresponding operator in propositional logic
All sets are assumed to be subsets of the universal set U
Union
Definition: Let A and B be sets. The union of the sets A and
B, denoted by A ∪ B, is the set {x | x ∈ A ∨ x ∈ B}
Intersection
Definition: The union of sets A and B, denoted by A ∩ B, is
the set {x | x ∈ A ∧ x ∈ B}
Note: if the intersection is empty, then A and B are said to be
disjoint
Complement
Definition: If A is a set, then the complement of A (with
respect to U), denoted by A, is the set {x ∈ U | x ∈
6 A}
Difference
Definition: Let A and B be sets. The difference of A and B,
denoted by A − B, is the set {x | x ∈ A ∧ x 6∈ B} = A ∩ B
Cardinality of the Union Operator
Inclusion-Exclusion:
|A ∪ B| = |A| + |B| − |A ∩ B|
Symmetric Difference
Definition: The symmetric difference of A and B, denoted
A ⊕ B, is the set (A − B) ∪ (B − A)
Set Identities
Identity Laws:
Domination Laws:
Idempotent Laws:
Complementation Law:
Commutative Laws:
Associative Laws:
Distributive Laws:
De Morgan’s Laws:
Absorption Laws:
Complement Laws:
A ∪ ∅ = A, A ∩ U = A
A ∪ U = U, A ∩ ∅ = ∅
A ∪ A = A, A ∩ A = A
(A) = A
A ∪ B = B ∪ A, A ∩ B = B ∩ A
A ∪ (B ∪ C ) = (A ∪ B) ∪ C
A ∩ (B ∩ C ) = (A ∩ B) ∩ C
A ∩ (B ∪ C ) = (A ∩ B) ∪ (A ∩ C )
A ∪ (B ∩ C ) = (A ∪ B) ∩ (A ∪ C )
A ∪ B = A ∩ B, A ∩ B = A ∪ B
A ∪ (A ∩ B) = A, A ∩ (A ∪ B) = A
A ∪ A = U, A ∩ A∅
Proving Set Identities
Prove that each side of the identity is a subset of the other
Use set builder notation and propositional logic
Membership tables
Proof of Second De Morgan Law
Show that
1
A ∩ B ⊆ A ∪ B and
2
A∪B ⊆A∩B
Proof of Second De Morgan Law
First part: Show that A ∩ B ⊆ A ∪ B
x ∈A∩B
assumption
x 6∈ A ∩ B
def. of complement
¬((x ∈ A) ∧ (x ∈ B)) def. of intersection
¬(x ∈ A) ∨ ¬(x ∈ B) De Morgan’s Law in propositional logic
x 6∈ A ∨ x 6∈ B
def. of negation
def. of complement
x ∈A∨x ∈B
x ∈A∪B
def. of union
Proof of Second De Morgan Law
Second part: Show that
x ∈A∪B
(x ∈ A) ∨ (x ∈ B)
(x 6∈ A) ∨ (x 6∈ B)
¬(x ∈ A) ∨ ¬(x ∈ B)
¬((x ∈ A) ∧ (x ∈ B))
¬(x ∈ A ∩ B)
x ∈A∩B
A∪B ⊆A∩B
assumption
def. union
def. of complement
def. of negation
De Morgan’s Law in propositional logic
def. of intersection
def. of complement
Proof of Second De Morgan Law: Set-Builder Notation
A∩B
=
=
=
=
=
=
=
=
{x | x 6∈ A ∩ B}
{x | ¬(x ∈ (A ∩ B))}
{x | ¬(x ∈ A ∧ x ∈ B)}
{x | ¬(x ∈ A) ∨ ¬(x ∈ B)}
{x | x 6∈ A ∨ x 6∈ B}
{x | x ∈ A ∨ x ∈ B}
{x | x ∈ A ∪ B}
A∪B
def. of complement
def of 6∈
def. of intersection
De Morgan’s law
def. of 6∈
def. of complement
def. of union
meaning of notation
Membership Table Example
Show A ∪ (B ∩ C ) = (A ∪ B) ∩ (A ∪ C )
A
1
1
1
1
0
0
0
0
B
1
1
0
0
1
1
0
0
C
1
0
1
0
1
0
1
0
B ∩C
1
0
0
0
1
0
0
0
A ∪ (B ∩ C )
1
1
1
1
1
0
0
0
A∪B
1
1
1
1
1
1
0
0
A∪C
1
1
1
1
1
0
1
0
(A ∪ B) ∩ (A ∪ C )
1
1
1
1
1
0
0
0
Related documents