Sets, functions and relations
Sets and their operations, functions and their types, and relations with equivalence classes and partial orders: the structures that data and programs are built from.
About 5 hours of study
Learning objectives
- Compute with sets and count subsets and products
- Test a function for one-to-one, onto and bijective
- Classify a relation and find equivalence classes
Lessons
- 1
Sets
Writing sets, subsets, union, intersection, difference and complement, Venn diagrams, power sets, Cartesian products and counting with inclusion-exclusion.
- 2
Functions
Domain, codomain and range; one-to-one, onto and bijective functions, checked in Python; composition, inverses, floor and ceiling, and counting functions.
- 3
Relations
Relations as sets of pairs; reflexive, symmetric, antisymmetric and transitive relations; equivalence relations and their classes; and partial orders.
Module practice
- Set operationsEasy
- List all subsetsMedium
- Is it a partition?Hard
- Injective, surjective, bijectiveEasy
- Compose a function and find its inverseMedium
- Counting functionsHard
- A relation as a matrixEasy
- Properties of a relationMedium
- Transitive closureHard