Sets, Relations & Functions
Here's a quiet secret about mathematics: almost all of it is built from three ideas, and you already use
all three in code. A set is a collection of distinct things (a Set in your language of choice). A
relation is a way things are connected (rows in a database table). A function is a rule that
turns each input into exactly one output (a pure function, or a lookup map). Get these three solid and
you've got the vocabulary the rest of math is written in.
This guide assumes nothing beyond Why Math Isn't Your Enemy - if you can read the notation from that guide, you're ready. We'll build each idea from the ground up, with real examples and runnable code, and keep showing how the math object you're learning is the same thing as a tool you already reach for.
How to read this
- Want the foundation fast? Phase 1 on sets is the bedrock everything else stands on.
- Want it to stick? Read in order - relations and functions are defined in terms of sets, so Phase 1 earns the rest.
The phases
- Sets: Collections of Distinct Things - membership, subsets, and the operations (union, intersection, difference) - with the empty set and why duplicates don't count.
- Relations & Functions - ordered pairs, what makes a relation a function, and domain/codomain/range without the fog.
- Why This Is the Vocabulary of Everything - how sets and functions quietly power types, databases, and data structures.
With this vocabulary in hand, the Mathematics track moves on to numbers and number systems, counting, and probability.