Prerequisites: logic
Set
A set is a collection of distinct objects, considered as an object in its own right. Sets are usually denoted by capital letters, e.g. .
The objects in a set are called the elements or members of the set. We write if is an element of the set , and if is not an element of .
denotes the empty set, which contains no elements.
B means that every element of is also an element of .
Link to originalCardinality
The cardinality of a set is the number of elements in .
We denote the cardinality of by , also denoted by or .
Two sets and are equal if and only if both are subsets of each other.
Ways of denoting sets.
Roster notation: or listing elements (“aufzählend”)
Set builder notation: , where is a property that must satisfy (“beschreibend”), e.g.:
Subsets: e.g.: (more common)
Interval notation:
Union (Vereinigung)
The union of two sets and , denoted by , is the set of all elements that are in or in or in both:
Or for set systems (more than two sets):
is the index set (the set of indices for the sets which we are taking the union of).
Intersection ((Durch)Schnitt)
The intersection of two sets and , denoted by , is the set of all elements that are in both and :
Or for set systems (more than two sets):
Complement
Let’s call the set of all elements we are working with (Grundmenge / basic set). Then we can define the complement of a set as the set of all elements in that are not in :
Other notations for the complement:
Difference
The difference of two sets and , denoted by , is the set of all elements that are in but not in :
Symmetric difference
The symmetric difference of two sets and , denoted by , is the set of all elements that are in exactly one of the two sets (like an xor):
(NOTE: Due to a bug in Obsidian-tikzjax, the symmetric difference only renders correctly in live-preview mode… click the link for correct rendering)
Properties of sets
Proving set identities
“Rückführung auf logische Regeln” (reduction to logical rules):
“Anwenden der Äquivalenz” (applying the equivalence):
Element table: Create a table with and for each set, then compare the tables, just like a truth table in logic.
power set
Power set
The power set is the set of all subsets of , i.e.:
It can also be written as .
Why? Because it represents all possible binary choices for the elements in .
For example: has the subsets , which can be represented as in binary, i.e. subsets.The cardinality of the power set of a finite set : .
$$
{ 0,1 }^{A} \mapsto 2^{A}
$\{0,1\}^A$ represents the set of all functions from set $A$ to the set $\{ 0,1 \}$. $2^{A}$ represents the [[power set]] – the set of all subsets of $A$ → For any subset of $A$, we can define a function $f: A \to \{ 0,1 \}$ that maps elements in the subset to $1$ and the rest to $0$. → Conversely, for any function $f: A \to \{ 0,1 \}$, we can define a subset of $A$ that contains all elements that are mapped to $1$. $\implies$ There is a [[bijective|bijection]] between $2^{A}$ and the set of all functions from $A$ to $\{ 0,1 \}$.Link to originalLink to originalThe sum of all binomial coefficients for fixed (row of Pascal’s triangle) equals
This makes intuitive sense when thinking about sets: counts the ways to choose items from items, and summing over all possible gives us the total number of possible subsets of an -element set, which is . Each element either is or isn’t in the subset, giving us two choices for each of the elements → power set.
cartesian product
Link to originalCartesian product
multiset
Multiset
A multiset is a modification of the concept of a set that allows for multiple instances of the same element. Unlike regular sets where each element appears exactly once, multisets track the multiplicity (number of occurrences) of each element.
Formally, a multiset over a universe (base set) is defined via its “multiplicity function”:Key properties:
- Order is irrelevant (like regular sets)
- Elements can appear multiple times
- The multiplicity of each element is significant
- Elements can have zero occurrences
Notation: If is a multiset, we can denote it as:
- (listing all occurrences)
- (using superscripts for multiplicity)
The cardinality of a multiset includes all instances:
Examples
The string “hello” as a multiset:
Chemical formula H₂O as a multiset:Link to originalpermutation of a multiset
Permuting a multiset is like permuting a string of characters:
There are ways to permute a set with elements, but for a multiset, we need divide by the amount of permutations of equal elements whose order doesn’t matter (eliminating all those sub-trees). E.g. has permutations, but only unique ones.
Let be a multiset with elements where is an element and is the multiplicity of .
The number of unique permutations of is:
A note on terminology
https://mathworld.wolfram.com/Collection.html says that a collection refers to a multiset.
But gpt5 says that’s almost certainly not the case in most contexts, a collection just a set.
But collection is so generic and context dependent, I only use it as “a bunch of things” and then define if necessary, else use a more specific term.