Inclusion-Exclusion
(David here.) In The Rising Sea, Ravi Vakil writes:
When introduced to a new idea, always ask why you should care. Do not expect an answer right away, but demand an answer eventually. Try at least to apply any new abstraction to some concrete example you can understand well.
We have something analogous for understanding proofs - with time, new perspectives show up and reveal new insight, and allows one to tackle problems that seemed impossible before.
(I have to stress that this happens eventually - the line of thought behind this article spanned years!)
PIE. Can you remember the proof of PIE off the top of your head?
Here's a small case:
Perhaps someone told you to draw a Venn diagram, and to look at how many times each region by , and then to correct for it etc.
For the longest time, in my head the case justified the truth of the general PIE: I asssumed there was some messy induction you could do to generalize the logic of the small cases, and didn't look much further into it. But it certainly didn't feel that my understanding was complete.
Significance. What did we even need this for? Maybe you've had to count how many numbers up to a 1000 that were not multiples of 2, 3 or 5. In general, it's good for counting things that are simultaneously "not X, not Y, ..." when it was easy to count things that were simultaneously both X and Y and so on.
A special case of this is counting "primitive" elements - how many numbers from 1 to are coprime to ? Well, if had prime factors , we would need to count all numbers that are not divisible by . Thus,
If you know about the Chinese remainder theorem, you might know that taking a (uniformly) random number from 1 to should give you independently random residues mod , so we can just write and it's not too hard to realize that these are equivalent expressions. Hmm.
The proof. It was many years later that I learnt of a satisfactory proof. This involves switching gears and talking about the probability version of PIE. (Perhaps you guessed this was coming from the last paragraph? It took me a year or so.)
In probability, one talks about events (e.g. "sum of two dice rolls = 7"), but often one can equivalently talk about sets of outcomes (e.g. "the number of pairs of dice rolls that sum to 7"). If these outcomes are equally likely, then the probability of an event is proportional to the number of outcomes corresponding to the event.
So with events instead of sets, we must also have that where denotes the probability of simultaneously happening. For each event , we can make a ranodm variable which is 1 if event happens and 0 otherwise. The mean of is exactly so probability of events correspond to the expectation of their indicator functions. So the probabilistic statement corresponds to
Now for the voila moment - (that's what it means for both events to happen), whereas if you're not in , then you're not in each of them: and immediately we recover the original PIE by summing both sides over all elements.
For the first time, I felt like I could see that PIE was true in full clarity and immediacy.
Remark. To some extent, PIE is not just a statement about the size of the sets, but more generally the composition of the sets: in the Venn diagram argument, to get the union, we start with A, B, C, then we remove the duplicates, and then we recompensate for duplicate removals. (So the statement wouuld also be true if we measured the size of sets by - this means that the indicator version has to be true!)
Alternating subset sums. Let's say you saw the following problem:
(CTST 2020, additional test Q3) Given a finite set of positive integers, define where denotes the least common multiple of elements in , and denote the number of prime factors of (counting multiplicity).
Prove that if , then .
This looks like it has nothing to do with PIE, unless you've written down PIE this way:
where is shorthand for .
Then, we see so many echoes from the previous proof. There is:
- an alternating sum over subsets
- the desired conclusion is to show that the quantity is between -1 and 0 (really, it is between 0 and 1 if we add in the case ) - perhaps this is a probability of sorts.
So, inspired by the "indicators" proof of the PIE, we want to cook up events such that
Notice that is really a function of , so this gives us no choice but to think prime-by-prime. In particular, each prime power dividing should contribute a factor of to the probability of . Thus, we set up the events as follows:
- For each prime power , toss a coin with probability of being heads.
- Event is the event that the coins for prime powers dividing flip heads.
- Immediately , so each term is exactly what we expect.
Sometimes, it does pay off to be unsatisfied with proofs, even if it takes years to find a resolution.
Empty indicator.
What does the "expectation of indicators" argument translate back into in set language? You'll find this proof on Wikipedia - take the perspective of a single element and count how many terms contain it. To me that feels slightly less immediate than the probabilistic interpretation, but we'll see that there's something to be gleaned here.
Let be the "set of everything". Then, we can write PIE in the slightly more natural
Now, we consider a double sum by whether each element is in these sets on the RHS:
At this stage, is only relevant if it contains only sets that contain (let's call this ). Thus, Is this sum the number of elements that are not in any ? That would also mean that we want tot detect whether . Indeed, one can check that so we're done. (Or, if you'd prefer, you can match up the odd-sized subsets and even-sized subsets, as we would do for D.I.E. counting.)
This is an indicator function for the empty set, so to some extent this makes it the "Boolean" version of Fourier analysis. A variation of this that if we knew that , then we can detect if they are equal by taking
Here's a problem that uses the mod 2 version of this:
Given a (simple) graph, a subset of its vertices is dominating if all vertices are either in or adjacent to a vertex in . Show that there must be an odd number of dominating subsets.
Here's the trick: a set is dominating if is exactly all the vertices. So, the complement of has an odd number of subsets exactly when is dominating. However, this is the same as counting pairs of subsets which are not adjacent, so this is symmetric except for the case where both subsets are equal (and thus empty), so the number of such pairs are odd.
Quadratic PIE. The insight above gives us a plausible line of attack for this problem.
(239 Olympiad 2016, Q6) Suppose that I have a union-closed finite family of finite sets, each of which has size not divisible by 3. Then there must be two elements, such that each set in the family contains one of them!
Let's bring back PIE as we've stated earlier:
By relating the size of unions and the size of intersections, we can almost perfectly capture the conditions in the statement of the problmem.
- Assume that the elements belong to the family . Then, the union also belongs to the family , and thus its size is 2 mod 3.
- On the other hand, if and together cover the entire family , then we can suppose (for contradiction) either the size of or must be zero - if neither is zero, simply selecting one element from each intersection would suffice. So we can take some kind of sum across , then each term will be zero.
We get closer to it by squaring the statement of PIE: and then we have the problem of determining whether does indeed cover everything. But here's where our "Fourier" trick comes in: if we do an alternating sum over all between and everything ( for everything), then we should kill off everything with a gap, i.e.
So putting it all together, we have
We recall that is always 2 mod 3, except when is empty. So the LHS must be 1 mod 3, a contradiction (because )!
In retrospect, this might have been one of the hardest things I've had to invent to solve a contest problem - if you just read the proof, might you have just accepted that it was impossible to come up with? But one of the things I love about math is that sometimes, we're able to gradually refine and evolve our understanding, and with the right angle of attack, for a brief glimpse even the impossible becomes possible.
Comments
Post a Comment