Sie sind auf Seite 1von 49

Math 3012: Applied Combinatorics notes

Alex Whitney
June 29, 2007

Contents
1

.
.
.
.
.

2
2
2
2
3
3

.
.
.
.
.

5
5
5
5
6
6

May 19, 2007


3.1 Combinations and Permutations with Repetition . . . . . . .

7
7

May 21, 2007


4.1 Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Division Algorithm . . . . . . . . . . . . . . . . . . . . . . . .

9
9
10

May 23, 2007


12
5.1 Division Algorithm (continued) . . . . . . . . . . . . . . . . . 12
5.2 Euclidean Algorithm . . . . . . . . . . . . . . . . . . . . . . . 12
5.3 Additional Proofs . . . . . . . . . . . . . . . . . . . . . . . . . 13

May 25, 2007


15
6.1 Cartesian (cross) Product . . . . . . . . . . . . . . . . . . . . . 15

May 14, 2007


1.1 Introductory Notes . . . . . . . .
1.2 Fundamental Rules of Counting
1.2.1 The Rule of Sums . . . . .
1.2.2 The Rule of Products . . .
1.3 Permutations . . . . . . . . . . .
May 16, 2007
2.1 Combinations . . . . . . . . . .
2.1.1 Binomial Coefficient . .
2.1.2 Multinomial Coefficient
2.2 Binomial Theorem . . . . . . .
2.3 Multinomial Theorem . . . . .

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

CONTENTS
6.2
6.3

6.4
6.5

Relations . . . . . . . . . . . .
Functions (Mapping) . . . . .
6.3.1 One-to-One (Injective)
6.3.2 Onto functions . . . .
Bijection . . . . . . . . . . . .
Pigeonhole Principle . . . . .

2
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

15
16
16
16
16
17

May 30, 2007


18
7.1 Principle of Inclusion and Exclusion . . . . . . . . . . . . . . 18
7.1.1 Set Notation . . . . . . . . . . . . . . . . . . . . . . . . 18
7.2 June 1, 2007 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

June 4, 2007
8.1 Derangements Continued . . .
8.2 Rook Polynomials . . . . . . . .
8.3 Mathematical Definition . . . .
8.4 Computing Rook Polynomials .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

20
20
20
21
21

June 6, 2007
22
9.1 Arrangements with Forbidden Positions . . . . . . . . . . . . 22

10 June 13, 2007 (Reformat)


24
10.1 Introduction to Generating Functions . . . . . . . . . . . . . 24
10.2 Formulas for Series . . . . . . . . . . . . . . . . . . . . . . . . 26
11 June 15, 2007 (Reformat)
27
11.1 Partial Fraction Decomposition . . . . . . . . . . . . . . . . . 27
11.2 Application of Partial Fractions . . . . . . . . . . . . . . . . . 28
12 May 18, 2007
30
12.1 Exponential Generating Functions . . . . . . . . . . . . . . . 30
12.2 More Infinite Series Formulas . . . . . . . . . . . . . . . . . . 31
13 June 20, 2007
32
13.1 The Summation Operation . . . . . . . . . . . . . . . . . . . . 32
14 June 22, 2007 (Reformat)
35
14.1 Recurrence Relations . . . . . . . . . . . . . . . . . . . . . . . 35
14.2 Non-Constant Recurrence Relations . . . . . . . . . . . . . . 37

CONTENTS
14.3 ??? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3
37

15 June 25, 2007 (Reformat)


39
15.1 Second Order Linear Constant Coefficient Recurrence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
16 June 27, 2007 (reformat)
41
16.1 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
16.2 Non-Homogeneous Recurrence Relations . . . . . . . . . . . 41
16.2.1 Steps to solving a non-homogeneous recurrence relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
17 June 29, 2007 (reformat)
45
17.1 Combining Generating Functions and Recurrence Relations 45
17.2 Using Generating Functions to Problems We Cant Already
Solve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
17.3 Additional Formulas . . . . . . . . . . . . . . . . . . . . . . . 46

Lecture 1
May 14, 2007
1.1

Introductory Notes

Formula sheets are allowed on exams, but no calculators


Test one covers chapters 1, 4, 5, and 8 (Basic Counting Methods)
Test two covers chapters 9, 10, and 11 (Advanced Counting Methods,
basic graph theory)
The final covers 12 and 13, in addition to the previous materials
(Optimization on Graph theory)

1.2
1.2.1

Fundamental Rules of Counting


The Rule of Sums

Rule of Sums If the possible outcomes of A can be divided into two disjoint sets, B and C, then |A| = |B| + |C|.
Example 1.2.1. There are two barrels of apples. The first barrel has 10 apples,
and the second barrel has 8 apples. A person walks by and selects an apple from a
barrel. How many different apples could the person have selected?
Solution The apples in each barrel are disjoint - that is to say that any
apple in the first barrel cannot be in the second barrel and vice versa. The
4

LECTURE 1. MAY 14, 2007

problem can be split into two parts. The first part is the number of different
apples the person could select from the first barrel, and the second part
is the number of different apples the person could select from the second
barrel.
Part 1:
10 different apples
Part 2:
8 different apples
By the rule of sums, the total number of different apples the person could
have selected is 10 + 8 = 18.

1.2.2

The Rule of Products

Rule of Products If the possible outcomes of A can be performed in two


independent stages, B and C, then |A| = |B| |C|.
Example 1.2.2. A six sided die is rolled and the result is recorded. The die is then
rolled again and the new result recorded. Find the number of outcomes for this
procedure.
Solution There procedure is performed in two stages: rolling the die
the first time and rolling the die the second time. The result of the first
stage has no effect on the result of the second stage, so the two stages are
independent.
Part 1:
Stage 1:
6 results
Stage 2:
6 results
By the rule of products, the number of results for the given procedure is
6 6 = 36.

1.3

Permutations

Permutation Given n distinct objects, any linear arrangement of the objects


is called a permutation of the n objects.

LECTURE 1. MAY 14, 2007

Example 1.3.1. A coin is flipped and the result is recorded. The coin is flipped
again and the result recorded. List all of the permutations for this procedure.
Solution
{HH}, {HT}, {TH}, {TT}
r-permutations of n The number of permutations of all subsets of r objects
from a set of n distinct objects is given by the equation:
P(n,r) =

n!
(n r)!

Lecture 2
May 16, 2007
2.1

Combinations

r-combinations of n An r-combination of n objects is a subset of r distinct


objects from n.
Example 2.1.1. List all of the possible 2-combinations of {1, 2, 3}.
Solution
{1, 2}, {1, 3}, {2, 3}

