# More set theory

Union and intersection are two words that describe parts of two sets.  For instance, say I was talking about a class of students.  Some students in the class might do swimming.  Other students might do running.  And some students might do both.  The Venn diagram representing this class would look like this:

Now, in this situation, we have two basic sets – a set of students that do swimming, and a set of students that do running.  In the diagram I’ve used ‘S’ to represent the swimming set and ‘R’ to represent the running set.  You can also form more sets by combining these two basic sets in various ways – for instance the students who do both swimming and running form their own set.

The union of the two sets is all the things which are in one set or the other, or both.  So this means all the students who swim or run, or do both. If we shade in the region that represents the union of the two sets, the diagram would look like this:

There is a symbol that you can use to write, “the union of set S and set R.”  It’s like a very wide ‘U’, and it goes between the two set symbols.  So in this case, the union of S and R would be written:

The intersection of two sets is the overlap between the two sets – the students who do both swimming and running.  On the diagram, I can shade in the area representing the intersection of both sets:

There’s a symbol you can use to write the intersection of two sets as well, it’s a wide, upside down ‘U’.  It goes between the two set symbols.  For the intersection of ‘S’ and ‘R’ I would write:

Now, we can use n( ) to say, “the number of elements in.” For instance, if I said

this would mean the number of ‘elements’, or students in this specific case, that swim.   would mean the number of students who run.  But you can do combinations too, for instance if I wanted the number of students who did both swimming and running, I would write:

How would I find out the total number of students who did running or swimming?  Could I just add the number of swimmers and the number of runners together?

The answer to that is no!  Why?  Because some students do both swimming and running!  So if I just add the number of swimmers and runners together, I’ll be double counting some students.  Take this simple example – say I had two students who only swim, two students who only run, and one student who does both.  How many students do I have in total – 2 + 2 + 1 = 5.  How many swimmers do I have – I have 3 students who swim.  How many runners do I have – I have 3 students who run.  Add them together and you get 6, not 5.  This is because I have incorrectly counted twice the student who does both swimming and running.

So the correct way to find out the total number of swimmers and runners is to add the number who do each activity together, then subtract the number who do both.  In proper mathematical notation, this would be: