Sets, relations and functions
| English | Chinese | Pinyin |
|---|---|---|
| set | 集合 | jí hé |
| union | 并集 | bìng jí |
| intersection | 交集 | jiāo jí |
| set complement | 补集 | bǔ jí |
| subset | 子集 | zi jí |
| Venn diagram | 韦恩图 | wéi ēn tú |
| inclusion-exclusion principle | 容斥原理 | róng chì yuán lǐ |
| relation | 关系 | guān xì |
| function | 函数 | hán shù |
Collections, and what they share
- Eighteen students study French, fifteen study German, seven study both. How many study neither?
- Adding 18 and 15 counts the seven twice. Sets are the machinery for not doing that.
- A set 集合 is a collection of distinct objects, where order and repetition do not matter.
Union, intersection, complement
- The union 并集 $A \cup B$ contains everything in either set.
- The intersection 交集 $A \cap B$ contains only what is in both.
- The set complement 补集 contains everything outside the set.
- A subset 子集 has all of its elements inside another set.
Match each set operation to what it contains.
Union and intersection are the two the inclusion-exclusion formula connects.
Venn diagrams and inclusion-exclusion
- A Venn diagram 韦恩图 turns a set problem into a picture, and drawing one is usually faster than reasoning in words.
- The inclusion-exclusion principle 容斥原理: $|A \cup B| = |A| + |B| - |A \cap B|$.
- Subtracting the overlap once is the entire content of that formula.
Two sets and their overlap
The union counts the overlap once, which is what the minus sign is for.
Class of 30: French 18, German 15, both 7.
Four study neither.
Fill the Venn diagram from the middle outwards: 7 in the overlap, then $18-7 = 11$ in French only, $15-7 = 8$ in German only. That order never double-counts, which is why it is the method to learn.
In a class of 30, 18 study French, 15 study German and 7 study both. How many study neither?
18 + 15 − 7 = 26 study at least one, so 30 − 26 = 4 study neither.
In the same class, how many study French only?
18 − 7 = 11. Filling the Venn diagram from the middle outwards never double-counts.
Relations and functions
- A relation 关系 pairs elements of one set with elements of another.
- A function 函数 is a relation where each input has exactly one output.
- That restriction is the whole definition: a rule giving two answers for one input is not a function, however useful it is.
What makes a relation a function?
One input, one output. Two outputs for one input is a relation but not a function.
Start a set problem at the intersection. Place the "both" number first, then subtract it from each total to get the "only" regions. Working from the outside in is where double-counting comes from.
What does |A| mean in set notation?
It is a count. Exam questions use the notation without explaining it.
$|A|$ means the number of elements in $A$, not a value or an absolute value. Reading it as anything else turns inclusion-exclusion into nonsense, and the notation is used without explanation in exam questions.