Beginner Topic 4 of 51 Theory & Discrete Math
Functions and Relations
Mappings and pairings between sets.
How it works
A relation between sets A and B is a subset of their Cartesian product, pairing elements that are related. Properties include reflexive, symmetric, antisymmetric and transitive; equivalence relations partition a set into classes and partial orders define hierarchies. A function is a relation assigning each input exactly one output, and can be injective, one-to-one, surjective, onto, or bijective, both, which means it has an inverse.
Step-by-step walkthrough
- A relation is any set of pairs between two sets.
- A function gives each input exactly one output.
- One-to-one: no two inputs share an output.
- Onto: every codomain element is hit.
- A function that is both has an inverse.
Where it is used
Database tables model relations, hash functions and mappings model functions, equivalence relations define grouping, and orders define sorting and dependency graphs.
Common pitfall
Confusing a function with a formula ignores domain and codomain: changing them changes injectivity and surjectivity. Multi-valued mappings are not functions. Checking transitivity or antisymmetry by only a few examples can miss counterexamples. Composition order is easy to reverse. State the domain and codomain and test properties with definitions.
Where it fits in the course
Functions and Relations is topic 4 of 51 in Theory & Discrete Math, rated Beginner. It follows Sets and Set Operations. The next topic is Mathematical Induction.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Theory & Discrete Math quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Theory & Discrete Math quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Functions and Relations?
Where do people use Functions and Relations?
What is the most common mistake with Functions and Relations?
What should I learn before this topic?
How can I practice it?
Is Functions and Relations hard to learn?
How long does it take to learn Functions and Relations?
Which topics are related to Functions and Relations?
What should I study after Functions and Relations?
Related topics
- Sets and Set Operations (Theory & Discrete Math)
- Mathematical Induction (Theory & Discrete Math)
- Predicate Logic (Theory & Discrete Math)
- Proof Techniques (Theory & Discrete Math)
- Functions and Graphs (Math for Computing)
- Functions (Programming Fundamentals)
- Aggregate Functions (Databases)