10.2 Two-variable examples

Example 10.6.

Consider selecting r integers from n such that no two are successive. Let these be x1<<xr. Then x11, xixi12,2ir. Setting y1=x1,yi=xixi11, yr+1=nxr+1, we have that y1,,yr+1 form a partition of nr+2. Thus the number of solutions are (nr+1r).

We now give a generating function approach. It is a 2-parameter problem. Let a(r,n) denote the number of solutions. Set a(0,0)=1. Divide the solutions into x1=1 and x1>1. If x1=1, then x23 and the rest of the sequence is from 3,,n satisfying original condition. So there are a(r1,n2) many solutions with x1=1. Now if x1>1, then xi1’s form a solution for r,n1. Thus such solutions are a(r,n1). So

a(r,n)=a(r,n1)+a(r1,n2),n2.

Easy to derive solution from this recursion too. But what about generating functions ?

Set f(x,y)=n=0r=0a(r,n)xnyr. Trivially a(0,1)=a(1,1)=1 and a(r,n)=0 if r>n and even r=n if n2. Also set a(r,n)=0 if r<0 or n<0. Thus,

f(x,y) =1+x+xy+n=2r=0a(r,n1)xnyr+n=2r=0a(r1,n2)xnyr
=1+x+xy+xn=2r=0a(r,n1)xn1yr+x2yn=2r=0a(r1,n2)xn2yr1
=1+x+xy+x(f(x,y)1)+x2yf(x,y).

This gives that f(x,y)=1+xy1xx2y.

Example 10.7.

Let an be the number of horizontally convex (HC) polyominoes of area n. This consists of layers of squares such that successive layers overlap with n squares in total. Let an be the number of n-HC polyominoes.

Let a(m,n) be number of HC polyominoes with m cells at the bottom. Then a(n,n)=1, a(m,n)=0 for n<m and a(m,0)=0. Suppose there are l cells in the second layer, there are (m+l1)-ways in which these cells can be placed on top of the first layer such that they overlap. This reasoning gives rise to the following recursion.

a(m,n)=l=1(m+l1)a(l,nm),n>m.

Define F(x,y)=m,nam,nxnym. Then F(x,1)=f(x). Set g(x)=m,nmam,nxn=(Fy)y=1. Thus we derive that

n>m,lla(l,nm)xnym =m(xy)mn,llal,nmxnm=xy1xyg(x);
n>m,l(m1)a(l,nm)xnym =m(m1)(xy)mn,llal,nmxnm=m(m1)(xy)mf(x)=(xy)2(1xy)2f(x)

So

F(x,y)=nan,n(xy)n+n>man,mxnym=xy1xy+(xy)2(1xy)2f(x)+xy1xyg(x).

Differentiating w.r.t. y and taking y=1 gives,

g(x)=x(1x)2+2x2(1x)3f(x)+x(1x)2g(x).

Find g(x) and substitute in F(x,y) and set y=1. Then we derive that

f(x)=x(1x)315x+7x24x3.

Thus (15x+7x24x3)f(x)=x(1x)3. Matching up coefficients of xn for n5 on both sides, we have

an5an1+7an24an3=0.