Basic Structures: Sets, Functions, Sequences, and Sums - PowerPoint PPT Presentation

1 / 94
About This Presentation
Title:

Basic Structures: Sets, Functions, Sequences, and Sums

Description:

Basic Structures: Sets, Functions, Sequences, and Sums ... Bitwise OR. Bitwise AND. Konstantin Busch - LSU. 32. Powerset of. Functions. Konstantin Busch - LSU ... – PowerPoint PPT presentation

Number of Views:109
Avg rating:3.0/5.0
Slides: 95
Provided by: Costas5
Category:

less

Transcript and Presenter's Notes

Title: Basic Structures: Sets, Functions, Sequences, and Sums


1
Basic Structures Sets, Functions, Sequences, and
Sums
  • CSC-2259 Discrete Structures

2
Sets
A set is an unordered collection of objects
English alphabet vowels
Odd positive integers less than 10
elements of set members of set
3
Other set representations
Set of positive integers less than 100
Odd positive integers less than 10
4
Venn Diagram
Universe
4
6
3
1
7
9
5
2
8
5
Useful sets
Natural numbers
Integers
Positive integers
Rational numbers
Real numbers
6
Empty set
7
Cardinality (size) of set
Number of elements
Finite sets
infinite size
Infinite set
8
Equal sets
Examples
9
Subset
Examples
For any set
10
Proper Subset
Examples
11
is equivalent to
12
Power set
The power set of contains all possible
subsets of (and the empty set)
Power set
Special cases
Size of power set
13
Ordered tuples (relations)
Ordered n-tuple
ordered list of elements
iff
Example
14
Cartesian product
Cartesian product of two sets
Example
For this case
Size
15
Cartesian product of sets
Example
Size
16
Sets and propositions
shorthand for
shorthand for
Truth set of proposition
all elements of the domain which satisfy
17
Set operations
Union
18
Intersection
19
Disjoint sets
20
Set difference
21
Complement
22
Size of union
23
De Morgans laws
24
Theorem
Show that and
Proof
Part 1
De Morgans law from logic
25
Part 2
De Morgans law from logic
End of Proof
26
Set identities
Idempotent laws
Identity laws
Domination laws
Complementation law
Complement laws
De Morgans laws
27
Commutative laws
Associative laws
Distributive laws
Absorption laws
28
Generalized unions and intersections
29
Example
30
Computer representation of sets
Represent sets as binary strings
31
Set operations become binary string operations
Bitwise OR
Bitwise AND
32
Powerset of
33
Functions
Names
Grades
Adams
A
Chou
B
Goodfriend
C
Rodriguez
D
Stevens
F
34
Domain
Codomain
Image of
maps to
Every element of domain has exactly one image
35
Domain
Codomain
Adams
A
Chou
B
Goodfriend
C
Rodriguez
D
Stevens
F
set of all images
36
(No Transcript)
37
Equal functions
same domain
same codomain
same mapping
38
In some programming languages, domain and
codomain are explicitly defined
int f(int a) return aa
39
Add and multiply functions
Real numbers
Example
40
Image of set
Set
Example
41
One-to-one (injection) function
For every in domain
implies
a
1
2
b
c
3
d
4
5
Examples
is one-to-one
is not one-to-one
42
Increasing function
Strictly increasing
Strictly increasing functions are one-to-one
43
Onto (surjection) function
For every there is such that
a
1
2
b
c
3
d
Range Codomain
Examples
is onto
is not onto
44
One-to-one correspondence (bijection) function
a function which is one-to-one and onto
a
1
2
b
c
3
d
4
Examples
is bijection
is not bijection
is bijection
Identity function
45
one-to-one not onto
not one-to-one onto
one-to-one onto
a
a
a
1
1
1
2
b
2
b
2
b
c
3
c
3
c
3
d
d
4
4
not one-to-one not onto
not a function
a
1
a
1
2
b
2
b
c
3
c
3
d
4
4
46
Inverse of a bijection function
when
domain
codomain
codomain
domain
a
1
a
1
2
b
2
b
c
3
c
3
d
d
4
4
is invertible function
Example
47
(No Transcript)
48
Composition of functions
Example
49
identity function
Suppose
50
Floor and Ceiling
Let be real
largest integer less or equal to
Floor function
smallest integer greater or equal to
Ceiling function
Examples
51
Factorial function
Stirlings formula
52
Sequences
function from a subset of integers to a set
Sequence
Finite sequence
Infinite sequence
2, 4, 6, 8, 10
1,3,9,27,81,
Alternate representation
53
finite sequence
String
Length of string
Empty string (null)
54
Arithmetic progression
Initial term
Common difference
Example
start with
55
Geometric progression
Initial term
Common ratio
Example
start with
56
Summations
Sequence
Sum
Example
57
Theorem
Proof
End of Proof
58
Theorem
If are real numbers and ,
then
Proof
Let
59
End of Proof
60
Useful Summation Formulas
61
Countable Sets
Countable finite set
Any finite set is countable by default
Countable infinite set
An infinite set is countable if there is a
one-to-one correspondence from to
Positive integers
62
Theorem
Even positive integers are countable
Proof
Even positive integers
One-to-one Correspondence
Positive integers
corresponds to
End of Proof
63
Theorem
The set of rational numbers is countable
Proof
We need to find a method to list
all rational numbers
64
Naïve Approach
Start with nominator1
Rational numbers
One-to-one correspondence
Positive integers
Doesnt work
we will never list numbers with nominator 2
65
Better Approach
Nomin.1
Nomin.2
Nomin.3
Nomin.4
66
First diagonal
67
second diagonal
68
third diagonal
69
fourth diagonal
Every element will be eventually scanned
70
Diagonal listing
Rational Numbers
One-to-one correspondence
Positive Integers
End of Proof
71
Theorem
Set is uncountable
Proof
Assume that is countable,
then we can list its elements
Elements of
72
List the elements of
73
Create new element based on diagonal
74
If diagonal element is 0 then set digit to 1
75
If diagonal element is not 0 then set digit to 0
76
If diagonal element is 0 then set digit to 1
77
If diagonal element is 0 then set digit to 1
78
If diagonal element is not 0 then set digit to 0
79
By repeating process we obtain new number
80
(differ on first digit)
Observation
81
(differ on second digit)
Observation
82
(differ on third digit)
Observation
83
(differ on digit)
Observation
for every
Contradiction!
End of Proof
84
is unctoubtable
We have proven
It can be proven
Every subset of a countable set is countable
It follows that the set of real numbers is
uncountable
85
The previous proof technique is known as
Cantor diagonalization argument
The same technique can be used in other proofs
86
Theorem
If is an infinite countable set, then the
power set is uncountable
Proof
Since is countable, we can list its
elements
Elements of
87
Elements of the power set have the form
88
We encode each element of the powerset with a
binary string of 0s and 1s
Powerset elements
Binary encoding
(in arbitrary order)
89
Observation Every infinite binary string
corresponds to an element of the power set
Example
Corresponds to
90
Lets assume (for contradiction) that the power
set is countable
Then we can enumerate the
elements of the powerset
91
suppose that this is the respective
Power set element
Binary encoding
92
Take the binary string whose bits are the
complement of the diagonal
Complement of diagonal
0
0
1
1
Binary string
93
The binary string
corresponds to an element of the power set

94
Thus, must be equal to some
However,
the i-th bit in the binary string of is
different than the bit of , thus
i-th
Contradiction!!!
End of Proof
Write a Comment
User Comments (0)
About PowerShow.com