2.1.1

Binomial Coefficient

Theorem 2.1.1. Binomial Coefficient. The number of r-combinations of n distinct objects is equal to:
!
n
n!
=
r!(n r)!
r

2.1.2

Multinomial Coefficient

Theorem 2.1.2. Multinomial Coefficient. Given n objects from k classes, if the


objects in each class are identical, then the number of unique permutations of n is
equal to:
7

LECTURE 2. MAY 16, 2007

n!
n
=
n1 !n2 ! . . . nk !
n1 , n2 , . . . , nk

Example 2.1.2. Find the number of unique permutations of the letters in CALCULATOR
Solution
10!
10!
= 3
2!2!2!
2

2.2

Binomial Theorem

Theorem 2.2.1. Binomial Theorem


!
n
X
n k nk
(x + y) =
xy
k
n

k=0

2.3

Multinomial Theorem

Theorem 2.3.1. Multinomial Theorem


(x1 + x2 + . . . + xk ) =
n

X
n1 +n2 +...+n3 =n

!
n
xn1 xn2 . . . xnk k
n1 , n2 , . . . , nk 1 2

Lecture 3
May 19, 2007
3.1

Combinations and Permutations with Repetition

Example 3.1.1. Give the number of combinations of 5 objects from {s1 , s2 , s3 },


with replacement.
Solution There are 3 classes and we are selecting 5 objects. We can represent any given combination by using a notation of crosses and bars1 .
For example,
**|***|
would indicate that there are two objects from the first class, three objects
from the second class, and zero objects from the third class. Looking at a
combination in this manner, there are seven possible positions for either
a star or a bar. In order to create a combination, we only need to fix the
positions of bars or stars. Since there are 5 + 3 1 = 7 positions and we are
fixing 3 1 = 2 bars, there are a total of 72 combinations.
This can be applied to a general case.
Theorem 3.1.1. The number of combinations of n objects from r classes is equal
to:
1

I have also heard this called stars and bars and balls and buckets

LECTURE 3. MAY 19, 2007

10
n+r1
r1

Example 3.1.2. Find the number of combinations of 10 objects selected from 3


classes, with at most two objects from the first class.
Solution
!
!
11
10 + 2 1
=
= 11
Number in first class: 0:
1!
21 !
9+21
10
1:
=
= 10
21 !
1!
9
8+21
=9
=
2:
1
21
By the rule of sums, the number of combinations of 10 objets from three
classes is 11 + 10 + 9 = 30.
Example 3.1.3. Find the number of non-negative integer solutions to x1 +x2 +x3 =
10, x1 2.
Solution The solution to Example 3.1.3 is the same as the solution to Example 3.1.2. If x1 , x2 , x3 are the classes, then we are selecting 10 objects from
the three classes with at most 2 selections from the first class. Therefore,
the answer is 30.

Lecture 4
May 21, 2007
4.1

Induction

The principle of induction is used to prove a claim for all values greater
than or equal to a base case. Many mathematical principles can be proven
with induction.
Weak Principle of Induction To prove S(n), first prove S(n) for a base case
n0 . Assume S(k) holds for all k, then show that S(k + 1) holds. If S(n0 ) and
S(k + 1) hold, then S(n) holds for all n.
Example 4.1.1. Prove 0 + 1 + 2 + 3 + . . . + n =

n(n+1)
2

using induction.

Solution
Proof by induction.
Hypothesis: S(k) = 0 + 1 + 2 + 3 + . . . + k =

k(k+1)
,
2

k0

Base: n = 0
0(0+1)
0= 2
=0
Step: n = k + 1
(k + 1)(k + 1 + 1)
= 0 + 1 + 2 + 3 + . . . + k + (k + 1)
2
k(k + 1)
=
+ (k + 1)
2
11

LECTURE 4. MAY 21, 2007

12

k(k + 1) 2(k + 1)
+
2
2
k(k + 1) + 2(k + 1)
=
2
(k + 1)(k + 1 + 1)
=
2

By induction, 0 + 1 + 2 + 3 + . . . + n =

n(n+1)
,
2

n0

Strong Principle of Induction To prove S(n), first prove S(n) for a base
case n0 . Assume S(k) holds for all values between n0 and k, then show that
S(k + 1) holds. If S(n0 ) and S(k + 1) hold, then S(n) holds for all n.
Example 4.1.2. Prove that every integer n 2 is a product of primes
Solution
Proof by induction.
Hypothesis: P(n) = pq = n, where p, q are prime and k n 2, n Z
Base: n = 2
P(2) = 2 1 = 2
Step: P(k + 1) = pq
If k + 1 is prime, then k + 1 is a product of primes.
If k + 1 is not prime,
k + 1 = pq,
where 2 (p, q) k. p and q are product of primes, so pq
is a product of primes.
By induction, n is a product of primes n 2

4.2

Division Algorithm

b divides a Given a, b Z and b , 0, then b | a if a = mb, where m Z.


If this is true, then it is said that b divides a.
Lemma 4.2.1. If b | a and c | b, then c | a.

LECTURE 4. MAY 21, 2007

13

Proof
Since b | a, m Z such that a = mb
Since c | b, n Z such that b = nc
Therefore, a = m(nc) = (mn)a, so c | a.

Theorem 4.2.2. Division Algorithm. a, b Z with b > 0, q, r Z such


that a = q b + r with 0 r b.

Lecture 5
May 23, 2007
5.1

Division Algorithm (continued)

Theorem 5.1.1. For a given a, b Z, b > 0, a unique q, r Z such that:


a = qb + r, 0 r < b

5.2

Euclidean Algorithm

Used to find the greatest common divisors (GCD) of two given integers.
Common Divisors c is a common divisor of a and b if c | a and c | b, where
c , 0.
GCD c > 0 is the greatest common divisor (GCD) of a and b if c is a
common divisor of both a and B, and d | a, d | b d | c.
If c is a GCD of a and b, then it can be written that c = gcd(a, b).
gcd(a, 0) = |a|, a , 0
Theorem 5.2.1. a, b Z+ , a unique c Z+ such that c = gcd(a, b).
Proof S = {sa + tb > 0 | s, t Z}
Take a value c S which is the smallest element in S. This value is
unique.
c = sa + tb for some s, t Z
If d | a and d | b, then d | sa and d | tb, so d | (sa + tb), d | c
Suppose c - a, then
14

LECTURE 5. MAY 23, 2007

15

a = qc + r, 0 < r < c (by division alg.)


r = a qc
r = a q(sa + tb)
r = (1 qs)a + (qt)b
r = s0 a + t0 b
Contradiction 
rS
Theorem 5.2.2. Euclidean Algorithm. Given a, b Z,
Let r0 = a, r1 = b
ri = qri+1 + ri+2 , 0 ri+2 < ri+1
gcd(ri , ri+1 ) = gcd(ri+1 , ri+2 )
This process is repeated until rk+2 = 0.
Work backwards until you get back to gcd(a, b).
Example 5.2.1. Find the G.C.D. of 1024 and 28. Find s, t so that gcd(1024, 28) =
1024s + 28t.
Solution
1024 = 36 28 + 16
28 = 1 16 + 12
16 = 1 12 + 4
12 = 3 4 + 0
gcd(1024, 28) = 4
4 = 16 1 12
4 = 16 1 (28 1 16)
4 = 2 (128 36 28) 1 28

5.3

Additional Proofs

Lemma 5.3.1. If a, b Z+ and p is prime, then p | ab if and only if p | a or p | b.


Proof If p | a, then p | ab. If p - a, then gcd(p, a) = 1 and s, t Z such that
1 = sp + ta.
b = spb + tab
Since p | spb and p | tab, then p | b


LECTURE 5. MAY 23, 2007

16

Lemma 5.3.2. If a1 , . . . an Z+ and p is prime, then p | (a1 . . . an if p | a1 or


p | a2 or . . . or p | an .
Proof By induction.
Hypothesis: S(k) = above. True k 1.
Base: S(1) : p | a.
p | a if p | a.
Step: p | a1 . . . ak+1 p | (a1 . . . ak )(ak+1 )
Proved by lemma 5.3.1
Theorem 5.3.3. Any integer n 1 can be written as a product of unique primes.
Proof Uniqueness.
n = p1 1 + p2 2 + . . . + pnn

n = q11 + q22 + . . . + qnn

If p1 | p1 1 + p2 2 + . . . + pnn , then p1 | q11 + q22 + . . . + qnn . By Lemma 5.3.1,


we can assume without loss of generality that p1 | q1 . Since p1 and q1 are
prime, then p1 = q1 .

p2 2 + . . . + pnn = q22 + . . . + qnn


Continuing with the application of Lemma 5.3.1, p2 = q2 , . . . pk = qk . 

Lemma 5.3.4.

3 is irrational.

Proof Proof
bypcontradiction.
Suppose 3 = q
gcd(p, q) = 1, p, q Z.
p2
3 = q2
3q2 = p2

Lecture 6
May 25, 2007
This section is waiting a reformatting. Bijections and pigeonhole principle.
Useful for counting problems. Sometimes easier to count a set if you map
the set to something easier to count.

6.1

Cartesian (cross) Product

Cartesian Product For two sets A and B, the Cartesian product, or crossproduct, of A and B is defined as A (cross) B = {(a, b)|a A, b B}
Example 6.1.1. A = {1, 2, 3}, B = {a, b}
A(cross)B = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b)}.
Example 6.1.2. R(cross)R = R2 = {(x, y)|x, y R},
Which is the Cartesian Plane.
The cross product can easily be defined in n sets.
Example 6.1.3. Rn = R(cross)R(cross) . . . (cross)R.

6.2

Relations

Relation For sets A and B, any subset of A(cross)B is said to be a relation


from A to B.
By definition, the cross product of A and B is a relation from A to B.
Example 6.2.1. {(1, a), (a, b)} is a relation from A to B from Example 6.1.1.
17

LECTURE 6. MAY 25, 2007

6.3

18

Functions (Mapping)

Function For any non-empty sets A, B, a function (or mapping) from A to


B is a relation from A to B such that every element of A occurs in exactly
one ordered pair in the relation. A function is written as:
f : A B, where A is the the domain and f (B) is the range.
Example 6.3.1. Is the relation in Example 6.2.1 a function? No, because 3 does
not occur exactly once in every ordered pair.

6.3.1

One-to-One (Injective)

One-to-One (Injective) A function f : A B is one-to-one if each element


of B occurs at most once in the range of f (A).
Corollary 6.3.1. If f : A B is a one-to-one function, then |A| |B|.

6.3.2

Onto functions

Onto (Surjective) A function f : A B is onto if every element of B must


occur exactly once in f (A).
Corollary 6.3.2. If f : A B is an onto function, then |A| |B|.

6.4

Bijection

Bijection A function f : A B is a bijection if and only if it is both


one-to-one and onto.
Example 6.4.1. The number of subsets of {1, . . . , n} = 2n .
Solution Let A = {subsets of {1, . . . , n} and B = {binary sequences of length
n}.
{1}
{1, 3}

10 . . . 0
1010 . . . 0
..
.

LECTURE 6. MAY 25, 2007

19

The numbers in the set on the left represent the positions in the binary
sequence where a 1 exists. Therefore, this mapping is both one-to-one and
onto, so it is a bijection and |A| = |B|. Since |B| = 2n , then |A| = 2n


6.5

Pigeonhole Principle

Pigeonhole Principle If m pigeons occupy n pigeonholes, and m > n, then


at least one pigeonhole is occupied by at least two pigeons.
Example 6.5.1. Among any 15 integers, prove that there are at least two with the
same remainder when divided by 14.
Proof Let B be the possible remainders are the set given by n mod 14,
which are {0, 1, . . . , 13}. Because |B| = 14, by the pigeonhole principle there
must be at least two integers from any given set of 15 integers that have
the same remainder when divided by 14.

Example 6.5.2. Let m Z+ where m is odd. Prove there exists a positive integer
n such that m | 2n 1.
Proof Let A = {21 1, 22 1, . . . , 2m+1 1}. |A| = m + 1. Let B = n mod m.
|B| = m. By the pigeonhole principle, at least two elements of A have the
same remainder when divided by m.
Given two integers A, 2i 1 and 2 j 1, i < j. m | (2 j 1 2i + 1), so
m | 2i (2 ji 1). Since m is odd, then m - 2i , m | 2 j1 1.


Lecture 7
May 30, 2007
This day went into some really boring stuff. I didnt really feel the need to
take notes.
Definition |A B| = |A| + |B| |A B|

7.1
7.1.1

Principle of Inclusion and Exclusion


Set Notation

S is a set.
|S| = n
c1 , . . . , ct are properties of elements of S.
N(ci ) = |ci | = number of elements of S satisfying the property ci
N(c1 , c2 ) = |c1 c2 | = number of elements of S satisfying the properties
of both c1 and c2 .
This is stupid. Its clear that ck is a subset, but he wont call it a subset.
Instead, he calls them properties. And instead of sticking to cardinality
(the |S| notation), he creates this new notation of N(S). It just adds abstraction when you have multiple sets in the N(), like N(S, T). What is the
relation between S and T? Well, if S,T are independent, then its just 0.
Otherwise its |S T|.
N(c1 , c2 , . . . , ct = number of elements of S not satisfying c1 c2 . . . ck .
Why does he do that, but then throw around terms like union?
Test Friday, June 8th.
20

LECTURE 7. MAY 30, 2007

7.2

June 1, 2007

This lecture needs a reformatting


The principle of inclusion/exclusion should be easy. . .

21

Lecture 8
June 4, 2007
reformat me, please

8.1

Derangements Continued

Example 8.1.1. Given (1, 2, . . . , n), how many derangements are there?
Solution Let S = {arrangementso f (1, 2, . . . , n)}
c1 = a 1 in the first position.
c2 = a 2 in the second position.
Etc.
N(c1 , . . . , cn ) = S0 S1 + . . . + (1)n Sn
S0 = n!
!
n
X
n
S1 =
N(ci ) =
(n 1)!
1
i=1
!
X
n
S2 =
N(ci , c j ) =
(n 2)!
2
Etc.
n
X
(1)k n!
N(c1 , . . . , c2 ) =
k!
k=0

8.2

Rook Polynomials

Definition A chessboard is a sub board of any grid.


22

LECTURE 8. JUNE 4, 2007

23

Rook Number Let C be a chessboard, and k > 0 be an integer. Refine rk (C),


the kth rank number of C, as the number of ways to put k nontaking rooks
on C.
Example 8.2.1. Let C = {((1, 0), (2, 0), (0, 1), (0, 2), (1, 2), (2, 2)}.
r0 (C) = 1
r1 (C) = 6
r2 (C) = 2 + 2 + 2 + 2 = 8
r3 (C) = 1 + 1 = 2
r4 (C) = 0
Rook Polynomial r(C, x) = r0 (C) + r1 (C)x + r2 (C)x2 + . . . + rk (C)xk + . . .
The rook polynomial of C.

8.3

Mathematical Definition

Im a bit tired of these simplified explanations. I looked up the definition


for rook numbers on Mathworld and it makes a heck of a lot more sense.
Rook Number The rook numbers r(k (m, n)) of an mxn board are the number
of subsets of size k such that no two elements have the same first or second
coordinate.
Its clear (to me at least) how this applies to what he is explaining.

8.4

Computing Rook Polynomials

Theorem 8.4.1. If a chessboard C consists of two disjoint subboards C1 and C2 ,


then:
r( C, x) = r(C1 , x)r(C2 , x)
Solution Rule of products. Duh.
Theorem 8.4.2. Let C be a chess board and select an element ?. Let Cs be the
set of squares in C that do not share a component with ?. Let Ce be the set of C,
minus ?. Then,
r(C, x) = xr(Cs , x) + r(Ce , x)

Lecture 9
June 6, 2007
Reformat. Blah. Its cold

9.1

Arrangements with Forbidden Positions

Example 9.1.1. Suppose there are three people, R1 , R2 , R3 , and R4 . They are to be
seated at five tables, T1 , T2 , T3 , T4 , and T5 . Each person is seated at his or her own
table. T1 does not want to be seated at T1 or T2 . R2 does not want to be seated at
T2 . R3 does not want to be seated at T3 or T4 . R4 does not want to be seated at T4
or T5 .
Solution Let S be the set of seating arrangements of R1 , . . . , R4 at T1 , . . . , T2
so that no two people are seated at the same table.
Let c1 be the property that R1 is seated at T1 or T2 .
Let c2 be the property that R2 is seated at T2 .
Let C = the product of people and tables, minus the forbidden person
and table combinations.
..
.
N(c1 , c2 , c3 , c4 ) = S0 S1 + S2 S3 + S4
S0 = P
P(5, 4) = 5!
S1 = 4i=1 Nci = . . .
N(c1 ) = 2 P(4, 3)
N(c2 ) = 1 P(4, 3)
N(c3 ) = 2 P(4, 3)
N(c4 ) = 2 P(4, 3)
24

LECTURE 9. JUNE 6, 2007

25

S1 = P
(2 + 1 + 2 + 2) P(4, 3)
S2 = {i,k} N(ci , c j ) = r2 (C) P(3, 2)
S3 = r3 (C)P(2, 1)
S4 = r4 (C)P(1, 0)
To solve, you can calculate rook polynomial: r(C) = 1 + 7x + 16x2 +
13x3 + 3x4
N(c1 , . . . , c4 ) = 5! 7 4! + 15 3! 13 2! + 3 1!

Lecture 10
June 13, 2007 (Reformat)
10.1

Introduction to Generating Functions

Generating functions are designed to help solve counting problems that


are difficult to solve. So far there have been two types of problems: permutations and combinations. Similarly, there will be two types of generating
functions. Ordinary generating functions solve arrangements. Exponential generating functions solve permutations.
Example 10.1.1. Find the number of distributions of twelve identical objects to
four distinct boxes such that:
4 box1 6
3 box2 , box3 5
box4 1
Example 10.1.1 can be solved with case analysis, but there would be
many cases. Furthermore, if the upper restrictions were removed, the
solution to the example would be simple. To solve, we create a generating
function.
Solution Let xi be the number of objects in boxi , i = 1, 2, 3, 4
x1 + x2 + x3 + x4 = 12
4 x1 6
3 x2 5
3 x3 5
0 x4 1
26

LECTURE 10. JUNE 13, 2007 (REFORMAT)

27

To solve, we write polynomials whose exponents are values that the


variable can take.
g(x) = (x4 + x5 + x6 )(x3 + x4 + x5 )(x3 + x4 + x5 )(x0 + x1 )
The coefficient of x1 2 in g(x) gives the answer to the problem. By
expanding the generating function or using case analysis, you can find the
coefficient.
Generating Function Let a0 , a1 , a2 , . . . , an be a sequence of real numbers,
then
f (x) = a0 + a1 x1 + a2 x2 + . . . + an xn + . . .

X
f (x) =
ai xi
i=0

Example 10.1.2. The sequence of 1, 1, 1, . . . has an ordinary generating function

X
0
1
2
f (x) = x + x + x + . . . =
i=0

This form is not helpful, so we should simplify it. This series is a geometrix
1
.
series with a common ratio x. With |x| < 1, this series will converge to 1x
  

Example 10.1.3. The sequence n0 , n1 , n2 , . . . , nn , 0, 0, . . . has a generating function:
!
!
!
n
n
n n
f (x) =
+
x + ... +
x = (1 + x)n
0
1
n
Theorem 10.1.1.
!

X
n+ii i
1
=
x
(1 x)n
n1
i=0
Proof The number of integer solutions
to

x1 + . . . + xn = i,xk 0 is n+i1
n1
The generating function for x1 , x2 , . . . , xn is:
f (x) = (x0 + x1 + . . . + xn )n
The coefficient of xi is equal to the number of integer solutions when
the sum of the series is i. !
n
X
n+i1 i
f (x) =
x
n

1
i=0
Example 10.1.4. Find the coefficient of x3 0 in (x + x2 + . . . + x9 )1 0

LECTURE 10. JUNE 13, 2007 (REFORMAT)

28

Solution (x + x2 + . . . + x9 )1 0
9 x
( xx
)1 0
1x
(1x9 )1 0

x1 0 (1x)1 0

(1x9 )1 0

Find the coefficient of x2 0 in (1x)1 0


!
!

1
X
X
10 + i 1 i
i 10 9i
x)
x )(
0i=0 (1)
(
10

1
i
i=0


+ (1)1
coefficient of x2 0 = (1)0 100 10+201
9

10.2

Formulas for Series

X
1
=
xi
1x
i=1
n
1 xn1 X i
=
x
1x
i=0
!
n
X
n i
n
(1 + x) =
x
i
i=0
!
n
X
m n
i n mi
(1 x ) =
(1)
x
i
i=1
!

X
1
n+i1 i
=
x
(1 x)n
i
i=0

10 10+111
1
9

+ (1)2

10 10+121
2
9

Lecture 11
June 15, 2007 (Reformat)
11.1

Partial Fraction Decomposition

Example 11.1.1. Find the coefficient of x20 in


1
Solution (1) (1x)(1x
2) =

X
X
=(
xi ) (
x2i )
i=0

1
(1x)

1
(1x)(1x2 )

1
1x2

i=0

Now use case analysis. Fix the left term, then select the right term.
ile f t = 20, iright = 0
ile f t = 18, iright = 1
ile f t = 16, iright = 2
..
.ile f t = 0, iright = 10
There are 11 pairs, so the coefficient of x20 is 11.
Working with case analysis is easy when the power of x is small and
fixed, but if we were asked to find the coefficient of x2 01 or xn , it would be
much harder. In order to create an equation for the coefficient of a term,
you can use partial fractions.
Solution (2) In order to apply partial fractions, the fraction needs to be
decomposed into two parts.
1
A
+ Bx+C
= 1x
(1x)(1x2 )
1x2
The numerator of the decomposed fractions need to be polynomials of
lesser degrees. The denominator of partial fractions cannot have common
29

LECTURE 11. JUNE 15, 2007 (REFORMAT)

30

factors. The original equation can be rewritten as...


1
(1x)2 (1+x)

So the partial fraction decomposition is:


Bx+C
A
+ 1+x
(1x)2
A(1x)2 +(Bx+C)(1x)
(1x)2 (1+x)
(A+C)+(B+C2A)x+(B+a)x2
(1x)2 (1+x)

1 = (A + C) + (B + C 2A)x + (B + A)x2
1 = A + C 1 = C B 1 = 3B B 14 = B
0 = B + C 2A 0 = B + C + 2B C = 3B C = 34
0 = B + A B = A A = 14
1 1
1
x+3
4 (1+x)
4 (1x)2
Now expand the terms.

1 X i i x + 3 X
1 x +
(i + 1)xi
4 i=0
4
i=0
The coefficient of x20 is...
(1/4)(1)20 + (3/4)(21) (1/4)(20) = 11
This can be applied to the xn case, so that the coefficient of xn is:
(1/4)(1)n + (3/4)(n + 1) (1/4)n

11.2

Application of Partial Fractions

Example 11.2.1. Find the number of ways to take 100 objects from four distinct
bins of an infinite number of identical objects, such that there are an even number
of objects taken from bins one and two, and an odd number of objects taken from
bins three and four.
Solution To solve this problem, we will create a generating function for
taking n objects from the four bins. Next, we have to set up a sequence.
Let an be the number of ways to take n objects from the four bins with
the given restrictions.
The generating function, g(x), is given by the following:
g(x) = a0 + a1 x + a2 x2 + . . . an xn + . . .
g(x) = (x0 + x2 + x4 + . . .)2 (x1 + x3 + x5 + . . .)2
x 2
1 2
g(x) = ( 1x
2 ) ( 1x2 )
4

1
g(x) = x2 ( 1x
2 )

LECTURE 11. JUNE 15, 2007 (REFORMAT)

31

X
4 + i 1 2i
x
g(x) = x
41
i=0
!

X
3 + i 2i
2
x
g(x) = x
3
i=0
The number of ways to select 100 objects from 4 bins with the given
restrictions is 49+3
3
2

Lecture 12
May 18, 2007
12.1

Exponential Generating Functions

These are used to solve permutation problems.


Definition The exponential generating function for a sequence a0 , a1 , a2 , . . . , an , . . .,

X
an xn
ak xk
a0 x0 a1 x1 a2 x2
+
+
+ ... +
+ ... =
f (x) =
0!
1!
2!
n!
k!
k=0

Example 12.1.1. Given a problem about permutations, let an = the answer to the
P ak xk
problem . Find the exponential generating function f (x) =
k=0 k!
Solution

an xk
n!

an = n! (coefficient of xn ).

Example 12.1.2. Find the number of ways to arrange 100 objects from three types
such that an even number of objects are from type 1 and an odd number of objects
are from type 2.
Solution Let an denote the number of arrangements of n objects from
three type such that an even number of objects are from type 1 and an odd
number of objects are from type 2.
P ak xk
f (x) =
k=0 k!
2
1
3
0
1
x0
f (x) = ( 0! + x2! + . . .)( x1! + x3! + . . .)( x0! + x1! + . . .)
x x
x x
f (x) = e +e2 e e2 ex
f (x) = 14 ex (e2x e2x )
32

LECTURE 12. MAY 18, 2007


f (x) = 14 (e3x ex )
P 3k xk P (1)k xk
)
f (x) = 14 (
k=0 k!
k=0
k!
1
a100 = 100! 4(100!)
(3100 x100 (1)100 x( 100))
a100 = 14 (3100 1)

12.2
e =
x

More Infinite Series Formulas

X
xk

k!

k=0

nk xk
k!
k=0

ex + ex X x2k
=
2
(2k)!
k=0

ex ex X x2k+1
=
2
(2k + 1)!

enx =

k=0

33

Lecture 13
June 20, 2007
13.1

The Summation Operation

Example 13.1.1. Given a0 , a1 , a2 , . . ., find S(n) = a0 + a1 + a2 + . . . + an .


Solution Now we have a new sequence, S(0), S(1), S(2), . . . , S(n), . . .. The
generatingPfunction for the sequence is as follows:
n
g(x) =
n=0 S(n)x P
k
We can find f (x) =
k=0 ak x , which we can use to find g(x).
P
f (x)
g(x) = n=0 (a0 + a1 + . . . + an )xn = 1x
Proof

f (x)
1x

P
P
= ( nk=0 ak xk )( nk=0 xk )
So the coefficient of xn = a0 + a1 + a2 + . . . + an
??????????

Proposition 13.1.1. Let f (x) =


f (x)
Then g(x) = 1x

k=0 ak x

and g(x) =

n=0 (a0

Example 13.1.2. Find a compact formula for 1 + 2 + . . . + n.


Solution P
Set an = n. S(n)
P = ak0 + a1 + . . . + an .

k
f (x) = k=0 ak x = k=0 kx
f (x) = x + 2x2 + 3x3 + . . . + kxk + . . .
1
= 1 + x + x2 + . . . + xk + . . .
1x
Taking the derivative..
34

+ a1 + . . . + an )xn .

LECTURE 13. JUNE 20, 2007


1
(1x)2
x
(1x)2

35

= 1 + 2x + 3x2 + . . . + kxk1 + . . .
= x + 2x+ 3x+ . . . + kxk + . . .
f (x)

x
x
So, f (x) = (1x)
2 and g(x) = 1x = (1x)3
Expanding P
g(x), we get
3+i1 i
g(x) = x
i=0 31 x

So the coefficient of xn = g(x) = 3+n11
=
31

n+1
2

Example 13.1.3. Find the compact formula for 1x2 + 2x3 + 3x4 + . . . + (n 1)n
Solution P
Let ak = (k1)k, S(n) = a0 +a1 +a2 +. . .+an = 1x2+2x3+. . .+(n1)n
k
f (x) =
k=0 (k + 1)kx
f (x) = (1)(2)x2 + (2)(3)x3 + . . . + (k 1)(k)xk + . . .
1
= 1 + x + x2 + . . . + xn + . . .
1x
1
= 1 + 2x + 3x2 + . . . + kxk1 + . . .
(1x)2
2
= (1)(2) + (2)(3)x + . . . + (k 1)kxk2 + . . .
(1x)3
2x2
(1x)3

= (1)(2)x2 + (2)(3)x3 + . . . + (k 1)kxk + . . .


2x2
2x2
and g(x) = (1x
4) .
(1x)3
P 4+i1 i
2
= 2x i=0 41 x

 n(n+1)(n2)
= 2 n+1
=
= 2 4+n21
3
3
41

So f (x) =
g(x)
S(n)

Example 13.1.4. Find the compact formula for

1
1

+ 12 . . . +

1
n+1

1
Solution Let ak = k+1
,k0
1
Sn = a0 + a1 + . . . + an = 11 + 12 + k+1
P 1 k 1 1
1 k
f (x) = k=0 k+1 x = 1 + 2 x + 31 x2 + . . . + k+1
x + ...
1
2
n
= 1 + x + x + ... + x + ...
1x
Taking the integral of both sides...
2
3
k+1
ln |1 x| = x + x2 + x3 + . . . + xk+1 + . . .
2
xk
ln |1x|
= 1 + x2 + x3 + . . . + k+1
+ . . . = f (x)
x
f (x)
ln |1x|
g(x) = 1x = x(1x)
To find coefficients for xn , we would have to use Taylor series, etc.

Example 13.1.5. Find the compact formula for

1
(1)(2)

1
(2)(3)

+ ... +

Solution There is a simple trick to solve this problem easily.


1
Series = ( 11 12 ) + ( 21 13 ) + . . . + ( n1
n1 )

1
(n1)(n)

LECTURE 13. JUNE 20, 2007

36

Example 13.1.6. Sn = 13 + 23 + . . . + n3
Let ak =Pk3
3 k
f (x) = P
k=0 k x
1
= kxk1
(1x)2
Multiply by x, then take the derivative, then multiply by x, then take the derivative
again.
P
x
= kxk
(1x)2
P 2 k
x(1+x)
=
kx
3
(1x)
P 3 k1
1+4x+x2
= kx
(1x)4
P
2
3
x+4x +x
= k3 xk = f (x)
(1x)4
+x
g(x) = 1x = x+4x
(1x)5
P
5+i1 1
g(x) = (x + 4x2 + x3 )
i=0 51 x

 5+n31
+ 4 5+n21
+
Sn = 5+n11
4
4
4
n+3
n+2
n+1
Sn = 4 + 4 4 + 4
Usually we leave it alone at this point, but since we know the formula for sum of
cubes, we know that it can be simplified.
(n+3)(n+2)(n+1)n
(n+2)(n+2)n(n1)
(n+1)n(n1)(n2)
Sn =
+4
+
4!
4!
4!
n(n+1)
Sn = 4! ((n + 3)(n + 2) + 4(n + 2)(n 1) + (n 1)(n 2))
n(n+1)
Sn = 4! (6n2 + 6n)
f (x)

Sn =

(n(n+1))2
4

n2 (n1 )2
4

Lecture 14
June 22, 2007 (Reformat)
This is the first lecture with the new professor, Stephen Young.

14.1

Recurrence Relations

This will be the bulk of the test. This section will be Learn by example
for the most part.
The basic form of a recurrence relation is a function from one set to
another. Such as a : N R, where a(n + 1) = an+1 , and a0 = 5, a1 = 14, a2 =
45, etc.
Other examples:
bn = 2bn 1 n2 , b1 = 1, n 1
s2n = 3sn5 + sin(2sns ), n 0
We will focus on a few special recurrence relations and how to calculate
them without having to recurse.
Example 14.1.1. an = 2an1 + 3an2 , a0 = 1, a1 = 3
Find a general form for an .
Solution The first step is to plug in some numbers and look for a pattern.
a0 = 1
a1 = 3
a2 = 2 3 + 3 = 9
a3 = 2 27 + 3 9 = 27
a4 = 3 81 + 2 27 = 81

37

LECTURE 14. JUNE 22, 2007 (REFORMAT)

38

Noticing the pattern, an may be equal to 3n . To see if it does, we can


prove it using induction.
hypothesis: P(n) : 2an1 + 3an2 = 3n n 0
base:P(0)istrue
Assume P(k) is true for all k.
step:P(k + 1)
First Order The recurrence goes back one step. (For example, an = nan1 )
Linear The recurrence is limited to an . (Not other powers of an )
Homogeneous The recurrence does not depend on n.
Constant Coefficient All coefficients of the sequence terms are constant.
Example 14.1.2. an = can1 , n 0, a0 = A. Find a closed form function for an .
Solution a0 = A
a1 = cA
a2 = c2 A
a3 = c3 A
...
an = cn A
This can be proved using induction.
Example 14.1.3. a3n+1 = 4a3n , a0 = 5, n 0
Solution Trying to list the few outcomes for an is a headache:
a0 = 5
4
a1 = 5 3
5
a2 = 5 3
Another way to solve this without looking for a pattern is to reduce the
original equation.
Let bn = a3n , so b0 = a30 = 125
n
bn+1 = a3n+1 = 5a3n = 5bn bn = 5n+3 an = 5 5 3

Example 14.1.4. Show lim an = 2 if ln(an+1 ) = ln( an), a0 = 2, n 0.


n

(Recurrence relations are similar to differential equations. The same


methods are used.)

LECTURE 14. JUNE 22, 2007 (REFORMAT)

39

Solution Let bn = ln(an


), so b0 = ln(2)
bn+1 = ln(an+1 ) = ln( an) = 21 bn
bn = ln(2)( 12 )n
1
1
an = ebn = eln(2) e 2 n = 2e 2 n

14.2

Non-Constant Recurrence Relations

Example 14.2.1. pn+1 =

n+1
p ,n
n1 n

2, p2 = 2

Solution p3 = 3 p2 = 6 = 3(3 1)
p4 = 2 6 = 12 = 4(4 1)
p5 = 5/3 12 = 20 = 5(5 1)
p6 = 6/4 20 = 30 = 6(6 1)
..
.

pn = n(n 1)
Can be proved using induction.

14.3

???

Example 14.3.1. an+1 = 2an + 3an1 , n 0, a0 = 1, a1 = 1


Solution a2 = 2 + 3 = 1
a3 = 3 + 2 = 1
a4 = 1
..
.
an = (1)n

Example 14.3.2. Using the recurrence relation from the previous example, find
the general form for an with a0 = 2, a1 = 2
Solution a2 = 10
a3 = 26
a4 = 82
a5 = 2 82 + 3 26 = 164 + 78 = 242
an = 3n + (1)n
Inductive step:

LECTURE 14. JUNE 22, 2007 (REFORMAT)


an+1 = 2(3n + (1)n ) + 3(3n1 + (1)n1 )
= 2 3n + 3 3n1 + 2(1)n + 3(1)n1
= 3n1 + (1)n+1

40

Lecture 15
June 25, 2007 (Reformat)
15.1

Second Order Linear Constant Coefficient


Recurrence Relations

Remark If f (n) satisfies a linear homogeneous recurrence relation, then


c f (n) does as well for all c R
Remark If f and g satisfy a linear homogeneous constant recurrence relation, then so does f + g
Example 15.1.1. an+1 = 4an + 5an1
Solution We make an initial guess that the solution for the recurrence
relation is rn (So far, the solutions have been in this form).
rn+1 = 4rn + 5rn1
rn1 (r2 4r + 5) = 0
So r = 5, 1 (exclude 0 because its not interesting). Now that we
have values for r, we can find a solution for any given initial conditions.
Suppose a0 = 3, a1 = 9.
an = c1 5n + c2 (1)n
a0 = c1 50 + c2 (1)0 = c1 + c2 = 3
a1 = c1 51 + c2 (1)1 = 5c1 c2 = 9
So c1 = 2 and c2 = 1.
Example 15.1.2. a sn+1 = b sn csn1
For a general solution,
41

LECTURE 15. JUNE 25, 2007 (REFORMAT)

42

arn+1 = brn crn1


rn1 (ar2 + br + c) = 0
The ar2 +br+c is called the characteristic polynomial of the recurrence relation.
The roots of the polynomial drives the behavior of the recurrence relation.
Example 15.1.3. sn=1 = 4sn 5sn+1 , s0 = 1, s1 = 2
Example 15.1.4. The characteristic polynomial is r2 4r + 5 = 0. Its clear that
there are complex roots here (5 is prime). The roots are r = 2 i.
sn = c1 (2 + i)n + c2 (2 i)n
s0 = c1 + c2 = 1
s1 = 2c1 + 2c2 + i(c1 c2 )
So c1 = c2 = 1/2
Remark (Demarvways theorem..............fix name). a+bi = rei = r(cos()+
i sin()), which can be found using polar form.
So applying this to the problem at hand,
a + bi = rei
(a + bi)n = rn (cos(n) + i sin(n))
n
n
Example
15.1.5. c1 (a + bi ) + c2 (a bi )
r = a2 + b2
= arctan( ba ), a, b 0
c1 rn (cos(n) + i sin(n)) + c2 rn (cos(n) + i sin(n))
c1 rn (cos(n) + i sin(n)) + s2 rn (cos(n) i sin(n))
(c1 + c2 )rn cos(n) + (c1 c2 )rn i sin(n)

So far we have covered two unique roots and two complex roots, but
what about the case when both roots are the same?
Example 15.1.6. sn = 4sn1 4sn2 , s0 = 1, s1 = 2
Solution The characteristic polynomial is r2 4r + 4 = 0, or (n 2)2 = 0
Im going to show you what works, and I wish I had a better intuition
for why it works, but I dont. It just works.
sn = c1 2n + c2 n2n
s0 = c1 20 + c2 020 = 1
s 1 = c1 2 + c2 2 = 1
So c1 = 1 and c2 = 12

Lecture 16
June 27, 2007 (reformat)
16.1

Review

This is a quick review of Constant Coefficient Linear Homogeneous Recurrence Relations. This section generalizes the behavior of these forms of
relations.
If r is multiplicity m, it contributes a term in the form (0 + 1 n + 2 n2 +
. . . + m1 nm1 )rn
If r, r are complex roots of multiplicity m, then they contribute a term in
the form (0 + 1 n + x n2 + . . . + m1 nm1 )rn + (0 + 1 n + . . . + m1 nm1 )nm ,
which is equal to (c0 + c1 n + . . . + cm1 nm1 )|r|n cos(n) + i(d0 + d1 n . . . +
dm1 nm1 )|r|n sin(n), c Z, d C

16.2

Non-Homogeneous Recurrence Relations

Example 16.2.1. an = an1 + 2n , a0 = 1


Solution an = c1 (1)n + c2 2n
c1 (1)n + c2 2n = c1 (1)n1 c2 2n1 + 2n
c2 2n = c2 2n1 + 2n
c2 = c2 /2 + 1
c2 = 2/3, so c1 = 1/3
Example 16.2.2. an = 2an1 + 3n , a0 = 1

43

LECTURE 16. JUNE 27, 2007 (REFORMAT)

44

Solution a0 = 1
a1 = 5
a2 = 19
a3 = 65
an = c1 2n + c2 3n
c1 2n + c2 3n = 2(c1 2n1 + c2 3n1 ) + 3n
c2 = 2/3c2 + 1
c2 = 3
a0 = c1 20 + 3 30 = c1 + 3 = 1 c1 = 2
an = 3n+1 2n+1
Proposition 16.2.1. Consider the linear constant coefficient non-homogeneous
P
recurrence relation ki=0 ci an1 = f (n). If p(n) satisfies f (n), and h(n) satisfied
Pk
i=0 ci ani = 0, then p(n) + h(n) satisfies f (n).
Remark There are two things going on in a non-homogeneous recurrence
relation. One part is homogeneous, and the other is non-homogeneous.
The non-homogeneous part determines the behavior of the function.
Example 16.2.3. an = 9an1 20an2 + 3n , a0 = a1 = 1
Solution First, lets just look at the homogeneous portion.
(h)
(h)
a(h)
n = 9an1 20an2
Solving for the characteristic polynomial, we get:
r2 9r + 20r = 0, r = 4, 5
n
n
a(h)
n = c1 4 + c2 5
Now we take a look at the non-homogeneous portion (the particular)
solution.
(p)
an = c3 3n
We dont use any initial conditions to solve for c3 , instead we use the
(p)
original recurrence relation. Remember, an satisfies the initial relation on
its own.
c3 3n = 9c3 3n1 20c3 3n2 + 3n
c3 = 3c3 20/9c3 + 1
c3 = 2/9
Now we combine the particular and homogeneous solutions to get the
final solution.
(p)
an = an + a(h)
n

LECTURE 16. JUNE 27, 2007 (REFORMAT)

45

an = c1 4n + c2 5n + 2/9 3n
Using the initial condition, c2 = 5/2, c1 = 5
Example 16.2.4. an = 3an1 + (3)n , a0 = 1
(h)
Solution a(h)
n = 3an1
n
a(h)
n = c1 (3)
(p)
an = c2 (3)n
c2 (3)n = 3c2 (3)n1 + (3)n
c2 = c2 + 1
We have a problem here. In the same way that double roots mess up
solutions, when the homogeneous and particular solutions are the same,
there can be problems. To solve, we can multiply by n.
(p)
an = c2 n(3)n
c2 n(3)n = 3c2 (n 1)(3)n1 + (3)n
c2 n = c2 n c2 + 1
c2 = 1
And then to combine the particular and homogeneous solutions and
solving with the initial condition..
an = n(3)n + c1 (3)n
a0 = 0(3)0 + c1 (3)0 = 1
c1 = 1
an = (3)n + n(3)n

16.2.1

Steps to solving a non-homogeneous recurrence relation

1. Find the associated homogeneous solution


2. Guess the form of the particular solution
3. Shift the particular solution out of the way of the homogeneous
(multiply by n so no terms in the particular and homogeneous solutions overlap)
4. Substitute particular solution into recurrence relation to find constants

LECTURE 16. JUNE 27, 2007 (REFORMAT)

46

5. Sum the particular and homogeneous solutions and set it equal to


the initial conditions to find remaining constants.

Lecture 17
June 29, 2007 (reformat)
17.1

Combining Generating Functions and Recurrence Relations

Example 17.1.1. Find the generating function for the following recurrence relation: an = 3an1 , a0 = 1, n 0.
Solution
an xn =P3an1 xn
P

n
n
n=1 an x =P n=1 3an1 x

n
Let f (x) = n=0
Pan x
f (x) a0 = 3xP n=1 an1 xn1
n
f (x) 1 = 3x
n=0 a0 x
f (x) 3x f (x) P
=1
1
n
=
f (x) = 13x
n=0 (3x)
Example 17.1.2. Find the recurrence relation for the following recurrence relation:
an = an1 + an2 + n2 2n , a0 = a1 = 1, n 0
P
P
P 2 n n
P
n
n
n
Solution
a
x
=
a
x
+
a
x
+
n2 x
n
n1
n2
n=2
n=2
P
n
Let f (x) =
a
x
i=0 n
2x(1+2x)
f (x) x 1 = x( f (x) 1) + x2 f (x) + (12x)2 2x
f (x) x f (x) x2 f (x) = x + 1 x +

2x(1+2x)
(12x)2

2x(1+2x)
f (x)(1 x x ) = 2x + 1 + (12x)2
2x(1+2x)
1
2x
f (x) = 1xx
2 1xx2 + (1xx2 )(12x)2
2

47

2x

LECTURE 17. JUNE 29, 2007 (REFORMAT)

17.2

Using Generating Functions to Problems We


Cant Already Solve

Example 17.2.1. an = an1 + 3bn1 , a0 = 0


bn = an1 bn1 , b0 = 2, n 0
P
P
n
n
Solution
Let f (x)
=
n x and g(x) =
n=0 a
n=0 bn x
P
P
P
n
n
n
an1 x + 3bn1 x
n=1 an x =
f (x) = x f (x) + 3xg(x)
3xg(x)
f (x) = 1x P
P
P
n
an1 xn bn1 xn
n=1 bn x =
g(x) 2 = x f (x) xg(x)
(1x) f (x)
g(x) = 3x
(1x) f (x)
(1x) f (x)
2 = x f (x) x 3x
3x
(1x) f (x)
(1x) f (x)
x f (x) + 3x = 2
3x
6x
f (x) = (1x)
3x2 + x(1 x)
6x
f (x) = 14x
2
6x

g(x) = 1x
3x
14x2
2(1x)
g(x) = 14x2
1
g(x) = 2(1 x) 14x
P2
g(x) = 2(1
x) i=0 (2x)2iP
P
2i
g(x) = 2 i=0 (2x)2i 2x
i=0 (2x)
n
If n is odd, bn = 2
If n is even, bn = 2n + 1

17.3
y(1+y)
(1y)2

48

Additional Formulas
P
k=0

k2 yk

Das könnte Ihnen auch gefallen