Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums
Hot diggity – you’re about to get a bunch of new symbols and terms to add to your math vocabulary.
This section is a gentle introduction to a bunch of the basic notions you’ll be battling for the rest of this book. So, let’s dig in.
What is a set? A set is basically a list of stuff. Importantly, a set has no particular order – it is simply a big list of shit. For convenience, you can list it in any order you want, but no particular order is more valid than another.
For this book, we will be using something called naive set theory, which I understand to mean something like “set theory that was perfectly fine before everything went crazy in the early 20th century – I’m looking in your direction, Bertrand Russell.” Or, otherwise stated “set theory that basically makes human sense, and we won’t deal with axiomatizing it.”
Now, some housekeeping:
Sets are denoted inside curly brackets like so:
S= {1,4,3}
I read that as “S is the set which contains 1, 4, and 3.”
You can specify bigger sets using ellipses, like so:
S = {1, 2, 3… 999}
I read that as “S is the set which contains all the integers 1 through 999 inclusive.”
You can also use the handy vertical bar, “|” which I read verbally as “such that.”
The book’s example is:
O = {x | x is an odd positive integer less than 10}
You can read that as “O is the set of all x, such that x is an odd, blah blah blah…”
Or, it can be read as “O is the set that contains odd positive integers less than 10.” Same thing.
You can also use this little forky doodad “∈” which I read as “is a member of” or “is an element of.”
The book’s example is
Q+ = {x ∈ R | x=p/q, for some positive integers p and q}
This is a definition of positive rational numbers. I read it as “Q+ is the set where x is a member of the Real Numbers, such that x is a ratio of two positive integers.”
Or, more human friendly “Q+ is the set of reals that can be expressed as a ratio of two positive integers.”
Got it? There’s nothing really hard here – there’s just a lot to take in. You’ll get all that when we get to practice.
The book then gives us a definition of what it means for two sets to be equal. The simple version is “two sets are equal if they contain the same shit.” The rigorous version is that sets A and B are equal if ∀x(x∈A⇔x∈B).
That is, if being a member of A means you’re a member of B, and vice versa, then the two sets are equal, and we say A=B. For example, the set of people who think Return of the Jedi was better than Empire Strikes Back is equal to the set of people who are wrong about whether Return of the Jedi was better than Empire strikes back.
Additionally, you can have what are called empty, or null, sets. A null set is a set that contains nothing. You may ask why even bother with this, but it’s a common result to a lot of questions. For example, the set of people who are interested in your complaint about why we bother with null sets is a null set.
More importantly, null sets are sort of like having 0 in arithmetic. So, they come up pretty often. As such, we have a shorthand for them: ∅. As far as I can tell, Scandinavian language is full of null sets.
We also learn what’s called a singleton set. This is just a set containing only one member. Jokes on this topic are too easy, so I’ll lay off.
Venn Diagrams
You may believe that Venn Diagrams are mainly used for dirty jokes online. This is correct. However, they are also useful for explaining relations between sets. In the classic Venn Diagram, you have two sets which share some but not all members. But there are many other possible diagrams. A set may contain another set inside it. Two sets may exactly overlap. Two sets maybe be contained in a bigger set.
A Venn Diagram is a non-rigorous way to express relations visually. It’ll come in handy later on as you work problems. It also introduces you to have sets can relate to one another.
For example, if every element of A is in B, you can say “A⊆B” which is read as “A is a subset of B.” The symbols look conveniently like the “less/greater than” symbols, which makes it very intuitive. It also leads to some conclusions, which the book lists – every set contains ∅, and every set contains itself. Hopefully it’s pretty clear why.
For the case where A ≠ B and A⊆B (that is, B has everything in A plus some other stuff too) we say “A⊂B.” Read that as “A is a proper subset of B.” If you were to draw a Venn Diagram of A and B, B would encircle A and be larger than A.
Cardinality
Cardinality is just the number of members of a set. ∅ contains 0 members. {1,2,3} contains 3 members. You can also have infinite sets, but we’ll get into how to define their cardinality a little later on.
The Power Set
The power set is basically all the possible distinct sets you can build from some other set. It is denoted by P(S) where S is the set in question.
The book’s example is P({0,1,2}) = {∅, {0}, {1}, {2}, {0,1}, {0,2}, {1,2}, {0,1,2} }
Woof. But, you should be able to see what’s going on. The power set is the set of all possible subsets of the set in question. If that’s confusing, think of it like this: If you have a penny, a nickel, and a quarter, the power subset would be a list of all possible amounts of change you could give someone using those coins. You could give them none, all, just one, or some combination of two. So, the power subset is sort of like every arrangement of the elements of a set when order doesn’t matter.
Note that {∅} is not the same as ∅. The first is a set that has one element (the null set), and the second is the null set itself.
Cartesian Products
So far, we’ve dealt with situations where order doesn’t matter. But, what if we insist on order mattering?! We get the somewhat ugly name “ordered n-tuple.” “Tuple” as in “quinTUPLEt.”
An ordered n-tuple is a list of n elements where each element is assigned a position. So, for two ordered n-tuples are only equivalent if they contain the same elements in the same order.
This leads us two a concept called the Cartesian Product:
A×B = { (a,b) | a ∈ A ∧ b ∈ B }
This might look tricky at first, but it’s actually quite simple. It says that the Cartesian Product is the set containing all pairs of numbers, where each pair consists of an element from A and an element from B, in the order specified. So, if you have two lists, the Cartesian Product is every possible pair you could make using exactly one element from each list in order.
Note, that this leads to the result that A×B ≠ B×A. For example, if A is the set of Apples and B is the set of Boners, A×B will contain elements like (Granny Smith, Girthy) and (Fuji, Tumescent). If it’s B×A, it’ll contain elements like (Erect, Pink Lady) and (Enormous, Red Delicious).
You can also come up with Cartesian Products for trios (x, y, z) or even larger amounts. To denote this, you do like so:
A1×A2×…×An = {(a1,a2,…,an) | ai∈Ai for i = 1,2,…,n}
That is, take n sets and Cartesian Productify them together, and you’ll get an n-tuple with corresponding members.
Using Set Notation with Quantifiers
Hopefully by now this is pretty straightforward. If you start talking about the elements of a set, quantifiers allow you to specify whether you’re talking about all the members or some of them.
Truth Sets of Quantifiers
When you’re talking about a set, you can specify a subset called the Truth Set. The truth set is just the set containing elements for which the Truth Set is true.
For example, say the Truth Set for the statement “is good” is given by T(), and we have the set of all musicians, M.
M contains all musicians. T(M) is a subset of M which contains elements for which the statement “this element is good” is true. So, M includes Vanilla Ice. T(M) does not.
This is very much a section where you’ll want to work lots of problems. None of the ideas here are complicated, but you need to be fluent with them.
Next stop: Interesting Problems in 2.1