CSPP 50102 Mathematics for Computer Science—Summer 2011
Homework 6 (assigned July 27, due August 2)
Reading: Rosen chapter 2, section 2.4; chapter 3, sections 3.1–3.3.
Written assignment : Solve the following "Do" exercises and
assigned problems. Only solutions to the assigned problems should be
turned in. Note: You are responsible for the material covered in
both "Do" exercises and assigned problems.
"Do" Exercises (not to be handed in):
-
Use the definitions of Big Oh, Ω, Θ, and little Oh to determine if the
following assertions are true or false.
-
n(n + 1)/2 = O(n3)
-
n(n + 1)/2 = O(n2)
-
n(n + 1)/2 = Θ(n3)
-
n(n + 1)/2 = Ω(n)
-
n(n + 1)/2 = o(n3)
-
n(n + 1)/2 = o(n2)
-
Prove the following rules using the definitions of the notations involved.
-
If f1(n) = O(g1(n)) and
f2(n) = O(g2(n)), then
f1(n) + f2(n) =
O(max{|g1(n)|, |g2(n)|}).
-
If f1(n) = Ω(g1(n)) and
f2(n) = Ω(g2(n)), then
f1(n) + f2(n) =
Ω(max{|g1(n)|, |g2(n)|}).
-
If f1(n) = Θ(g1(n)) and
f2(n) = Θ(g2(n)), then
f1(n) + f2(n) =
Θ(max{|g1(n)|, |g2(n)|}).
What does the last rule imply for an algorithm that comprises two consecutively executed
parts?
-
For each of the following pairs of functions f (n) and g(n)
below, indicate whether f (n) is O, o, Ω, or Θ
of g(n). Note that zero, one, or more than one of these relations may hold
for a given pair; list all the correct ones.
-
f (n) = n100;
g(n) = 2n.
-
f (n) = nlg n;
g(n) = (lg n)n.
-
Use summation facts and known closed forms to transform the following summation into a
closed form. Note: lower and upper limits of summation are subscripted to the sum symbol.
-
∑1 ≤ k ≤n k3.
Use the method shown in class, starting with the difference between two successive general terms of the
sum. See also exercises 19 and 21 of section 2.4, page 162 of Rosen.
Assigned problems (to be handed in):
-
Prove each of the following statements. (5 points each)
-
log2(kn) = Θ(log2n), where k is a real number > 0.
-
log2(k + n) = Θ(log2n), where k is a real
number > 0.
-
(n + a)b = Θ(nb)
for all real constants a and b such that b > 0.
-
Prove each of the following statements. (5 points each)
-
n3 = o(2n).
(Hint: Use l'Hopital's rule repeatedly until n disappears from the numerator.)
(Note: The more general result,
nb = o(an) for all real
constants a and b such that a > 1, is also true.)
-
(log2n)a = o(na),
for any real constant a > 0.
(Note: The more general result,
(log2n)b = o(na)
for any real constants a and b with a > 0, is also true.)
-
Find two functions f (n) and g(n) that satisfy the following
relationship. If no such f and g exist, explain why not. (5 points each)
-
f (n) = o(g(n)) and
f (n) ≠ Θ(g(n))
-
f (n) = Θ(g(n)) and
f (n) = o(g(n))
-
f (n) = Θ(g(n)) and
f (n) ≠ O(g(n))
-
f (n) = Ω(g(n)) and
f (n) ≠ O(g(n))
-
For each of the following pairs of functions f (n) and g(n)
below, indicate whether f (n) is O, o, Ω, or Θ
of g(n). Note that zero, one, or more than one of these relations may hold
for a given pair; list all the correct ones and prove your answers. Note:
lg n = log2 n. (5 points each)
-
f (n) = n1/3,
g(n) = n2/3.
-
f (n) = (lg n)12;
g(n) = √n.
-
f (n) = n2n;
g(n) = 3n.
-
Compute each of the following sums and give Θ-estimates for each.
Note: lower and upper limits of summation are subscripted to the sum symbol.
(5 points each)
-
∑0 ≤ i ≤ n − 1 i(i + 1)
-
∑1 ≤ j ≤ n 3j+1
-
∑1 ≤ i ≤ n
∑1 ≤ j ≤ n ij
-
Prove: If c is a positive real number, then g(n) =
∑0 ≤ k ≤ n ck =
1 + c + c2 + … + cn is:
-
Θ(1) if c < 1.
-
Θ(n) if c = 1.
-
Θ(cn) if c > 1.
(5 points each)
-
Find a closed form for the sum
-
∑1 ≤ k ≤ n k2k =
1 × 2 + 2 × 22 + 3 × 23 + … +
n2n
using summation
facts and known closed forms. (10 points)
(Hint: Use the method shown in class, starting with the difference between two successive
general terms of the sum. See "Do" exercise 4 above, and exercises 19 and 21 of
section 2.4, page 162 of Rosen.)
Gerry Brady
Thursday July 28 12:25:39 CDT 2011