An explanation of PIE:

Let's say we want to count thenumber of people of who go to Aops or this website.

What happens if just add up the number of people of who go to Aops and the number of people who go to this webiste.

Then we would be overcunting. But what do we overcount? People who only go to Aops are counted once. People who only go here are counted once. But what about people who go to both?

They are counted twice! So we need to substract the number of people who go to both so that they are counted once.

Now: How many people here are good at algebra, couting, or geometry?

If we add the number that are good at algebra, and the number that we are ggod at counting and the number othat are good at geo, we get an over count!

How many times have we counted people who are good at algebra, good at geo, but not good at counting? 2 times: once for the number that are good at algebra, oncce for the number of people who are good at counting. So let's substract them. We do the same for the other people who are good at exactly two subjects.

Now, what about the people who are good at all 3? They get counted 3 times originally, but then we subtracted 3 times. So we need to ADD this number.

Hmm... Is there a pattern? Try it for greater n and you will find a pattern!