Volume P2 · Concrete mathematics
The perturbation method and recurrences
Draft. This chapter is written and checked by the tools of the project, and a person has not reviewed it yet. Read it with care.
Sums and recurrences
Statement
A sum and a recurrence are two views of one object. The partial sums of a sequence satisfy a recurrence of the first order, and a recurrence of the first order often has a sum as its solution. This section makes the link precise and gives two methods to solve a recurrence: the repertoire method, for a recurrence with parameters, and the summation factor, for a linear recurrence of the first order.
Definition P2.2.1 (recurrence). A recurrence for a sequence gives some first values , the initial values, and a rule that gives for from and the earlier values . A solution is a sequence that satisfies the initial values and the rule. A closed form of the solution is a formula for that does not refer to earlier values, such as a polynomial in or a sum of powers .
Lean: Mathlib defines sequences by recursion on ℕ with Nat.rec or with pattern matching; LinearRecurrence is the structure for linear recurrences with constant coefficients, and Section 2.3 uses it.
Example P2.2.2. The partial sums satisfy the recurrence and for . This is the recursive definition of the sum with limits of Section 1.1, read as a recurrence.
Example P2.2.3. The recurrence , has the solution . The recurrence , , for has two initial values; its solution is the sequence of Fibonacci numbers , and Section 2.3 finds a closed form.
Theorem P2.2.4 (one solution). A recurrence with initial values and a rule for , where each is a function defined for all arguments, has exactly one solution.
Lean: in Mathlib a definition by recursion on ℕ gives the existence, and the uniqueness is a proof by Nat.strong_induction_on; for linear recurrences it is LinearRecurrence.eq_mk_of_is_sol_of_eq_init (proved in Mathlib).
Proof. Existence: define as given, and for define by the rule, from the values already defined. This is a definition by recursion, which P1 justifies. Uniqueness: let and be two solutions. Use strong induction on to prove . For both are the given initial value. For , the induction hypothesis gives for all , so .
Definition P2.2.5 (factorial and termial). For , the factorial is and the termial is . By the definitions of the product and the sum with limits, they satisfy the recurrences , and , for .
Lean: Mathlib Nat.factorial (notation n !), with Nat.factorial_zero, Nat.factorial_succ and Finset.prod_range_add_one_eq_factorial (proved in Mathlib); the termial has no own name and is ∑ i ∈ Finset.range (n + 1), i.
Example P2.2.6. The first factorials are for , and . The factorial counts the orderings of objects: there are choices for the first object, and orderings of the rest. This is the recurrence in words.
Example P2.2.7. The first termials are for . The termial counts the pairs with , since for each there are choices of . The example on pairs below the diagonal in Section 1.3 counted these pairs as , so ; the theorem on the termial below gives a second proof.
Proposition P2.2.8 (sums solve first order recurrences). A sequence satisfies for all if and only if for all .
Lean: Mathlib Finset.sum_range_induction (proved in Mathlib), which proves a closed form for a sum from its recurrence, and Finset.eq_sum_range_sub, which writes as plus the sum of the differences; Finset.sum_range_succ gives the other direction.
Proof. Let . For the recursive definition of the sum gives . Conversely, if for , then , and the telescoping sum of Section 1.2 gives .
Definition P2.2.9 (repertoire method). Consider a recurrence with parameters of the form and for , where , and are given. The repertoire method solves it as follows. Choose simple sequences , the repertoire, such as , , or . For each, find the values of for which it is a solution. Each choice gives one linear equation for the functions , , of the theorem below. Enough equations determine , and .
Lean: not a Lean notion; each closed form that it finds is a statement proved by induction, for example with Finset.sum_range_induction.
Example P2.2.10. For , , the sequence is a solution for . The sequence is a solution when and for all , that is, for . The sequence needs and , that is, , so . These three facts give , and , so .
Example P2.2.11. For , , the repertoire , and gives three equations. The sequence solves the recurrence for , so . The sequence needs , so it solves it for , and . The sequence needs , so it solves it for , and . So and . For and the solution is , and the first values agree with the recurrence.
Theorem P2.2.12 (linearity in the parameters). The solution of , is , where , and are the solutions for equal to , and . If a sequence solves the recurrence for some , then for those values.
Lean: not in Mathlib in this form; Mathlib has the linear structure of the solutions of a homogeneous recurrence as LinearRecurrence.solSpace.
Proof. Let . Then . For , since , and satisfy their recurrences. So is a solution, and by the theorem on one solution it is the solution. The second claim is the first one, applied to the given values of the parameters.
Theorem P2.2.13 (termial). For , .
Lean: Mathlib Finset.sum_range_id_mul_two and Finset.sum_range_id (proved in Mathlib), in the form .
Proof. The termial is the solution of , , which is the recurrence of the first example of the repertoire method with . By the theorem on linearity in the parameters, . The values found there by the repertoire are correct, since each repertoire sequence was checked to be a solution, and the theorem says that every solution has the form .
Theorem P2.2.14 (summation factor). Let be nonzero numbers and numbers, and let satisfy for . Let , so . Then A recurrence with has this form with and . The number is the summation factor.
Lean: not in Mathlib in this form; the closed form for a given recurrence is proved by induction, for example with Finset.prod_range_succ and Finset.sum_range_succ.
Proof. Each is a product of nonzero numbers, so it is nonzero. Divide the recurrence by : . So satisfies for , and . The proposition on sums that solve first order recurrences gives . Multiply by .
Proof
The theorem on one solution is the base of everything in this chapter. It turns every claim "the sequence is the solution" into a check that has the right initial values and satisfies the rule. Both methods of the section use it in this way. The repertoire method guesses many solutions of related recurrences and combines them; the theorem on linearity says that the combination is the solution. The summation factor changes the unknown sequence so that the rule becomes the rule of a sum.
The repertoire method needs no guess of the final answer, only of simple sequences. The method gives the right answer whenever the chosen repertoire produces as many independent equations as there are unknown functions. If a choice gives an equation that repeats an earlier one, add another simple sequence to the repertoire.
Examples
Example P2.2.15 (a factorial recurrence). Let and for . Here and , and . The summation factor gives . The first values are , and indeed and .
Example P2.2.16 (random descent). A counter starts at . While its value is positive, a step replaces by an integer chosen at random from , each with probability . Let be the expected number of steps to reach . Then , and for one step leads to each value with probability , so This rule uses all earlier values. Multiply by : . For the same equation for is . Subtract: , so and . The case gives , which fits the same rule. By the proposition on sums, , the harmonic number of Chapter 9. For the value is , and the rule gives and .
Example P2.2.17 (a loop). The program fragment "for from to , for from to , do one step" does steps. Let be this number. The outer loop for is the loop for followed by steps, so and , and by the theorem on the termial. For the fragment does steps.
Example P2.2.18 (a summation factor that is not a power). Let and for . Here , and . So . For the rule gives , so , and for it gives , so .
Exercises
- [M15] Solve , with the repertoire functions , , of the first example of the repertoire method.
- [M20] Use the repertoire method to solve , for .
- [M20] Solve , with a summation factor.
- [M22] Solve , for , in terms of the sums .
- [M20] Let and for . Prove that .
- [M18] Prove that and that for .
- [M25] Let and for . Find a closed form in terms of .
- [M24] Solve , with a summation factor, and compare the answer with the second example of the repertoire method.
- [M25] Prove that for , by pairing the factor with the factor .
- [M25] Solve , with the repertoire , , , , and deduce a closed form for .
Lean
Mathlib has the factorial as Nat.factorial, with Nat.factorial_zero for and Nat.factorial_succ for . The product form is Finset.prod_range_add_one_eq_factorial. The termial has no name in Mathlib; its closed form is Finset.sum_range_id_mul_two, which states in the natural numbers, and Finset.sum_range_id with a division.
A closed form for a sum is proved in Lean from the recurrence with Finset.sum_range_induction: if and , then . This is the proposition on sums that solve first order recurrences, and most of the closed forms of this chapter follow from it with a short computation by ring or field_simp. The harmonic numbers are Mathlib harmonic, a rational number, and TAOCP/Notation (tamnd/taocp-lean main) has TAOCP.harmonicPow with TAOCP.harmonicPow_one for the bridge to harmonic.
The repertoire method and the summation factor are methods, not theorems, and they have no Lean names. Their results are statements that Lean checks one at a time.
Notes and history
TAOCP Section 1.2.5 defines the factorial as the product of eq. 1.2.5(4), with in eq. 1.2.5(5) and the recurrence of eq. 1.2.5(6). The termial and its closed form are eqs. 1.2.5(9) and 1.2.5(10), where the closed form also defines the termial for numbers that are not integers. Section 1.2.3 proves the arithmetic sum by a manipulation of sums, and Section 2.2 of this chapter does the same.
The repertoire method is due to the spine text GKP94, which uses it in Chapter 1 for recurrences with several parameters. The summation factor is the discrete form of the integrating factor of a linear differential equation of the first order. The random descent of the examples is a model of several algorithms: the mean number of records in a random permutation of elements satisfies the same recurrence, so it is also , and harmonic numbers also give the mean depth of a node in a random search tree, as TAOCP Sections 1.2.10 and 6.2.2 show.
The perturbation method
Statement
The perturbation method finds a closed form for a sum from one identity. Write in two ways: split off the last term, and split off the first term. The second way gives a sum of the shifted terms . If can be written with , the identity becomes an equation for . This section applies the method to the geometric sum, the arithmetic sum, the sum and the sums of powers.
In this section is an integer, is a real or complex number, and .
Proposition P2.2.19 (perturbation identity). For every sequence and every , with ,
Lean: Mathlib Finset.sum_range_succ and Finset.sum_range_succ' (proved in Mathlib), the two ways to split off a term of .
Proof. Both sides equal . The left side is the recursive definition of the sum: the last term is split off. For the right side, split the range into and , and shift the index of the second part with the corollary on shift and reflection of Section 1.2: .
Theorem P2.2.20 (geometric sum). For and every number , For the sum is .
Lean: Mathlib geom_sum_eq (proved in Mathlib), in the form for , and geom_sum_mul for in every ring.
Proof. Let . Here . The perturbation identity and the distributive law give So . Divide by . For all terms are .
Corollary P2.2.21 (infinite geometric sum). For a real number with , the infinite sum exists and equals .
Lean: Mathlib tsum_geometric_of_lt_one (proved in Mathlib) for , and tsum_geometric_of_abs_lt_one for .
Proof. By the theorem, . Since , as , so the partial sums tend to . For the definition of an infinite sum by two limits in Section 1.1 the sum has only nonnegative indices, so this one limit is the whole condition. P5 treats the convergence of such sums in general.
Theorem P2.2.22 (arithmetic sum). For all numbers and ,
Lean: Mathlib Finset.sum_range_id_mul_two (proved in Mathlib) for the case , ; the general case follows with Finset.sum_add_distrib and Finset.mul_sum.
Proof. Let be the sum. The reflection of Section 1.2 gives . Add the two forms term by term, with the law for the sum of two families: . Divide by .
The perturbation identity for alone gives , which holds for every and says nothing. The method fails on this sum. The way out is to perturb the sum of the next power. With the identity gives . Now cancels, and , the case , of the theorem. The proposition on power sums below makes this trick general.
Theorem P2.2.23 (the sum ). For , For the sum is .
Lean: not in Mathlib in this finite form; the infinite form for is tsum_coe_mul_geometric_of_norm_lt_one (proved in Mathlib).
Proof. Let . Here . The perturbation identity, the sum of two families and the geometric sum give So . Put the right side over the denominator : the numerator is . Divide by once more. The case is the arithmetic sum.
Theorem P2.2.24 (sum of squares). For ,
Lean: Mathlib sum_range_pow (proved in Mathlib) gives every power sum through the Bernoulli numbers; the case of squares then needs a computation with bernoulli at , , .
Proof. Perturb . Since , the perturbation identity gives Cancel and use the arithmetic sum: . The right side is . Divide by .
Theorem P2.2.25 (sum of cubes). For ,
Lean: Mathlib sum_range_pow (proved in Mathlib) for the general power sum; the identity for cubes is not stated in Mathlib under its own name.
Proof. Perturb . Since , the fourth powers cancel as in the last proof, and By the two theorems above, . So . Divide by .
Proposition P2.2.26 (power sums). For let , with . Then So is a polynomial in of degree with leading coefficient , with rational coefficients.
Lean: Mathlib sum_range_pow (proved in Mathlib), Faulhaber's formula for with the Bernoulli numbers bernoulli; the binomial theorem is add_pow.
Proof. Perturb . By the binomial theorem of P1, , so the perturbation identity and the interchange of two finite sums give Here , and the term on the right is , which cancels. This proves the identity. For the second claim use strong induction on . For , has degree and leading coefficient . For , the identity gives . By the induction hypothesis each with has degree . So the right side has degree with leading coefficient , and has degree with leading coefficient .
Proof
Every proof of this section has three steps. First, apply the perturbation identity to a sum. Second, write the shifted term as a combination of terms whose sums are known, and of the sum itself. Third, solve the resulting linear equation for the unknown sum. The method works when the sum itself appears on the right with a coefficient other than , as in the geometric sum with the coefficient . When the coefficient is , the sum cancels; then the identity gives a lower sum instead, and the right move is to perturb a higher sum, as in the proofs for the squares, the cubes and the power sums.
The arithmetic sum has a second proof by reflection. Both proofs are short, and the reflection proof shows a fact that the perturbation hides: the terms and have the same average for every , so the sum is the number of terms times the average of the first and the last term.
Examples
Example P2.2.27 (a sum with halves). Take in the theorem on . Then , and For the sum is , and . As the sum tends to . The limit is the expected number of trials up to and including the first success, when each trial succeeds with probability , because that number is with probability .
Example P2.2.28 (alternating signs). Take and in the geometric sum: . This is for even and for odd , so the sum is the bracket of Section 1.1.
Example P2.2.29 (binary numbers). Take : . The binary number with ones is one less than the next power of . So a counter with bits holds at most , and a binary tree in which every level to is full has nodes.
Example P2.2.30 (odd numbers). The arithmetic sum with and gives . So the first odd numbers add up to . The picture is a square of points, cut into L-shaped layers of points.
Exercises
- [M10] Find in closed form.
- [M20] Prove that .
- [M20] Prove that .
- [M25] Use the perturbation method on to prove that for it equals .
- [M20] Prove that .
- [M25] Use the proposition on power sums with to prove that .
- [M15] Prove the theorem on the sum of cubes by induction on , without perturbation.
- [HM22] Prove that for real with .
- [M22] Let , with . Show that perturbation of gives nothing, and that perturbation of gives .
- [M22] Let . Prove that . Then prove that the terms with add up to , and deduce the theorem on the sum of cubes a second time.
Lean
Mathlib states the geometric sum as geom_sum_eq, over a division ring: for , . The form without division, geom_sum_mul, holds in every ring and gives the identity , which is the second step of the perturbation proof. Partial sums over an interval are geom_sum_Ico. The infinite sums are tsum_geometric_of_lt_one and tsum_coe_mul_geometric_of_norm_lt_one.
The perturbation identity is the pair Finset.sum_range_succ and Finset.sum_range_succ': the first splits off the last term of , and the second splits off the first term and shifts the rest. A Lean proof of the theorem on follows the text: rewrite the sum for in both ways, then close the linear equation with field_simp and ring.
For the power sums, Mathlib proves Faulhaber's formula sum_range_pow with the Bernoulli numbers bernoulli, a topic of Chapter 11. The proposition on power sums of this section is the recurrence behind it. The sum of squares and the sum of cubes have no own names in Mathlib, and a proof by Finset.sum_range_succ, induction and ring is three lines.
Notes and history
TAOCP states the geometric sum as eq. 1.2.3(14) and the arithmetic sum as eq. 1.2.3(15), and proves both by manipulation of sums. The sum of squares is eq. 1.2.6(12) in the form of a sum of binomial coefficients, and Chapter 3 gives a third proof with finite calculus. Section 1.2.3 of TAOCP and its exercises also treat .
The name perturbation method is from the spine text GKP94. The sums of squares and of cubes are very old. Aryabhata stated both around the year 500, and al-Karaji and Ibn al-Haytham gave proofs for cubes and for fourth powers. Jacob Bernoulli gave a rule for all power sums in his book of 1713, and the coefficients of his rule are the numbers now named after him. The identity is attributed to Nicomachus of Gerasa, who noted that the cubes are sums of consecutive odd numbers.
Linear recurrences with constant coefficients
Statement
Many recurrences in the analysis of algorithms give as a fixed linear combination of the last few values, plus a known term. The Fibonacci numbers are the main example. This section solves such recurrences of the first and the second order with a closed form, and shows how to prove a guessed closed form by induction. In this section the numbers are complex numbers, so that every polynomial has its roots.
Definition P2.2.31 (linear recurrence with constant coefficients). Let and let be numbers with . A linear recurrence of order with constant coefficients is a rule with initial values and a given sequence . It is homogeneous if for all . Its characteristic polynomial is .
Lean: Mathlib LinearRecurrence (a structure with order and coeffs), LinearRecurrence.IsSolution and LinearRecurrence.charPoly, for homogeneous recurrences; Mathlib indexes the coefficients in the order .
Example P2.2.32. The Fibonacci numbers are defined by , and for . This is a homogeneous recurrence of order with and . The first values are .
Example P2.2.33. The number of nodes of a full binary tree with levels to satisfies and : the tree is a root and two full trees with levels to . This is a recurrence of order with and , so it is not homogeneous. Its characteristic polynomial is .
Proposition P2.2.34 (the solutions of a homogeneous recurrence). The sequences that satisfy a fixed homogeneous linear rule of order for all form a vector space under termwise addition and multiplication by numbers. A solution is fixed by its initial values, and for every choice of initial values there is exactly one solution. So the space has dimension .
Lean: Mathlib LinearRecurrence.solSpace, LinearRecurrence.eq_mk_of_is_sol_of_eq_init and LinearRecurrence.solSpace_rank (proved in Mathlib).
Proof. If and satisfy the rule and , are numbers, then by the distributive law, so satisfies the rule too. Existence and uniqueness for given initial values are the theorem on one solution of Section 2.1. So the map from a solution to its initial values is linear and bijective onto the space of -tuples, which has dimension .
Proposition P2.2.35 (geometric solutions). Let . The sequence satisfies the homogeneous rule for all if and only if .
Lean: Mathlib LinearRecurrence.geom_sol_iff_root_charPoly (proved in Mathlib).
Proof. For , . Since , this is exactly when .
Theorem P2.2.36 (first order). Let for , with constants and . If , then with , If , then .
Lean: not in Mathlib in this form; it is the case of LinearRecurrence plus a constant, and a direct proof is an induction with pow_succ and ring.
Proof. The constant sequence satisfies the rule, since . So satisfies , and by induction. For the rule is , and the proposition on sums of Section 2.1 gives .
Theorem P2.2.37 (second order, two distinct roots). Let for , with , and let have two distinct roots . Then for all , with
Lean: not in Mathlib in this form; it follows from LinearRecurrence.geom_sol_iff_root_charPoly and LinearRecurrence.eq_mk_of_is_sol_of_eq_init.
Proof. The roots are not , since . By the proposition on geometric solutions, and are solutions, and by the proposition on the solution space, so is . Its initial values are and . So by uniqueness.
Corollary P2.2.38 (Binet's formula). Let and . Then for all , and is the integer nearest to .
Lean: Mathlib Real.coe_fib_eq (proved in Mathlib) states with Real.goldenRatio and Real.goldenConj, and Real.one_sub_goldenConj relates the two roots; TAOCP/Notation (tamnd/taocp-lean main) has TAOCP.fibInt for at all integers .
Proof. The roots of are and , and they are distinct, with and . With and the theorem gives and . For the second claim, since . So .
Theorem P2.2.39 (second order, one double root). Let for , and let with , that is, and . Then
Lean: not in Mathlib in this form; the check that is a solution is a computation with ring after pow_succ.
Proof. The sequence is a solution by the proposition on geometric solutions. The sequence is a solution too: for , So is a solution, with and . By uniqueness .
Proposition P2.2.40 (particular and homogeneous parts). Let be one solution of the rule for . Then a sequence satisfies this rule if and only if satisfies the homogeneous rule with .
Lean: not in Mathlib in this form; it is the subtraction of two instances of the rule, a proof by sub_eq and ring.
Proof. Subtract the rule for from the rule for : , since cancels. Conversely, add the rule for to the homogeneous rule for .
Proposition P2.2.41 (calls of a recursive program). A program computes by the rule: if return , else return the value for plus the value for . Let be the number of calls, the first call included. Then .
Lean: not in Mathlib; with Nat.fib the statement is an induction with Nat.fib_add_two.
Proof. A call with makes no further call, so . A call with makes one call for and one for , so . The first values are , and is , which suggests the guess . Prove it by strong induction. For and both sides are . For , the induction hypothesis and the Fibonacci rule give .
Proof
The proofs of this section rest on two facts. The first is uniqueness: a solution of a recurrence of order is fixed by its initial values (Section 2.1). The second is linearity: sums and multiples of solutions of a homogeneous rule are solutions. Together they reduce the problem to finding solutions of a simple form and matching the initial values. The geometric sequences with give the simple solutions when the roots are distinct; a double root gives the second solution .
A recurrence that is not homogeneous needs one more solution, a particular one. The proposition on particular and homogeneous parts reduces the rest to the homogeneous case. For a constant term try a constant ; this works when is not a root of . For a term try when is not a root. The last proposition shows the method that works for every recurrence: compute the first values, guess a closed form, and prove it by induction.
Examples
Example P2.2.42 (two roots of opposite sign). Let , and . Then , with and . The theorem gives and , so . The first values are , and indeed and .
Example P2.2.43 (a double root). Let , and . Then . The theorem gives and , so . The value agrees.
Example P2.2.44 (strings without two adjacent ones). Let be the number of strings of bits with no two adjacent s. Then (the empty string) and . For , a good string ends in , after a good string of length , or ends in , after a good string of length . So . Since and , uniqueness gives . For there are such strings: , , , , , , , .
Example P2.2.45 (a full binary tree). The recurrence , of the second example of the definition is the first order case with and . So , and . This agrees with the geometric sum of Section 2.2, since the tree has nodes on level .
Exercises
- [M15] Solve , , .
- [M15] Solve , , .
- [M18] The Lucas numbers are , and . Prove that , and that for .
- [M20] Let and for . Prove that , and explain the meaning of for the program of the proposition on calls.
- [M15] Prove that .
- [M22] Solve , with a particular solution.
- [M20] Prove that for , and the same identity with in place of . Deduce Binet's formula a second time, and compute to three decimals with the identity.
- [M25] Solve , , with the complex roots of , and prove that .
- [M25] Let and . Prove that , with the Lucas numbers of exercise 3.
- [M28] Let for . Prove that for , and deduce Cassini's identity .
Lean
Mathlib has a general theory of homogeneous linear recurrences in LinearRecurrence. A recurrence E has an order and coeffs, the predicate E.IsSolution u states the rule for a sequence u : ℕ → R, and E.mkSol init is the solution with the initial values init. The lemma LinearRecurrence.eq_mk_of_is_sol_of_eq_init is the uniqueness, LinearRecurrence.solSpace is the vector space of solutions, LinearRecurrence.solSpace_rank says that its dimension is the order, and LinearRecurrence.geom_sol_iff_root_charPoly is the proposition on geometric solutions. Mathlib does not state the closed forms for two distinct roots or one double root in general.
The Fibonacci numbers are Nat.fib, with the rule Nat.fib_add_two, and Mathlib also has Int.fib for integer indices. Binet's formula is Real.coe_fib_eq, with as Real.goldenRatio and as Real.goldenConj; the facts and are Real.goldenRatio_add_goldenConj and Real.one_sub_goldenConj. TAOCP/Notation (tamnd/taocp-lean main) has TAOCP.fibInt, with TAOCP.fibInt_natCast and TAOCP.fibInt_neg_natCast for the values at and . The nearest integer form of Binet's formula and the proposition on calls are not yet stated.
Notes and history
TAOCP defines the Fibonacci numbers by eq. 1.2.8(2), names the second root in eq. 1.2.8(13) and states Binet's formula as eq. 1.2.8(14). Section 1.2.8 proves the formula with a generating function, a method of P3; this section proves it with the characteristic polynomial and uniqueness. Chapter 10 treats the Fibonacci numbers in full.
The formula for is named after Jacques Binet, who published it in 1843, but de Moivre and Daniel Bernoulli knew it about a century before. The solution of linear recurrences with constant coefficients by the roots of a polynomial is due to de Moivre and Euler, in the eighteenth century. The method of the last proposition, to guess a formula from small cases and prove it by induction, is the most common way to solve a recurrence in practice.
The results of Chapter 2 and the equations of TAOCP Section 1.2 that they prove:
| TAOCP 1.2 | Result of P2 |
|---|---|
| 1.2.3 eq. 14 | Theorem P2.2.20 |
| 1.2.3 eq. 15 | Theorem P2.2.22 |
| 1.2.5 eqs. 4 to 6 | Definition P2.2.5 |
| 1.2.5 eqs. 9, 10 | Definition P2.2.5 and Theorem P2.2.13 |
| 1.2.6 eq. 12 | Theorem P2.2.24 |
| 1.2.8 eq. 2 | Definition P2.2.31 and its first example |
| 1.2.8 eqs. 13, 14 | Corollary P2.2.38 |
This chapter finds closed forms. A sum and a sequence defined by a recurrence are two forms of the same problem: the partial sums satisfy the recurrence , and the solution of a recurrence of the first order is often a sum. The chapter gives a small set of methods that turn such a problem into a formula in , and it proves the special sums that TAOCP Section 1.2 uses most: the geometric sum, the arithmetic sum and the sums of squares and cubes.
Section 2.1 defines recurrences, proves that a recurrence has exactly one solution, and introduces the factorial and the termial. It solves first order recurrences with two methods: the repertoire method, which combines simple solutions of related recurrences, and the summation factor, which turns a linear recurrence into a sum. Section 2.2 presents the perturbation method, which splits a sum in two ways and solves the resulting equation. It gives the geometric and the arithmetic sum, the sum , and the sums of powers. Section 2.3 solves linear recurrences with constant coefficients of the first and the second order, with two distinct roots or a double root, and proves Binet's formula for the Fibonacci numbers.
The chapter proves eqs. 1.2.3(14) and 1.2.3(15) of TAOCP, the factorial and the termial of eqs. 1.2.5(4) to 1.2.5(6), 1.2.5(9) and 1.2.5(10), the sum of squares of eq. 1.2.6(12), and the Fibonacci recurrence and Binet's formula of eqs. 1.2.8(2), 1.2.8(13) and 1.2.8(14). The table at the end of Section 2.3 gives the result of this chapter for each equation. The proof of Binet's formula here uses the characteristic polynomial; TAOCP uses a generating function, which is the topic of P3.
The chapter assumes P1 and Chapter 1: the laws of sums, the change of variable and the telescoping sum. Section 2.3 allows complex roots of a polynomial, but the examples in its text have real roots. Chapter 3 gives a second set of methods for sums, the finite calculus, and Chapters 9 and 10 return to the harmonic and the Fibonacci numbers that appear here for the first time.
The source of this page. Something is wrong? Report it.