Sets, Relations & Functions
The three ideas almost all of math (and a lot of code) is built from: a set is a collection of distinct things, a relation connects things, and a function maps each input to exactly one output. Learn these and the rest of math has a vocabulary.
- Sets: Collections of Distinct Things A set is an unordered collection of distinct elements. Membership, subsets, and the three core operations — union, intersection, difference — plus the empty set, explained with plain intuition and runnable code.
- Relations & Functions A relation is a set of ordered pairs — a way of connecting things. A function is a special relation where every input maps to exactly one output. Domain, codomain, and range, made concrete.
- Why This Is the Vocabulary of Everything Sets and functions aren't abstract trivia — they're the hidden vocabulary under types, database tables, and data structures. See the same three ideas show up everywhere you build.