Final Exam Review I
On this webpage I denote (n choose k) by (n | k) and (n multi-choose k) by ((n | k)). These are not standard symbols: use the vertical notation in your own writing.
- Basic Enumeration (Ch 2.1, 2.2, 2.5)
- Basic Principles
- Sum: split objects into disjoint cases
- Product: analyze each object into a sequence of independent choices
- Difference: good objects = all objects minus bad objects
- Quotient: number of columns = number in rectangle divided by number in each row
- Transformation: change the objects into equivalent data which are easier to count
Four Basic Problems: n!, nk, (n | k) = nk/k!, ((n | k))
- Multi-choose numbers: ((n | k)) = (n+k−1 | k) = (n+k−1 | n−1) using bins-and-beans correspondence
- Principle of Inclusion-Exclusion (PIE, negative counting):
|Agood| | = | | A − (A1∪...∪Ar) |
|
| = | |A| − ∑i |Ai| + ∑ i < j |Ai∩Aj| − ... + (−1)r |A1∩...∩Ar|.
|
We count a set of good objects Agood, starting with a large set A of all objects and excluding sets of bad objects A1 , ... , Ar .
- Pascal's Triangle (n | k) = (n−1 | k) + (n−1 | k−1)
Binomial Theorem: (a+b)n = ∑k=0n (n | k)akbn−k
- Transformations
- Bins-and-beans: proves ((n | k)) = (n−1 + k | k)
- Multiplicity: writes a multi-set by counting how many of each kind
- Position: transforms binary sequences (like coin-flips) into sets
Proves the total number of subsets of an n-element set is 2n
- Generating functions (Ch 2.6.1−2.6.5)
- Goal: Given a combinatorial sequence {ak}k≥0, find an explicit formula for ak .
- Step 0: If you start with a single counting problem a, generalize it to a family of problems ak for k = 0,1,...,n or all k ≥ 0 .
- Step 1: Find a simple formula for the generating function
f(x) = ∑k≥0 akxk .
- Often ak counts the objects of size k in some (usually infinite) set A.
The Product Principle for objects in A gives a product expression for f(x),
often involving geometric series: (1+x+x2+...) = 1/(1−x) .
- Recurrence for ak implies an equation involving f(x). Solve this equation for f(x).
- Step 2: Given a formula for f(x), find a formula for its coefficients ak
- Taylor's Theorem: ak = f(k)(0)/k! , where f(k)(x) means the kth derivative.
- Binomial Theorem (proved using Taylor's Thm)
(1+z)n = ∑0≤k≤n (n | k) zk
(1−z)−n = ∑k≥0 ((n | k)) zk (negative exponent)
- Geometric Series
∑k≥0 zk = 1/(1−z)
1 + z + z2 + ... + zn = (1−zn+1) / (1−z)
- Partial fraction decomposition: (cx + d) / (px2 + qx + r) = A/(1−ax) + B/(1−bx),
where the two sides have the same vertical asymptotes (roots of the denominators).
- Special sequences:
- Fibonacci 0,1,1,2,3,5,8,13,...; Fk = Fk−1 + Fk−2 ;
Fk =
1⁄√5
(φn − (−ψ)n)
for φ = ½(√5 + 1), ψ = ½(√5 − 1)
- Catalan 1,1,2,5,14,42,...; Ck = ∑i=0k−1 CiCk−i−1 ;
Ck = 1⁄(k+1) (2k | k)
See the Old Notes.
Final Review Problems I. See also Midterm Review Problems.
- Basic enumeration of combinations.
Count how many ways to choose k elements of n kinds:
the elements may be ordered or not, with repeats or not.
The example gives the case k = 2, n = 3.
- Ordered list, repeats allowed: (1,1) (1,2) (1,3) (2,1) (2,2) (2,3) (3,1) (3,2) (3,3)
- Ordered list, no repeats: (1,2) (1,3) (2,1) (2,3) (3,1), (3,2)
- Ordered list, each of the n kinds appearing at least once: no such if k < n. Hint: Use PIE with A = {lists from (a)}.
- Unordered set, no repeats: {1,2} {1,3} {2,3}
- Unordered multi-set, repeats allowed: {1,1} {1,2} {1,3} {2,2} {2,3} {3,3}
- Unordered multi-set, each kind appearing at least once.
Hint: Use bins-and-beans correspondence in which you remove one element of each kind.
- Counting solutions of n1 + n2 + n3 = 10.
- Count the triples of whole numbers n1,n2,n3 ≥ 0
satisfying the equation n1 + n2 + n3 = 10.
Example: 6 + 0 + 4 .
Hint: Put 2 bin-dividers between 10 beans.
- Same, but with n1,n2,n3 ≥ 1.
Hint: Interpret this also in terms of bins-and-beans.
- Extra Credit: Same, but suppose the numbers are rolls of the dice, so that each 1 ≤ ni ≤ 6.
Hint: PIE, combined with the previous solution.
- Re-do the above problem using generating functions.
- Let ak be the number of triples of whole numbers
n1,n2,n3 ≥ 0 satisfying the equation
n1 + n2 + n3 = k.
Hint: Evaluate f(x) = ∑k≥0 akxk using the Product Principle,
performing an algebraic substitution on the logical expression:
(n1 = 0 or n1 = 1 or
n1 = 2 or ...) and (n2 = 0 or ....) and (n3 = 0 or ...)
Compare a10 with your answer above.
- Same, but with n1,n2,n3 ≥ 1.
- Extra Credit: Same, but with 1 ≤ ni ≤ 6.
Hint: Expand the top, and take each term over the denominator.
- Give a formula for the sequence {pk}k≥0 defined by the recurrence:
pk = 3pk−1 − 2pk−2 for k ≥ 2,
where p0 and p1 are arbitrary given constants.
Hint: You can check your answer by computing pk directly in the case p0 = p1 = 1 (work out some values by hand),
and comparing with your general answer.
Answers
1a. Product Principle: nk
b. Product Principle (Basic Prob 2): nk = n(n−1)⋅⋅⋅(n−k+1)
c. PIE: A = {ordered list, any repeats}, Ai = {lists with element i missing} for i = 1,...,n.
#Agood = nk − (n | 1) (n−1)k + (n | 2) (n−2)k − ⋅⋅⋅ + (−1)n−1 (n | n−1) 1k .
d. Basic Prob 3: (n | k) = nk / k! = n! / k!(n−k)!
e. Basic Prob 4 (bins-and-beans correspondence, Notes 9/5):
((n | k)) = (k+n−1 | n−1) = (k+n−1 | k)
f. Correspondence: remove 1 element of each kind, leaving k−n elements to choose arbitrarily.
((n | k−n)) = (k−1 | k−n) = (k−1 | n−1)
2a. This is the Multiplicity Transform of multisets (Notes 9/5): ((3 | 10)) = (10+3-1 | 3-1) = (12 | 2) = 66.
b. ((3 | 10−3)) = (9 | 2) = 36.
c. Ans: 27.
3a. Problem: Let ak be the number of solutions to n1 + n2 + n3 = k with n1, n2, n3 ≥ 0.
Determine ak by evaluating f(x) = ∑k≥0 akxk.
Solution: The cases counted by the coefficients ak cannot be easily factored into a sequence of choices,
but consider all choices of (n1,n2,n3) without specifying the sum k:
choose (n1,n2,n3) ⇔ (n1 = 0 or n1 = 1 or n1 = 2 or ...) and (n2 = 0 or ....) and (n3 = 0 or ...)
To turn this into a generating function, replace the left side by f(x); "or" by + , "and" by × ,
"ni = m" by xm (since this choice contributes m to the sum n1+n2+n3):
f(x) = ∑k≥0 akxk = (x0 + x1 + x2 + ...) (x0 + ...)(x0 + ...)
= (1 + x1 + x2 + ...)3 = ( 1/(1-x) )3 = ∑k≥0 ((3 | k)) xk .
Hence ak = ((3 | k)) = (k+3-1 | 3-1) = (k+2)(k+1)/2 , and in particular a10 = 66.
3b. Problem: Now let bk be the number of solutions to n1 + n2 + n3 = k with n1, n2, n3 ≥ 1.
Determine bk by evaluating g(x) = ∑k≥0 bkxk.
Solution: By the same reasoning,
g(x) = ∑k≥0 bkxk = (x1 + x2 + ...) (x1 + ...)(x1 + ...)
= ( x (1 + x1 + x2 + ...) )3 = x3( 1/(1-x) )3
= ∑k≥0 ((3 | k)) xk+3
= ((3 | 0)) x3 + ((3 | 1)) x4 + ((3 | 2)) x5 + ...
= ∑k≥3 ((3 | k-3)) xk
Hence bk = ((3 | k−3)) = (k−3+3-1 | 3-1) = (k−1)(k−2)/2.
4. Turning the recurrence into an equation for f(x) = ∑k≥0 pkxk, we get:
f(x) | = |
(p1−3p0)x + p0
| | 1 − 3x + 2x2
| | .
|
Find roots of the denominator: 1 − 3x + 2x2 = 0 when x = 1 and x = 1/2, we may write:
f(x) = A/(1−x) + B/(1−2x) =
∑k≥0 A xk + ∑k≥0 2B xk ,
and we may compute A, B by:
(p1−3p0)x + p0 = A(1 − 3x + 2x2)/(1 − x) + B(1 − 3x + 2x2)/(1 − 2x)
= A(1 − 2x) + B(1 − x).
Substituting x = 1 and x = 1/2 gives: A = 2p0 − p1 , B = p1 − p0 .
Collecting xk terms, we find:
pk = 2p0 − p1 + 2k (p1 − p0) .
For the special case p0 = p1 = 1, the recurrence clearly works out as pk = 1, which agrees with our general formula.