okay so in this lecture we are going to talk about operations on subsets and uh when we want to compare two subsets we need to know that they come from the same place uh and the place that they're going to come from we're going to call a universal set now that will make uh sense in examples but the sort of thing you don't want to do is to ask yourself how many different types of animals uh are also the same as real numbers less than three so this would be uh a very um 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 um the clearest way to get in your head what is going on when we we are doing this process is with sort of graphical um way of it looking at it that is called a ven diagram so I will show you ven diagrams uh at the same time as I'm showing the operations but the basic idea of a v diagram is that it has some shapes in it and each of the shapes represents a set a subset and uh 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 um 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 or um you know uh 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 um collections of these elements uh so all the subsets come from so uh in the examples that we're going to take uh we will set our Universal set just to be the numbers uh the natural numbers between 1 and 8 so those will be uh the numbers and then I'm going to take two sets uh 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 uh and that's just going to be these uh numbers 1 three and six and seven and B is going to be the following just three six and8 so just some sort of random choices uh and then the ven diagram uh will show the interaction of these sets uh the interactions uh it is far easier to give uh to just show you what happens um 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 just 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 three is in both both of them the element four is in neither the element five is in neither the element six is in both the uh element seven is just in a and the element eight is in B so this is a ven diagram uh and it shows you where will the elas of the universal set lie uh in the two subsets there so that's the picture I'm going to keep uh referring to so let's talk about the interactions so the first interaction we want to talk about is intersection and so you can think of this as an operation on two subsets it takes two subsets and it produces another one so uh the intersection a cap B uh is just the set of all the elements in the Universal set that are have the property that they are in a and they are in B so they have to be in both of them so in the in our case so in the EG uh a b is equal to this nice overlapping bit that we have here it's just three and six Union so this is another operation Union so uh the union union uh a cup B is the set of X in U such that X is in a or x's in B now it can be in one or other or it can be in both so for us or is always this inclusive um uh word um 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 uh 1 3 6 7 8 okay uh compliment so this is the next uh example and I think what I will do is I'll keep the picture of the uh the example there so you can refer to it uh so compliment so the complement is all the stuff that is not in a set so it just takes one set and it produces the um the elements that are not in it so uh the complement a dashed uh so let's s write without the complement uh a dashed of a subset a is the set of all elements in the universe veral Set uh which are not in a so in the EG uh well we've got in a we've got 1 3 six and seven so we just want to put in all the other numbers that are not in there so uh a dashed is equal to uh two uh 4 5 8 okay uh the relative complement so the relative complement uh you need two subsets for this so uh the relative complement of a in B is and it's written [Music] a uh I think this is a backslash a large backslash but we maybe call it set minus a minus B is the stuff in a uh which is not in B so uh this is the relative complement of b in a a but you never write that you just sort of talk about the um talk about the symbol but it say 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 one and the Seven because the three and the six 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 uh and there's one more operation that we need and it's called the symmetric difference so the symmetric difference of a and b uh is written a and then a small triangle and B and it's all the stuff that's in a uh and uh um but not b a um I'll write it out like this and then we'll um see what it looks like so all the stuff is in a but not B uh and uh 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 digging the all the stuff that's in a but not b or B that'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 uh 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 the example as symmetric difference B is going to be uh 178 okay um one of the things that we're going to do uh very soon is to describe 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 um if I want all the stuff is in a and I want all the stuff that's in B but I don't want them to be in uh 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 ven diagram we see that uh a symmetric difference B is also equal to uh a union B but take away everything that's in the intersection uh and there are more formal ways of proving this but really actually using the ven diagram is probably the clearest way to see it I'm going to just finish with one point uh further and that's just uh say what happens when you take the symmetric difference of a set with itself so again to see what see what's going on here it's best to look at this example so here the I'm taking so if we view it is taking the stuff that's in these uh outside pieces but not in the in the inside if you imagine these coming together so 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 um 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 um an important an case the symmetric difference of a and a is the stuff that is in a or in a but not in an Ana so that's actually nothing so if we do that and we get the empty set okay that we'll do for today