If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

# Relative complement or difference between sets

## Video transcript

what we're now going to think about is finding the differences between sets and the first way that we will denote this is we'll start with set a I've already defined set a let me do it in that same shade of green I've already defined set a here and in both cases I've defined these sets with numbers I could have had the instead of having numbers as being the objects in the set I could have had farm animals there are famous presidents but numbers hopefully keep things fairly simple so I'm going to start with set set a and from set a I'm going to subtract I am going to subtract set B so this is one way of thinking about the difference between set a and set B and when I've written it this way this is essentially says give me the set of all of the objects that are in a with the things that are in B taken out of that set so let's think about what that means so what's in set a what the things that are in B taken out well that means let's take set a and take out a 17 a 19 or take out the 17 the 19th and the 6is so we're going to be left with we're going to have the 5 we're going to have the 3 we're not going to have the 17 because we subtracted out set B 17 is in set B so take out anything that is in set B so you get the 5 the 3 C the 12 is not in set B so we can keep that in there and then the 19 is in set B so we're going to take out the 19 as well and so that is this right over here is you could view it as set B subtracted from set a so one way of thinking about it like we just said this is these are all of the elements that are in set a that are not in set B another way you could think about it is these are all of the elements that are not in set B but also in set a so let me make it clear this you could view this as as be subtracted subtracted from from a or you could view this as the relative complement relative r-la I always have trouble spelling things relative relative complement complement of set B in a and we're going to talk a lot more about compliments in the future but the compliment is the things that are not in B and so this is saying look what are all of the things that are not in B so you could say what are all of the things not in B not in B but are in a so once again if you said all the things that aren't in B then you're thinking about all of the numbers in the whole universe that aren't 1719 or 6 and actually you could even think broader not even just thinking about numbers it could even be the color orange is not in set B so that would be in the absolute complement of B you have I don't see a zebra here in set B so that would be its complement but we're saying what are the things that are not in B but are in a and that would be the numbers 5 3 and 12 now when we when we visualized this as B subtracted from a you might be saying hey wait look look okay I could imagine you took the 17 out you took the 19 out but what about taking the 6 out shouldn't have you taken a 6 outer you know and traditional subtraction maybe we would end up with a negative number or something and when you subtract a set if this is set you're subtracting from does not have that element then taking that element out of it doesn't change it if I start with set a and take a 6 if I take all the sixes out of set a doesn't change it there was no 6 to begin with I could take all the zebras out of set a it will not change it now another way to denote this the relative complement of set B in a or b subtracted from a is the notation that I'm about to write you we could have written it this way a and then we would have had this little figure like this that looks eerily like a division sign II really like a division sign but this also means the difference between set a and B where we're talking about when we write it this way we're talking about all of the things in set a that are not in set B or the things in set be taken out of set a or the relative complement of B in a now with that out of the way let's think about things the other way around what would what would be what would be slash I'll just call it a slash right over here what would be B or it what would be B - a be so what would be B minus a which we could also write it as which we could also write as B B minus a what would this be equal to well just going back to this we could view this as all the things in B with all of the things in a taken out of it or all of the things the complement of a that happens to be in B so let's think of it as the set B with all the things in a taken out of it so if we start with set B okay we have a 17 but a 17 is in set a so we have to take the 17 out then we have a 19 oh but there's a 19 in set a so we have to take the 19 out then we have a 6 oh well we don't have to take a 6 out of B because the 6 is not in set a so we're left with just the 6 so this would be just the single the the set with a single element in it set 6 now let me ask another question what would what would the relative complement of a in a be well this is the same thing as a minus a and this is literally saying let's take set a and then take all the things that are in set a out of it well I start with a 5 oh but there's already 5 there's a 5 in set a so if I take a 5 out well there's a 3 but there's a 3 in set a so I have to take a 3 out so I'm going to take all of these things out and so I'm just going to be left with I'm just going to be left with the empty set the empty set often called the null set and sometimes the notation for that will look like this the null set the empty set there's a set that has absolutely no objects in it