hello everybody and thank you for joining me now in our last lesson we introduced sets and set operations we're going to start to get more into the actual content of the first part of the course now by counting the elements in our sets okay so the first third of the course is all about counting and counting problems learning counting techniques so what we're going to do now is start talking about counting and determining the sizes of our sets counting the number of elements so the way this will typically go is we'll have a word problem a scenario a set or group of sets will be described in English and we're going to need to find a way to break that down and determine exactly how many elements are in the set so to that end we're going to introduce some notation here if we've got a set a we write n of a to tell us the number of elements in a the size of a the number of things that are in our set so some quick examples if our set is Mouse cat dog that's three things so and of a would be three and of this set which we saw last time Alabama Alaska all the way up to Wyoming the set of 50 US states how many things are in there well 50 of them and our good friend the empty set n of the empty set is 0 because the empty set is empty it has nothing in it no elements so those are some nice simple examples where things are listed out but not everything can be listed out and even if some things can be it might be a bit of a pain to list things out so for example there's no way to list out the set of all people who voted NDP in our last federal election because in Canada we don't record who votes for whom ok so I know there are people who voted for NDP I know they're out there but I don't have a I don't have a set of them but there might be a way to count that despite not being able to list them all out and even if something can be written out it might be kind of large for example we could write out a way to represent the set of all possible poker hands using some notation of what cards you get and things like that but we wouldn't want to because that's two and a half million possible poker hands I don't have time I don't have enough paper to write that out incidentally a little later on we are going to learn how to count and determine this exactly how many poker hands there are okay but for now we'll just leave it we could create a set for it we don't want to but we might still want to count it now we don't just create sets by listing them out some we do but as we learned in the last lesson there are ways to take old sets and combine them to make new sets with our set operations like compliment intersection and union so we know how to relate some sets to other sets we know how to create some sets from other sets well it turns out there was a relationship between these set operations the size of the set you create with them and the size of the sentence you put in and this actually leads us to some nice formulas and a way to approach counting problems if the set of things that we want to count can be broken down as a couple intersections and a compliment we might be able to use that knowledge to count to answer our question so in this course we have four basic formulas and these ones definitely I recommend you get to know and get to know well so let's talk about them so if we've got sets a and B and possibly a universal set in case we need to use the third one here if we've got a and B the size the number of elements of the union of a and B can be calculated by the size of a plus the size of B minus the size of the intersection now if you do a little bit of arithmetic a little bit of rearranging of this formula here you can get the second formula here which says the size of the intersection of a and B is the size of a plus the number of things in B minus the number of elements in the union of a and B so these first two are just rearrangements of one another the third one here says if you want the number of things in the complement take the number of things in the union and subtract off the number of things that are in a and this seems kind of easy to see why this would work because the complement is just everything that is in the universe that is not in a so take away the things that you don't want the things that are in a and the last one this one's a little interesting the size of a the number of things that are in a is equal to the number of things that are in a and also in B plus the number of things that are in a but not in B come pair but not in B so a and B complement any of the things that are in a and not B the things that are an A and B complement so this one here it's sort of better explained verbally okay anything that's in a is either also in B or is not in B and therefore in B complement so you can perfectly split the things that are in a into exactly these two sets without any overlap but you don't actually need to understand the reasoning behind why these formulas work I just think it's better in terms of learning them too I remember why they work but these four formulas can be very very helpful some set relationships and some set properties can also be helpful for us in particular the de Morgan's laws now there are other properties of sets that you may encounter there are other formulas that we could create but the four that we saw the four formulas we just saw and these de Morgan law de Morgan's laws are among the most prominent and so they're definitely important to us so what are the de Morgan's laws the two very similar things and they basically say how intersection Union and complement relate to one another so if I've got a and B the complement of their intersection is the union of the complements of a and B similarly the complement of a union B is the intersection of a complement and B complement so these can be very helpful because maybe you're doing a question and you're trying to work it out the size of the complement of the union of a and B you may instead choose to rewrite that and then maybe apply one of the formulas we just saw and that might be an easier thing to do so the demorgan's laws just sort of let us switch around our notation without losing the meaning behind what these sets are representing what our notation is representing so let's go through a sort of an example okay we want to know the size of a complement Union B complement and that's the set we're after we want to know that size and we're given some information we know a whatever it is has 17 elements size of B is 33 the union of a and B has 42 objects and the size of the universal set is 60 so we might write and U is equal to 60 and we're after the size of the complement of a complement Union B complement and that's where after so that's our goal so we might first say well hey I recognize that I can use the de Morgan's laws to rewrite this as the complement of the intersection all right the complements hop out and then the you flips over okay so it was facing up now it's facing down that's a way to remember how the de Morgan's laws work and now I'm looking at size of something complimented we might remember there's a rule that says if you want the size of a compliment so the size of the universal set minus the size of the original set so we can break this down as n of the universe - end of the intersection well we are told in the question the Universal set has 60 things in it so we know what this number is so now the question is can we figure out the size of the intersection of a and B from the given information well we're told anime we're told out of being we're told the size of the union so one of our formulas tells us now that n of a intersect B must be the intersection of a and B must have eight things that's how much they overlap so if we take that and put that back in here we can see that n of the set we're after it means the same thing but has different notation to n of the complement of the intersection which is n of the universe minus n of the intersection which is 60 minus 8 so the answer here is 52 and as we get more comfortable with the formulas more comfortable recognizing when we can switch things around with de Morgan's laws and as we accumulate more properties and we can get faster and faster at these things and we'll find that we sort of can see the pieces fitting together as we read the question you can get a lot faster at these things when we use our formulas when we're comfortable with them okay now formulas aren't everything so going forward we might learn other techniques but for now this is a pretty good pretty good approach taking sets breaking them down from perhaps their natural language descriptions into how they are described using intersections unions and complements and then using these formulas to count the number of elements