Discrete-math 18

Discrete-math 18

Even and Odd numbers amount #lemma

Let nNE={X[n]| |X| is even}O={X[n]| |X| is odd}Then |E|=|O|Proof:How to choose a subset of even size:1.Choose any subset of [n1]. Number of ways to do it is 2n12.If the size of the chosen subset is even, we are done. If it’s odd, we add n to the subset|E|=2n11=2n1OE=OE=P([n])|OE|=|O|+|E||OE||O|=|P([n])||E|=2n2n1=2n1|E|=|O|

Alternating binomial sum #lemma

nN:k=0n(1)k(nk)=0Proof (combinatorial):k=0n(1)k(nk)=k=0n/2(n2k)Number of subsets of even sizek=1n/2(n2k1)Number of subsets of odd size=0Proof (algebraic):x,yR:x0y:(x+y)n=k=0n(nk)xkynkLet x=1,y=1(1+1)n=k=0n(nk)(1)k1nk=k=0n(nk)(1)kk=0n(1)k(nk)=0

Captain's identity #lemma

nN:k=0nk(nk)=n2n1Proof (combinatorial):X ways how to choose a team:1.Choose a captain from n players2.Choose a subset of left players to join the captainX=n2n1Y ways to choose a team:1.Choose a subset of k players from n players2.Choose one of the players in the team to be captainY=k=0n(nk)kX=Yk=0nk(nk)=n2n1Proof (algebraic):k(nk)=n(n1k1)k=0nk(nk)=k=1nn(n1k1)=nk=1n(n1k1)=t=k1nt=0n1(n1t)=n2n1Proof (calculus):x,yR:x0y:(x+y)n=k=0n(nk)xkynkLet y=1(x+1)n=k=0n(nk)xkLet’s differentiate both sides:n(x+1)n1=k=0nk(nk)xk1Let x=1n2n1=k=0nk(nk)

Catalan numbers #definition

Lattice paths

Moves right or up, how many ways there are to get from (0,0) to (n,n)n moves upn moves rightTotal of 2n movesNumber of paths is the number of ways to choose n steps up from 2n steps totalNumber of paths is (2nn)

"Good" lattice paths

Each step in path satisfies xyAny "bad" path goes through the line y=x+1Every "bad" path can be represented as an "inversed" Lattice path from (1,1)Number of "bad" paths is (2nn1)Number of "good" paths is (2nn)(2nn1)=(2n)!n!n!(2n)!(n+1)!(n1)!=(2n)!n!n!(2n)!n!n!nn+1=n+1nn+1(2nn)=1n+1(2nn)

Catalan n-th number

nN:Cn=1n+1(2nn)

Example

How many balanced sequences of 2n brackets are there?Balanced sequence of brackets is:1.For any prefix #[#]2.For the whole sequence #[=#]Let [ be a step to the rightLet ] be a step upNumber of balanced bracket sequences is a number of "good" Lattice pathsfrom (0,0) to (n,n)Which is equal to n-th Catalan numberCn=1n+1(2nn)