Unit 3 - Notes
Unit 3: Counting Principles and Relations
1. Counting Principles
Principle of Inclusion-Exclusion (PIE)
Used to calculate the size of the union of multiple sets by accounting for overlapping elements (intersections).
- For Two Sets ():
- For Three Sets ():

Pigeonhole Principle
- Basic Principle: If objects are placed into boxes, then at least one box contains two or more objects.
- Generalized Pigeonhole Principle: If objects are placed into boxes, then at least one box contains at least objects (where is the ceiling function).
2. Relations and Their Properties
A Binary Relation from set to set is a subset of the Cartesian product . If , it is a relation on set .
Properties of Relations
Let be a relation on set :
- Reflexive: . (Every element relates to itself).
- Symmetric: If , then .
- Antisymmetric: If and , then . (No mutual relationship unless elements are identical).
- Transitive: If and , then .
Combining Relations
Since relations are sets, set operations apply:
- Union:
- Intersection:
- Difference:
- Composition (): Let and . The composition is the relation from to defined as:
if such that and .
3. Representing Relations
1. Zero-One Matrices
A relation on set is represented by matrix where:
- if
- if
Properties in Matrix form:
- Reflexive: Main diagonal contains all 1s.
- Symmetric: Matrix is symmetric ().
2. Directed Graphs (Digraphs)
- Vertices: Elements of set .
- Edges: Directed arrow from to if .
- Loops: An edge from a vertex to itself (indicates Reflexivity).

4. Types of Relations
Equivalence Relations
A relation is an Equivalence Relation if it is:
- Reflexive
- Symmetric
- Transitive
- Equivalence Class : The set of all elements related to . These classes partition the set .
Partial Ordering Relations (POSET)
A relation is a Partial Order if it is:
- Reflexive
- Antisymmetric
- Transitive
- Notation: denotes a POSET.
- Comparable: Two elements are comparable if or .
- Total Ordering: A POSET where every pair of elements is comparable (a linear chain).
5. Lattices and Hasse Diagrams
Hasse Diagrams
A simplified graphical representation of a finite POSET.
- Rules for Construction:
- Remove all self-loops (Reflexivity is implied).
- Remove transitive edges (If and , remove ).
- Arrangement implies direction: If , place physically higher than . Remove arrows; lines connect elements.
Components of a Hasse Diagram
- Maximal Element: No element is "above" it.
- Minimal Element: No element is "below" it.
- Greatest Element (Maximum): Unique element greater than all others.
- Least Element (Minimum): Unique element less than all others.
- Upper Bound: An element such that and .
- Lower Bound: An element such that and .

Lattice
A Lattice is a POSET in which every pair of elements has both:
- Least Upper Bound (LUB/Supremum/Join): Notation .
- Greatest Lower Bound (GLB/Infimum/Meet): Notation .
Sub Lattice
A non-empty subset of a lattice is a sub lattice if itself is a lattice under the same operations ( and ) defined in .
- If , then and .