Discrete-math 19

Discrete-math 19

Inclusion-Exclusion Principle #definition

Let A1,,An be finite setsThen |i=1nAi|=k=1n(1)k1B[n]|B|=k|jBAj|==k=1n(1)k11i1<i2<<ikn|Ai1Ai2Aik|Proof:Let xULet m be a number of sets which contain xLet m=0{xi=1nAik[n]:B[n],|B|=k:xjBAjx is counted zero times on both sidesLet m>0xAi1,Ai2,,AimLet D={i[n]|xAi}|D|=mxi=1nAix is counted once on the left sideBD:xjBAjBD:x is counted zero times on the right sideTotal contribution of x to the sum on the right side:k=1m(1)k1BD|B|=k1=k=1m(1)k1(mk)=k=1m(1)k(mk)=1k=0m(1)k(mk)==10=1xU:x is counted the same number of times on both sidesProved

Special case

If k[n]:sizes of intersection of any k sets are equal to αkThen |i=1nAi|=k=1n(1)k1B[n]|B|=kαk=k=1n(1)k1αk(nk)

Example

How many numbers from [1000] can be divided by at least one of numbers: 2,3,5?Solution:Let A2={n[1000]|2n}Let A3={n[1000]|3n}Let A5={n[1000]|5n}|A2A3A5|=|A2|+|A3|+|A5|k=1(|A2A3|+|A2A5|+|A3A5|)k=2++|A2A3A5|k=3=|A2|=10002=500|A3|=10003=333|A5|=10005=200|A2A3|=100023=166|A2A5|=100025=100|A3A5|=100035=66|A2A3A5|=1000235=33|A2A3A5|=500+333+20016610066+33=734

Example

Let n,mNWhat is the number of surjective functions f:[n][m]?Solution:Let m>n|[n]|<|[m]|Number of surjective functions is zeroLet mn|[m][n]|=mnLet’s count the number of functions that are not surjectiveLet i[m]:Ai={f:[n][m]|iIm(f)}f(1)[m]{i}f(2)[m]{i}f(n)[m]{i}i[m]:|Ai|=(m1)n1i1<i2<<ikm:|Ai1Ai2Aikf:[n][m]:i1,i2,,ikIm(f)|Im(f)|=mk|=(mk)n|i[m]Ai|=k=1m(1)k1(mk)n(mk)Number of surjective functions is equal to:mn|i[m]Ai|=mnk=1m(1)k1(mk)n(mk)

Pigeon hole principle #theorem

If there are n pigeons and n1 pigeon holesthen there are at least 2 pigeons in one of the holesProof: