Docsity

Ordinary Generating Functions: Formula and Applications - Prof. Junping Shi, Study notes of Algebra

Toggle sidebar
bg1
Ordinary Generating Functions
The ordinary generating function (OGF) for a series ¡a¿ of complex numbers
is the formal power series P∞
n=0 anxn. When ancounts the objects in a universe A
for which an index parameter Xhas value n, we say that the generating function is
indexed by X.
•anbe the number of binary lists of length n. Then the OGF is P∞
n=0 2nxn,
which is indexed by length of binary lists.
•Consider k-subsets of an n-set. Then An(x) = Pn
k=0 n
kxk, is indexed by size
of subsets of [n].
Given two formal power series P∞
n=0 anxnand P∞
n=0 bnxn, the sum and product (or
convolution) is defined as follows, respectively:
sum :
∞
X
n=0
(an+bn)xn,product :
∞
X
n=0
n
X
j=0
ajbn−jxn.
Define A(x)−1to be B(x) such that A(x)B(x)=1=1x0+ 0x1+ 0x2+. . .. Then
we may show that A(x) has a multiplication inverse if [x0]A(x)6= 0.
Examples:
(1) Multisets from two types of objects. the OGF is
∞
X
k=0
(k+ 1)xk= (
∞
X
k=0
xk)2.
(2) Multisets (selections with repetition. let dkbe the number of multisets of size k
from ntypes of objects. Then the OGF is
X
k≥0
dkxk= (X
k≥0
xk)n=X
k≥0k+n−1
n−1xk.
(3) Multisets with restricted multiplicities. When Sis the set of multiplicities al-
lowed for a type of objects, the generating function for that factor is Pk∈Sxk.
•When no restriction for multiplicity, then the OGF is Pk≥0xk= (1−x)−1.
•For ordinary subsets, S={0,1}, then the OGF is (1 + x)n.
•When each type must be used, the OGF is x+x2+x3+. . . =x(1 −x)−1.
•When the usage for a type must be even, the factor for it is x2+x4+. . . =
(1 −x2)−1.
1
pf3
pf4

Partial preview of the text

Download Ordinary Generating Functions: Formula and Applications - Prof. Junping Shi and more Study notes Algebra in PDF only on Docsity!

Ordinary Generating Functions

The ordinary generating function (OGF) for a series ¡a¿ of complex numbers is the formal power series

n=0 anxn.^ When^ an^ counts the objects in a universe^ A for which an index parameter X has value n, we say that the generating function is indexed by X.

  • an be the number of binary lists of length n. Then the OGF is

n=0 2 nxn, which is indexed by length of binary lists.

  • Consider k-subsets of an n-set. Then An(x) =

∑n k=

(n k

xk, is indexed by size of subsets of [n]. Given two formal power series

n=0 anxn^ and^

n=0 bnxn, the sum and product (or convolution) is defined as follows, respectively:

sum :

∑^ ∞

n=

(an + bn)xn, product :

∑^ ∞

n=

( ∑n j=

aj bn−j

xn.

Define A(x)−^1 to be B(x) such that A(x)B(x) = 1 = 1x^0 + 0x^1 + 0x^2 +.. .. Then we may show that A(x) has a multiplication inverse if [x^0 ]A(x) 6 = 0. Examples: (1) Multisets from two types of objects. the OGF is ∑^ ∞

k=

(k + 1)xk^ = (

∑^ ∞

k=

xk)^2.

(2) Multisets (selections with repetition. let dk be the number of multisets of size k from n types of objects. Then the OGF is ∑

k≥ 0

dkxk^ = (

k≥ 0

xk)n^ =

k≥ 0

k + n − 1 n − 1

xk.

(3) Multisets with restricted multiplicities. When S is the set of multiplicities al- lowed for a type of objects, the generating function for that factor is

k∈S x k.

  • When no restriction for multiplicity, then the OGF is

k≥ 0 x k (^) = (1 − x)− (^1).

  • For ordinary subsets, S = { 0 , 1 }, then the OGF is (1 + x)n.
  • When each type must be used, the OGF is x + x^2 + x^3 +... = x(1 − x)−^1.
  • When the usage for a type must be even, the factor for it is x^2 + x^4 +... = (1 − x^2 )−^1.

1

In how many ways can one pick 20 coins that are pennies, nickels, or dimes, with at least three nickels and at most four dimes.

Solution: the number is [x^20 ](1 − x)−^1 (x^3 + x^4 +.. .)(1 + x + x^2 + x^3 + x^4 ).

We may operate on the OGFs and on the expansions without losing equality. This may allow us to use OGF to prove something pleasantly. Some basic propositions: (1) shifting the index. ∑

k≥ 0

k r

xk^ =

k≥r

xk^ =

k≥ 0

k + r r

xk+r^ = xr (1 − x)r+^

Let A, B, C be are the OGFs for < a >, < b >, < c >, respectively, then (2) cn = an + bn for all n if and only if C(x) = A(x) + B(x). (3) cn = ∑n i=0 aibn−i^ for all^ n^ iff^ C(x) =^ A(x)B(x).

(4) bn =

an−k, for n ≥ k 0 , for n < k

if and only if B(x) = xkA(x).

(5) cn =

∑n i=0 ai^ for all^ i^ if and only if^ C(x) =^

A(x) 1 −x.

(6) bn =

an for n even 0 for n odd

if and only if B(x) = 0.5(A(x) + A(−x)).

(7) bn =

0 , for n even an, for n odd

if and only if B(x) = 0.5(A(x) − A(−x)).

(8) bn =

ak, for n = mk 0 , otherwise

if and only if B(x) = A(xm).

(9) bn = nan if and only if B(x) = xA′(x).

Examples:

k

(n k

= n 2 n−^1. The sum is the value at x = 1 after differentiating

∑ (n k

xk.

∑ (n 2 i

The sum is the value at x = 1 of

∑ (n 2 i

x^2 i.

k≥ 0 k m. Consider

k≥ 0 k mxk.

∑r k=

(m k

)( (^) n r−k

The convolution of ak =

(m k

and bk =

(n k

  • Examples: Regions among lines, again an = an− 1 + n for n ≥ 1, with a 0 = 1. From an = an− 1 + n, we have anxn^ = an− 1 xn^ + nxn, and ∑

n≥ 1

anxn^ =

n≥ 1

an− 1 xn^ +

n≥ 1

nxn.

Let A(x) =

n≥ 0 anx n, then ∑ n≥ 1 anx n (^) = A(x) − 1 and ∑ n≥ 1 an−^1 x n (^) = xA(x). Note that

n≥ 1 nx n (^) = x ∑ n≥ 1 nx n− (^1) = x d dx (

n≥ 0 x n) = x d dx ((1−x)

Therefore A(x) − 1 = xA(x) + x(1 − x)−^2 , and A(x) = (1 − x)−^1 + x(1 − x)−^3. We get an = [xn]A(x).

  • Lemma: (1 − x)−n^ =

∑^ ∞

k=

k + n − 1 n − 1

xk.

  • Theorem: Let α 1 ,... , αr be distinct numbers satisfying the following equation for complex numbers c 1 ,... , ck with xk 6 = 0

Q(x) = 1 − c 1 x − c 2 x^2 −... − ckxk^ =

∏^ r

i=

(1 − αix)di^.

Then the following are equivalent for a sequence < a >. (1) < a > satisfies the recurrence an = c 1 an− 1 +... + ckan−k for n ≥ k. (2) < a > has generating function P (x)/Q(x) for some polynomial P of degree less than k. (3) < a > has generating function

∑r i=1 Fi(x)(1^ −^ αix) −di (^) , where each Fi is a polynomial of degree less than di. (4) an for n ≥ 0 is given by the formula an =

∑r i=1 Pi(n)α n i , where each^ Pi^ is a polynomial of degree less than di.

  • More examples: (1) Solve an = 4an− 1 − 5 an− 2 + 2an− 3 for n ≥ 3, with (a 0 , a 1 , a 2 ) = (2, 4 , 7).

(2) Solve an = 5an− 1 − 6 an− 2 + 2n^2 − n + 2n^ for n ≥ 2, with a 0 = a 1 = 1.

(3) Solve an =

∑n k=1 ak−^1 an−k^ for^ n^ ≥^ 1, with^ a^0 = 1.