 So there's one last concept related to equivalence classes that we need to discuss, and that's the idea of a partition of a set. Let's motivate this idea as usual with an example. Let's look at the set of all states in the United States. Now just so you'll know, depending on when you're viewing this, Puerto Rico may actually be a state. At the time that I was recording this, Puerto Rico's statehood is up for a vote in Congress. So just for fun, let's go ahead and include it up. Let's introduce an equivalence relation, which we'll denote by tilde as usual, by saying that two states are equivalent if and only if they begin with the same letter. So for example, Michigan and Minnesota are equivalent under this relation, and so are Texas and Tennessee. Note that this really is an equivalence relation as you can easily check reflexivity, symmetry, and transitivity. Let's use the map here on the screen to color code states according to whether they are equivalent or not. So for instance, I'm going to color Michigan, Minnesota, Montana, Mississippi, and Maine, all the same color because they are all equivalent to each other. I also need to color Washington, Wyoming, Wisconsin, and West Virginia all the same color because they are all equivalent to each other as well. Utah is the only state in the United States that begins with a U, so it's going to be the only one of its color. I won't continue through the whole map because it would get illegible, especially with all these little small northeastern states over here, but you get the idea. What I would end up with here if I continued in the end is a collection of clusters of states, one cluster for each color that I used. Notice that this set of clusters has three things going for it. First of all, each cluster is non-empty. Every color that I've listed here does have a state that belongs to it. Secondly, on the flip side of this, every state will belong to one cluster. Some states like Utah are the only ones in their cluster. Other states may share a cluster with several others like Michigan. But if we continue the coloring process throughout the entire map, every state will have some color assigned to it. And thirdly, notice that the clusters are either equal or disjoint. If you have any two different colors here, or any two different clusters, there's no overlap between them if they're different. So what these clusters are doing here is taking a set that has an equivalence relation on it, and then using the equivalence relation to group together elements of the set that are quote unquote like each other, and to do so in a very neat and tidy sort of way. We're going to call such a grouping or clustering a partition of the set. Here's the formal definition. Let A be a non-empty set, and script C is a collection of subsets of A. Then the collection script C is called a partition of A if three things happen. First of all, for every subset in the collection script C, that subset must be non-empty. Secondly, for every point in the set A, the point X belongs to some subset that's in script C. This is like when we notice that every state will eventually belong to some color. Third, if we take two subsets out of the collection script C, then they will either be equal or disjoint. So our clustering of states by first initial is an example of making a partition. The set we are partitioning is a set of all names of states in the United States. The collection script C was a set of all colors we made in coloring the map. This is basically each color is a subset of the set of state names. This collection is a partition of the set of state names, because each color set was non-empty. Every state belongs eventually to some color and given two subsets from the collection, the subsets are either equal or disjoint and said differently if two subsets or colors are different at all, then they have absolutely nothing in common. Here's another very important example of a partition. Let A be the set of all integers and let script C be the collection of these five subsets of Z. This collection of subsets partitions Z because each subset in the collection is obviously non-empty. Because every element in the integers belongs to one of these subsets and because if you choose any two of these subsets they're either equal or disjoint. There is no partial overlapping of any two of these sets. It's either all or nothing. Visually what this means is that if we drew the set of integers on a number line like this and colored the integers according to which subset they belong to, we get something that looks like this. Again notice that we are clustering integers together according to the subset to which they belong. No cluster is empty. Every integer goes into one of these bins and there's no overlapping between different clusters. So you might be wondering about something from the first example involving the states and their first initials. We mentioned that declaring two states to be equivalent if and only if they have the same first letter in their names was an equivalence relation. But what did that have to do with partitioning? It seemed like we didn't do anything with the equivalence relation once we defined it. Well if you think about it, each color in that map is actually an equivalence class. Each color denotes a set. And two states belong to that set or color if you wish if they are equivalent under the first initial relationship. And if you look carefully at this example involving the integers, you might realize that these subsets under the integers, each of them, is an equivalence class too under the relationship of congruence mod five. So there's a close connection between partitions and equivalence classes that we're going to make rigorous with this theorem. Let tilde be an equivalence relation on any non-empty set A. Then the collection script C of all equivalence classes determined by tilde is a partition of A. That is, every equivalence relation determines a partition of the set of objects that are being declared equivalent. And the subsets in the partition are the equivalence classes. So we're going to end off here not with a full blown proof of this theorem, but just an explanation of why it's true. It's true because of two propositions we met in an earlier video. The first of these guarantees that equivalence classes are always non-empty and that every point in the set A to which the equivalence relation refers belongs to a class. This is because every point in A belongs to its own equivalence class. So both the first and the second properties of a partition are satisfied by equivalence classes. The second proposition tells us that given any two equivalence classes, even if the representatives inside the square brackets are different, the classes are either equal or disjoint. And that's exactly the third property of a partition. So equivalence classes allow us to cluster elements of a set together according to whether they are equivalent or not. And this gives us a neat and tidy way of organizing the elements of a set. This will become very handy at our next and final section of videos coming up soon.