Transcript for:
Understanding Subsets and Set Operations

Okay, so in this lecture we are going to talk about operations on subsets. And when we want to compare two subsets, we need to know that they come from the same place. And the place that they are going to come from we're going to call a universal set. Now that will make sense in examples, but the sort of thing you don't want to do is to ask yourself how many different types of... animals are also the same as real numbers less than three. So this would be a very bad way to start comparing sets. So we'll start with a universal set and then we'll take a couple of subsets and then we will ask ourselves what new subsets we can make from those. The clearest way to get in your head what is going on when we... are doing this process is with a graphical way of looking at it that is called a Venn diagram. So I will show you Venn diagrams at the same time as I'm showing you the operations. The basic idea of a Venn diagram is that it has some shapes in it and each of the shapes represents a set, a subset. The shapes will have an inside and they will have an outside. And the things in the inside will be elements that are in the set. And the things on the outside will be elements in the universal set that are not in the subset. So things outside not in, things inside are in. But then you can get overlapping shapes. And so you can ask about what's in both of them or what's in neither. you know those will be our operations so let's uh let's start by just setting that out so we will have a universal set uh will be uh where all our uh elements are coming from and indeed uh All the subsets will be collections of these elements. So where all the subsets come from. So in the examples that we're going to take, we will set our universal set just to be the numbers, the natural numbers between 1 and 8. So those will be the numbers and then I'm going to take two sets and then I'm going to illustrate the operations we can perform with those two subsets. So the two subsets I'm going to pick are going to be A and that's just going to be these numbers 1, 3, 6 and 7 and B is going to be the following just 3, 6 and 8. So just some sort of random choices. And then the Venn diagram will show the interaction of these sets. The interactions. It is far easier to just show you what happens. So this is going to be my universal set. This is going to be U and I'm going to take a shape that's going to represent A and I'm going to have a shape that represents B and they're going to overlap a bit and then I'm going to put these elements in the places that they should be. So, um, the element one is in here, but it's not in here. The element two is not in both of them, not either of them. Element 3 is in both of them. The element 4 is in neither. The element 5 is in neither. The element 6 is in both. The element 7 is just in A. And the element 8 is in B. So this is a Venn diagram. And it shows you where all the elements of the universal set lie in the two subsets there. So that's the picture I'm going to keep referring to. So let's talk about the interactions. So the first interaction we want to talk about is intersection. And so you can give this as an operation on two subsets. It takes two subsets and it produces another one. the intersection A cap B is just the set of all the elements in the universal set that have the property that they are in A and they are in B. So they have to be in both of them. So in our case, so in the EG, A cap B is equal to this nice overlapping bit that we have here. It's just 3 and 6. Union. So this is another operation. Union. So the union, union, A cup B. Is the set of x in u such that x is in a or x is in b? Now it can be in one or other or it can be in both. So for us or is always this inclusive word. So what are in the picture all the elements that are in a or b or both? Well it's 1, 3, 6, 7, 8. So in the EG, a cup B is 1, 3, 6, 7, 8. Okay, complement. So this is the next example. And I think what I will do is I'll keep the picture of the example there so we can refer to it. So complement. So the complement is all the stuff that is not in a set. So it just takes one set and it produces the elements that are not in it. So the complement a dashed. So let's sort and write this out. The complement a dashed. of a subset A is the set of all elements in the universal set which are not in A. So in the EG, well we've got in A we've got 1, 3, 6 and 7, so we just want to put in all the other numbers that are not in there. So a dashed is equal to 2, 4, 5, 8. OK. The relative complement. So the relative complement. You need two subsets for this. So the relative complement of A in B is, and it's written A, I think this is a backslash, a large backslash, but we maybe call it set minus. A minus B is the stuff in A. which is not in B. So this is the relative complement of B in A, but you'd never write that. You'd just sort of talk about the symbol. But it's this set of X that are in A, such that X is not in B. So in the EG, Let's go back and have a look. What's all the stuff that's in A that's not in B? Well it's just the 1 and the 7 because the 3 and the 6 are also in B. So it's where you take A and then you minus from it all the stuff that's in B. So that explains this notation. Take all the stuff in A, take all the stuff out of it that is also in B. So in the EG, A minus B is going to be equal to 1 and 7. Okay, and there's one more operation that we need and it's called the symmetric difference so the symmetric difference of a and B is written A and then a small triangle and B and it's all the stuff that's in A and But not B. I'll write it out like this and then we'll See what it looks like. So all the stuff that's in A but not B and X in B but not A. Okay, so in fact we've seen how to describe the stuff that's in A but not B. It's just the relative complement. But we're taking the relative complement and then, so I should say there or, so we're taking all the stuff that's in A but not B. B but it's not A so the way to describe that is A set minus B union B set minus A okay let's just look at it in the picture so here we want all the stuff that's in A but not B so that's the one in the seven and we want to add to it all the stuff that's in b but not a and so that's the eight so um so in the eg uh a symmetric difference b sorry in the example asymmetric difference b is going to be 178 Okay, one of the things that we're going to do very soon is to show how you can describe these types of sets in different ways. So here we've described it as the union of two relative complements. But let's have a look at the picture again. If I want all the stuff that's in A and I want all the stuff that's in B, but I don't want them to be in A and B, Then another way to describe the symmetric difference is just to say I'm taking the union of A and B, and then I'm taking away everything that's in the intersection. So from the Venn diagram, we see that A... Symmetric difference B is also equal to A union B, but take away everything that's in the intersection. And there are more formal ways of proving this, but really actually using the Venn diagram is probably the clearest way to see it. I'm going to just finish with one point further, and that's just... say what happens when you take the symmetric difference of a set with itself. So again to see what's going on here it's best to look at this example. So here I'm taking, if we view it as taking the stuff that's in these outside pieces but not in the inside. If you imagine these coming together so that B became A and they had more stuff in their intersection, then you're eventually going to exclude it all. So when these come together, the bits here that are not in the intersection are going to shrink. And when finally the whole thing becomes one set you can see that actually you're going to get nothing in the symmetric difference. So an important case the symmetric difference of A and A is the stuff that is in A or in A but not in A and A so that's actually nothing. So if we do that and we get the empty set. Okay that will do for today.