 So welcome back to another screencast on basic set operations and set theory. And this one we're going to talk about a kind of mysterious idea called cardinality. On the surface of it, cardinality is actually pretty easy if you're working with finite sets. So the cardinality of a finite set A, and we're going to use the sort of, it looks like absolute value notation for A, is the number of elements in A. Now the key word here in this definition is finite. If we have a finite set A, we could start counting the elements at the beginning and eventually we'll stop. Then the number of elements in that finite set is what we mean by the cardinality. So for example, here are four examples actually. The set consisting of A, B, and C, it's cardinality. You can see there with the symbols there is three. There's one, two, three elements in it. Similarly there are one, two, three elements in this set here, 2200. This set here, the set of all natural numbers x such that x squared is less than 20, its cardinality is four. And why is that? Well, what's in that set? Let's write that out in roster notation and see. So we're dealing with positive integers here. So one is in there because one squared is less than 20. Two's in there because two squared is less than 20. Three's there, four's there, but that's it. So that's one, two, three, four elements for cardinality of four. The cardinality of the empty set is zero because quite simply there's nothing in the empty set. So that gives it a cardinality of zero. So here's a quick concept check that possibly head off a frequently misunderstood idea about cardinality. So suppose you have A and B are finite sets and the cardinality of A is less than or equal to the cardinality of B. So what does that mean about A and B themselves? Does that mean that A is a subset of B? That A is a proper subset of B? That B is a subset of A? That B is a proper subset of A or none of the above? The answer here is none of the above. And if that surprises you, then just got to be careful about what cardinality is. Cardinality is simply the number of elements in a set. So if I know that a set A has say two elements, let me just make one up. A is equal to the set consisting of the letters X and Y. So that's got a cardinality of two. And B has some set that has a slightly larger cardinality. Just because I know that one cardinality is less than the other doesn't tell me anything about the elements themselves in the set. For example, I could let B be the number three, six, nine, twelve. Okay? So the cardinality of B is four. The cardinality of A is two. And those two cardinalities are less than or equal to each other. But A is not a subset of B. They're completely apples and oranges here. None of the above just by knowing the cardinalities of two sets and how they relate doesn't really tell us anything about the sets themselves. Now the converse of could possibly be true here. If A happens to be a subset of B, then it would certainly be true that the cardinality of A is less than or equal to the cardinality of B. But that's one direction of a conditional statement. The opposite direction does not necessarily hold as you see here. So we're dealing with finite sets here. You might be asking, well, what about infinite sets? Well, with infinite sets, it gets pretty complicated. And I want to just sort of get slightly into the weeds with you here with this idea about cardinality of infinite sets is not really something we're equipped to talk about yet. So here's an example. The set of all natural numbers right here starting at one. I've listed out the first ten. And a set I'm going to call two n just to represent the set of all even natural numbers. Now on first blush, which set is bigger, n or two n? Well, in one sense, n is way bigger than two n. I mean, it's pretty clear that the two n set is a proper subset of n. In fact, it should seem somehow that the set of all natural numbers is quote unquote twice as big as the set of all even natural numbers. But in fact, so you should say like the cardinality of n is bigger than the cardinality of two n. It's got more elements in it. But it's more complicated than that because look at this. I can make a one-to-one correspondence between every element of n and every element of two n just by lining them up like this. So because I can connect every element of the natural numbers with every element of the even natural numbers in a one-to-one sort of way like this, then we should really say that n and two n have the same number of elements, have the same cardinality. And in fact, that's what we end up later on, you need to say, they have the same cardinality. Not because one has more elements than the other, because pretty clearly n has a lot more, maybe twice as many elements as two n. But they have the same cardinality because I can construct a one-to-one pairing off of the elements in this way. So they have the same cardinality even though one's a proper subset of the other. And that's just kind of weird. So like I said, it's complicated. It's even more complicated than that because think of something like the natural numbers and the rational numbers. Now, you'd have to say, well, surely to goodness, the rational numbers is an enormous set. It's bigger than the integers, bigger than the natural numbers for sure. But it turns out that they have the same cardinality too. And just to kind of illustrate why that is, let's just list the rational numbers in kind of an interesting way. And to simplify this, I'll look at only the positive rational numbers. So look at the positive rational numbers. I'll start with one here. I'll put two here, three here, four here. I'm going to make sort of a grid across here. And that extends infinitely this way. And the second row of the grid, I'm going to put a half, two halves, three halves, four halves, five halves, six halves, and so on. And this third row, I'm going to put one third, two thirds, three thirds. And you can kind of see what I'm doing here. Four thirds, five thirds, and so on. And the next row will be one fourth, two fourths. And you kind of get the picture here. So if I keep creating this grid, I'm actually going to end up covering all the positive rational numbers at some point in this grid here. And it'll extend infinitely this way as well. Now, a lot of these are double counted. For example, two halves and one are really the same number here. But at least the positive rational numbers are all included in this list here. And so, but the way I've listed it here in a grid, I can actually go through and attach a natural number to every one of these rational numbers. Like so, I'm going to pair off this one with one, this one with two, this one with three, this one with four, skip that one, this one with five, this one with six, this one with seven, eight, nine. And so you can see what I'm doing here is I'm able to, by going kind of up through the diagonals like this, I can list off each of these positive rational numbers and pair it off with a natural number. So actually the natural numbers and the positive rational numbers, which I'll denote with a little plus there, have the same cardinality, even though the positive rational is in some sense enormously much larger than the natural numbers. They have the same cardinality. So we don't want to think of cardinality as just merely being the number of elements in a set, because that works for finite sets, but for infinite sets it goes completely off the charts here. So to talk about the cardinality of infinite sets, we need the idea of a function, which is coming up in the next chapter. So cardinality though is useful for us here and now in the finite set case, just by counting the number of elements in a set, but again that's only for finite sets. Thanks for watching.