A. Summations
Exercises
A.1-1
Any function belonging to O(fk(i)) is upper bounded by fk(i). Using the definition of the big O notation, gk(i)=O(fk(i)) implies gk(i)≤ckfk(i) for some real constant ck>0 and all i≥i^k. Define c=max{ck:1≤k≤n} and i0=max{i^k:1≤k≤n}. For all i≥i0 (assuming n≥0)
The asymptotic variable on both sides is i whilst n is essentially fixed. Regardless how we substitute those n functions on the left, their sum is asymptotically bounded from above by a corresponding sum of upper bounds as i→∞.
This equation is frequently employed in analysis of algorithms. Suppose our algorithm consists of n=3 sections whose running times are O(ilgi), O(i2) and O(i). The total time is commensurate with their sum, which by our equation is O(ilgi+i2+i)=O(i2).
A.1-2
A.1-3
A.1-4
Notice that our infinite series is absolutely convergent, since it transforms into a decreasing geometric series with x=21. Consequently, we can even rearrange the terms, although the derivation below only relies on the linearity of convergent series. Denote the original sum as S, thus
Another possibility is to simply use x=−21 in equation (A.7).
A.1-5
The upper bound is
The lower bound demands more work, as we drop half of the terms and try to bound a partial sum.
Theorem 3.1 implies that ∑k=1nkc=Θ(nc+1).
You may also want to look at Faulhaber's formula. It generalizes the sum of integer powers.
A.1-6
Differentiating both sides of the infinite geometric series (A.11) gives
A.1-7 🌟
Introduces and proves the identity ∑k=1nklgk=Θ(n3/2lg1/2n).
The upper bound is
The lower bound can be attained by splitting the summation as in Exercise A.1-5 assuming n≥4, so that lgn−1≥(lgn)/2.
Theorem 3.1 implies that ∑k=1nklgk=Θ(n3/2lg1/2n).
★ A.1-8 🌟
Introduces and proves the identity ∑k=1n2k−11=ln(n)+O(1).
Equations (A.8) and (A.9) are our starting points.
We will keep all constants and bundle them under single O(1) only in the last step for better visibility. Observe that aO(1)+bO(1)+c=O(1) for all real constants a, b and c. Let us multiply the leftmost and rightmost expressions by 2.
★ A.1-9 🌟
Introduces the direct comparison test for deciding about convergence of infinite series and shows that ∑k(k−1)/2k=0.
We have an infinite sum similar to the one in (A.11) with x=1/2. The linearity property also applies to infinite convergent series, but first we must prove that our series converges. For the sake of variety, let’s use the direct comparison test. The infinite sum in (A.11) converges for the given x, thus we can use it as a reference. For all k>0 it is indeed true that 0≤2kk−1<2kk, so our series converges.
First we will use the linearity property of summations and afterward apply (A.11) and (A.7).
★ A.1-10 🌟
Introduces the limit comparison test and shows that ∑k=1∞(2k+1)x2k=(1−x2)2x2(3−x2).
If x=0, then the result is zero, so assume that x=0. Let y=x2, since ∣x∣<1⟹y<1.
The story is similar to the previous exercise, although we cannot use the same convergence test. The limit comparison test turns out to be appropriate. We will again use the sum in (A.11) as a reference (using y instead of x), since we know it converges. All terms in both sums are positive (recall that k≥1), so we can calculate the limit.
According to the test, our sum converges. We can now proceed exactly as in the previous exercise.
We have tweaked the starting index for k in the expansion, hence that extra -1. After reversing the initial substitution we get
★ A.1-11 🌟
Demonstrates the exp-log technique, telescoping sums, and shows that ∏k=2n(1−k21)=2nn+1.
Observe that all terms of the product are positive. Therefore, we can convert a formula with a product to a formula with a summation by using the identity from the book.
There is also an alternative method by noticing that P=(∏k=2nkk−1)×(∏k=2nkk+1). This leads to a telescoping product.
A.2-1
f(k)=k21 is a monotonically decreasing function, so we can use integral approximation (A.19) to bound the summation.
A.2-2
A.2-3
The idea is to split the range 1 to n into ⌊lgn⌋ pieces and lower-bound the contribution of each piece by 1/2. The pieces are the same as in the case of calculating the upper bound. The only difference is that the representative (pivot) of each piece is 1/2i+1 instead of 1/2i for i=0,1,...,⌊lgn⌋−1. Furthermore, some pieces may be missing in the last segment (for i=⌊lgn⌋), but this is OK for getting the lower bound.
A.2-4
f(k)=k3 is monotonically increasing, so we can use integral approximation (A.18) to bound the summation.
A.2-5
We would have an improper integral, since f(k) is undefined for k=0.
Problems
A-1 Bounding summations
a.
b.
The upper bound is
The lower bound is
Theorem 3.1 implies that ∑k=1nlgsk=Θ(nlgsn).
c.
The upper bound is
The lower bound is
Theorem 3.1 implies that ∑k=1nkrlgsk=Θ(nr+1lgsn).
Last updated