Unit 3 - Notes
MTH401
Unit 3: Counting Principles and Relations
1. Counting Principles
1.1 The Principle of Inclusion-Exclusion (PIE)
The Principle of Inclusion-Exclusion provides a method for determining the cardinality (size) of the union of finite sets. It accounts for over-counting when sets overlap.
For Two Sets:
If and are finite sets, the number of elements in their union is:
For Three Sets:
General Formula (for sets):
To find the cardinality of the union of sets :
- Sum the cardinalities of the individual sets.
- Subtract the cardinalities of the intersections of every pair of sets.
- Add the cardinalities of the intersections of every triple of sets.
- Subtract the intersections of every quadruple, and so on, alternating signs.
1.2 The Pigeonhole Principle
Basic Principle:
If or more objects (pigeons) are placed into boxes (pigeonholes), then there is at least one box containing two or more objects.
- Formal Statement: If a function is defined where , then is not injective (one-to-one).
- Example: In a group of 13 people, at least two must have been born in the same month.
The Generalized Pigeonhole Principle:
If objects are placed into boxes, then there is at least one box containing at least objects.
(Where is the ceiling function, representing the smallest integer greater than or equal to .)
- Application: Useful for determining the worst-case scenario required to guarantee a specific outcome.
- Example: How many cards must be selected from a standard deck of 52 to guarantee at least 3 cards of the same suit?
- (suits). We want the box to contain 3.
- Formula: .
- If we pick 8 cards, (not guaranteed).
- If we pick 9 cards, . Answer: 9 cards.
2. Relations and Their Properties
2.1 Definition
Let and be sets. A binary relation from to is a subset of the Cartesian product .
- If , we write (a is related to b).
- If , we say is a relation on set .
2.2 Properties of Relations on a Set
- Reflexive: .
- Every element is related to itself.
- Matrix diagonal contains only 1s. Graph has self-loops on every node.
- Irreflexive: .
- No element is related to itself.
- Symmetric: , if , then .
- Matrix is symmetric (). Graph edges are bidirectional (or undirected).
- Antisymmetric: , if and , then .
- There is no pair of distinct elements related to each other in both directions.
- Note: Antisymmetric is not the opposite of Symmetric. A relation can be neither, or both (e.g., equality).
- Transitive: , if and , then .
- "Shortcuts" exist in the graph.
2.3 Combining Relations
Since relations are sets (subsets of ), standard set operations apply. Let and be relations from to :
- Union:
- Intersection:
- Difference:
- XOR:
2.4 Composition of Relations
Let be a relation from to , and be a relation from to . The composition of and , denoted , is a relation from to .
- Order matters: means is applied first, then .
- Powers of a Relation: is the composition of with itself times. , , etc. A relation is transitive if and only if for all .
2.5 Inverse Relation
The inverse of relation , denoted , swaps the order of elements:
3. Representing Relations
3.1 Zero-One Matrices
Let and . A relation can be represented by an matrix where:
- if
- if
Matrix Operations corresponding to Relations:
- Union: (element-wise Boolean OR)
- Intersection: (element-wise Boolean AND)
- Composition: (Boolean Matrix Product)
- Boolean product replaces multiplication with AND, and addition with OR.
3.2 Directed Graphs (Digraphs)
For a relation on set :
- Vertices (Nodes): Elements of .
- Edges (Arcs): An arrow from to exists if .
Visualizing Properties in Digraphs:
- Reflexive: Loop at every vertex.
- Symmetric: If an arrow goes , one must go .
- Antisymmetric: If exists (and ), cannot exist.
- Transitive: If and , there must be an arrow .
4. Equivalence Relations
4.1 Definition
A relation on a set is an Equivalence Relation if it satisfies three properties:
- Reflexive
- Symmetric
- Transitive
Example:
- The relation "is equal to" () on integers.
- The relation "congruence modulo " on integers ().
- The relation "lives in the same house as" on a set of people.
4.2 Equivalence Classes
Let be an equivalence relation on . The equivalence class of an element , denoted (or simply ), is the set of all elements related to :
Representative: Any element is called a representative of the class.
4.3 Partitions
Equivalence classes split the set into disjoint subsets.
- The union of all equivalence classes is .
- The intersection of any two distinct equivalence classes is empty.
- Theorem: An equivalence relation induces a partition on a set, and conversely, any partition of a set induces an equivalence relation.
5. Partial and Total Ordering
5.1 Partial Ordering (Poset)
A relation on set is a Partial Ordering if it is:
- Reflexive
- Antisymmetric
- Transitive
The pair is called a Partially Ordered Set or POSET. The symbol is often used for the relation.
Examples:
- : Integers with "less than or equal to".
- : Power set of with "subset of".
- : Positive integers with "divides".
5.2 Comparability
In a poset :
- Two elements are comparable if either or .
- They are incomparable if neither holds.
5.3 Total Ordering (Linear Ordering)
If is a poset and every pair of elements in is comparable, it is a Total Ordering (or Totally Ordered Set / Chain).
- Example: is a total order.
- Counter-example: is not a total order (e.g., 2 and 3 are incomparable).
6. Hasse Diagrams
A Hasse diagram is a simplified graphical representation of a finite Poset.
6.1 Construction Algorithm
To convert the digraph of a poset to a Hasse diagram:
- Remove Loops: Since posets are reflexive, loops at vertices are implied.
- Remove Transitive Edges: If and , remove (transitivity is implied).
- Orientation: Arrange elements so that if , then is drawn higher than .
- Remove Arrows: Replace directed edges with line segments. The upward direction indicates the relation.
6.2 Components and Terminology of Posets/Hasse Diagrams
Let be a poset and .
- Maximal Element: An element such that no element comes "after" it. (There is no where and ). There can be multiple maximal elements.
- Minimal Element: An element such that no element comes "before" it.
- Greatest Element (Maximum): A unique element such that for all . (Top of the diagram connected to everything). Not all posets have one.
- Least Element (Minimum): A unique element such that for all . (Bottom of the diagram).
- Upper Bound: An element is an upper bound of subset if for all .
- Lower Bound: An element is a lower bound of subset if for all .
- Least Upper Bound (LUB / Supremum): The smallest of all upper bounds.
- Greatest Lower Bound (GLB / Infimum): The largest of all lower bounds.
7. Lattices
7.1 Definition
A Lattice is a specific type of Poset in which every pair of elements has both:
- A Least Upper Bound (LUB), denoted (called the Join).
- A Greatest Lower Bound (GLB), denoted (called the Meet).
Note: The symbols and here refer to Join and Meet operations, not logical OR/AND, though they behave similarly in Boolean algebra lattices.
7.2 Properties of Lattices
For any :
- Commutative: and .
- Associative: .
- Absorption Laws:
- Idempotent: and .
7.3 Sub-Lattice
A subset of a lattice is a sub-lattice if is closed under the meet and join operations defined in .
- Meaning: For any , their join () and meet () (as calculated in the original lattice ) must also be present in .
7.4 Types of Lattices (Brief Overview)
- Bounded Lattice: Has a Greatest element ($1$ or ) and a Least element ($0$ or ).
- Complemented Lattice: A bounded lattice where every element has a complement such that and .
- Distributive Lattice: Distributive laws hold (e.g., ).