Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Sets
Sets are fundamental building blocks in discrete mathematics, crucial for counting and implemented in programming languages through set operations.
Set theory is a significant branch of mathematics with various axiomatic systems, employing a naïve approach in this context.
Definition
A set is an unordered collection of objects, referred to as elements or members.
Notation:
denotes that is an element of set .
indicates is not a member of .
Describing Sets
Roster Method
Listing elements within braces: e.g., .
Order is not important: .
Duplicate elements do not change the set: .
Ellipses can represent clear patterns: .
Examples
Vowels: .
Odd positive integers less than 10: .
Positive integers less than 100: .
Integers less than 0: .
Important Sets
= Natural numbers =
= Integers =
= Positive integers =
= Real numbers
= Positive real numbers
= Complex numbers
= Rational numbers
Set-Builder Notation
Specifies properties members must satisfy:
O = {x ∈ \mathbb{Z^+} | x \text{ is odd and } x < 10}
Using a predicate: (e.g., ).
Positive rational numbers:
Interval Notation
Closed interval:
Half-open interval: [a, b) = {x | a ≤ x < b}
Half-open interval: (a, b] = {x | a < x ≤ b}
Open interval: (a, b) = {x | a < x < b}
Universal and Empty Sets
Universal set contains everything under consideration, either implicit or explicitly stated, depending on context.
Empty set contains no elements, also represented as .
Russell’s Paradox
If is the set of all sets not members of themselves, the question "Is a member of itself?" leads to a paradox.
Related to the barber paradox: Henry shaves all who don't shave themselves. Does Henry shave himself?
Key Reminders
Sets can contain sets: , .
Empty set vs. set containing the empty set: .
Set Equality
Two sets are equal if they contain the same elements: .
Examples: , .
Subsets
Set is a subset of if every element of is also in : .
for every set .
for every set .
Showing Subsets
To prove , show if , then .
To prove , find an such that .
Equality of Sets Revisited
if and only if .
Equivalently, if and only if and .
Proper Subsets
If but , then is a proper subset of , denoted by .
if and only if .
Set Cardinality
If has exactly distinct elements, it is finite. Otherwise, it is infinite.
Cardinality of a finite set , denoted by , is the number of distinct elements in .
Examples: , alphabet , , .
Power Sets
Power set is the set of all subsets of .
Example: If , then .
If , then .
Tuples
Ordered -tuple is an ordered collection.
Two -tuples are equal if corresponding elements are equal.
2-tuples are ordered pairs: if and only if and .
Cartesian Product
Cartesian product of and is .
Example: If and , then .
A relation from to is a subset of .
Cartesian Product of Multiple Sets
.
Example: If , , , then .
Truth Sets of Quantifiers
Truth set of predicate over domain is the set of elements in for which is true.
Example: If is and the domain is integers, the truth set is .
Set Operations
Set operations include union, intersection, complementation, and difference.
Boolean Algebra
Both propositional calculus and set theory are instances of Boolean Algebra.
Set theory operators are analogous to propositional calculus operators within a universal set .
Union
The union of sets and , denoted by , is .
Example: .
Intersection
The intersection of sets and , denoted by , is .
If the intersection is empty, and are disjoint.
Example: , .
Complement
The complement of set , denoted by , is .
Example: If is positive integers less than 100, then the complement of {x | x > 70} is .
Difference
The difference of and , denoted by , is .
Cardinality of Union
Inclusion-Exclusion Principle: .
To count students in math or CS, add math majors and CS majors, then subtract joint majors.
Review Questions
Given , , :
Symmetric Difference (Optional)
The symmetric difference of and , denoted by , is .
Example: With the same and as above, .
Set Identities
Identity laws, domination laws, idempotent laws, complementation law, commutative laws, associative laws, distributive laws, De Morgan's laws, absorption laws, complement laws.
Examples:
(Identity Law)
(Identity Law)
(Domination Law)
(Domination Law)
(Idempotent Law)
(Idempotent Law)
(Complementation Law)
(Commutative Law)
(Commutative Law)
(Associative Law)
(Associative Law)
(Distributive Law)
(Distributive Law)
(De Morgan's Law)
(De Morgan's Law)
(Absorption Law)
(Absorption Law)
(Complement Law)
(Complement Law)
Proving Set Identities
Methods: Prove each side is a subset of the other, use set-builder notation and propositional logic, or use membership tables.
Proof of De Morgan's Law
To prove , show that and .
Set-Builder Notation Example: Second De Morgan Law
.
Membership Tables
Use 1 to indicate membership, 0 to indicate non-membership. Useful to verify identities.
Generalized Unions and Intersections
For indexed collection of sets :
For , and .
Functions
A function assigns each element of to exactly one element of . If , is the image of and is the preimage of .
Terminology
maps to .
is the domain, is the codomain.
The range of is the set of all images of points in , denoted by .
Two functions are equal if they have the same domain, codomain, and mapping.
Representing Functions
Explicit statement, formula, computer program.
Examples: , a program to generate Fibonacci numbers.
Questions on Functions
Given where and with assignments.
Functions and Sets
If and , then .
Injections (One-to-One)
A function is injective if implies for all in the domain of .
Surjections (Onto)
A function is surjective if for every element in , there is an element in with .
Bijections
A function is a bijection if it is both injective (one-to-one) and surjective (onto).
Showing Injective and Surjective Properties
To show is injective, prove if then .
To show is not injective, find such that .
To show is surjective, find an in for arbitrary in such that .
To show is not surjective, find a in such that for all in .
Inverse Functions
If is a bijection from to , the inverse of , denoted , is the function from to such that when .
Inverses only exist for bijections.
Composition
Let and .
The composition of with , denoted , is the function from to defined by .
Graphs of Functions
The graph of is the set of ordered pairs .
Important Functions
Floor function: is the largest integer less than or equal to .
Ceiling function: is the smallest integer greater than or equal to .
Properties of Floor and Ceiling Functions
(1a) if and only if n ≤ x < n + 1
Factorial Function
, , .
Partial Functions (Optional)
A partial function from to assigns each element in a subset of to a unique element in .
The subset of is the domain of definition.
If the domain of definition is , is a total function.
Sequences and Summations
Sequences are ordered lists of elements that appear throughout mathematics and computer science.
Sequences Definition
A sequence is a function from a subset of integers to a set .
The notation denotes the image of the integer .
Geometric Progression
A sequence of the form , where is the initial term and is the common ratio.
Arithmetic Progression
A sequence of the form , where is the initial term and is the common difference.
Strings
A finite sequence of characters from a finite set (alphabet).
The empty string is represented by .
Recurrence Relations
An equation that expresses in terms of previous terms for .
Initial conditions specify terms preceding the first term.
Fibonacci Sequence
Initial Conditions: , . Recurrence Relation: .
Solving Recurrence Relations
Finding a formula for the th term is called solving the recurrence relation; such a formula is called a closed formula.
Useful Sequences
Examples:
Summations
The sum of terms from a sequence is represented using summation notation.
Product Notation (Optional)
Useful Summation Formulas
Geometric Series, etc.
Matrices
Matrices are rectangular arrays of numbers used in linear transformations, graph representations, and models of various systems.
Definition
An matrix has rows and columns.
A square matrix has the same number of rows and columns.
Two matrices are equal if they have the same dimensions and corresponding entries are equal.
Notation
, where is the element in the th row and th column.
Matrix Arithmetic: Addition
for matrices and . Matrices must have the same dimensions to be added.
Matrix Multiplication
If is an matrix and is a matrix, then is an matrix with .
The product is undefined if the number of columns in the first matrix doesn't match the number of rows in the second matrix.
Identity Matrix and Powers of Matrices
The identity matrix of order is , where if and if .
when is an matrix.
, ( times) for a square matrix .
Transposes of Matrices
The transpose of is where .
Symmetric Matrices
A square matrix is symmetric if , i.e., .
Zero-One Matrices
Matrices with entries either 0 or 1, used in Boolean arithmetic.
Joins and Meets
The join of and is
The meet of and is .
Boolean Product
For matrix and matrix , the Boolean product has .
Boolean Powers
is the Boolean product of factors of ; .