Let X be a finite set, X1,…,Xm subsets of X and Y=X\⋃Xi. Let gi be the characteristic function of Xi, so that
gi(x)={10 if x∈Xi otherwise
Let f:X→R be any function. By considering the expression
x∈X∑f(x)i=1∏m(1−gi(x))
or otherwise, prove the Inclusion-Exclusion Principle in the form
x∈Y∑f(x)=r≥0∑(−1)ri1<⋯<ir∑⎝⎛x∈Xi1∩⋯∩Xir∑f(x)⎠⎞
Let n>1 be an integer. For an integer m dividing n let
Xm={0≤x<n∣x≡0(modm)}
By considering the sets Xp for prime divisors p of n, show that
ϕ(n)=np∣n∏(1−p1)
(where ϕ is Euler's function) and
0<x<n(x,n)=1∑x=2n2p∣n∏(1−p1).