Generalised Inclusion-Exclusion over Set
For 2 Intersecting Set A and B:
For 3 Intersecting Set A, B and C:
For N Intersecting Sets: From above formulations we can clearly observe a pattern where odd combinations of set gets added while even Combination of Set gets Subtracted. This can be used to generalize our idea of inclusion and exclusion over a wide range of sets where:
- Get All combinations of sets i.e. all (2^N-1)
- Add the ones which have odd number of sets.
- Subtract the ones which have even number of sets.