Solution to homework#6, ICS6A, Winter, 1999
-- By Zhao, Hong


Textbook:

P78:
3. What are the terms a0, a1, a2, and a3 of the sequence {an}, where an equals
a) 2n + 1?
Answer: a0 = 2, a1 = 3, a2 = 5, a3 = 9
 
b) (n+1)n+1?
Answer: a0 = 1, a1 = 4, a2 = 27, a3 = 256
 
c) floor(n/2)?
Answer: a0 = 0, a1 = 0, a2 = 1, a3 = 1
 
d) floor(n/2) + ceiling(n/2)
Answer: a0 = 0, a1 = 1, a2 = 2, a3 = 3
 

7. What is the value of each of the following sums of terms of a geometric progression?
a) Sum(3 * 2j), where j = 0, 1, 2, ..., 8
Answer: ( 3 * 28+1 -3 ) / ( 2 - 1 ) = 1533
 
b) Sum(2j), where j = 1, 2, ..., 8
Answer: ( 28+1 -1 ) / ( 2 - 1 ) - 20 = 510
 
c) Sum( (-3)j ), where j = 2, ..., 8
Answer: ( (-3)8+1 -1 ) / ( -3 - 1 ) - (-3)0 - (-3)1 = 4923
 
d) Sum( 2 * (-3)j ), where j = 0, 1, 2, ..., 8
Answer: ( 2 * (-3)8+1 -2 ) / ( -3 - 1 ) = 9842
 

10. Compute each of the following double sums.
a) SumOveri( SumOverj ( i - j ) ), where i = 1, 2, 3, and j = 1, 2.
Answer: (1-1) + (1-2) + (2-1) + (2-2) + (3-1) + (3-2) = 3

b) SumOveri( SumOverj ( 3i + 2j ) ), where i = 0, 1, 2, 3, and j = 0, 1, 2.
Answer: (3*0+2*0) + (3*0+2*1) + (3*0+2*2) + (3*1+2*0) + (3*1+2*1) + (3*1+2*2) + (3*2+2*0) + (3*2+2*1) + (3*2+2*2) + (3*3+2*0) + (3*3+2*1) + (3*3+2*2) = 78

c) SumOveri( SumOverj ( j ) ), where i = 1, 2, 3, and j = 0, 1, 2.
Answer: 3 * ( 0 + 1 + 2 ) = 9
 
d) SumOveri( SumOverj ( i2j3 ) ), where i = 0, 1, 2, and j = 0, 1, 2, 3.
Answer: (02 * 03) + (02 * 13) + (02 * 23) + (02 * 33) + (12 * 03) + (12 * 13) + (12 * 23) + (12 * 33) + (22 * 03) + (22 * 13) + (22 * 23) + (22 * 33) = 180
 

A-2:
2. Find each of the following quantities.
a) log2 1024
Answer: 10

b) log2 (1/4)
Answer: -2

c) log4 8
Answer: (log2 8) / (log2 4) = 3/2

 
4. Let a, b, and c be positive real numbers. Show that a^(logbc) = c^(logba). Where "^" means "power".
Proof: logb c = loga c / loga b => a^(logb c) = a^(loga c / loga b) = (a^loga c)^(1/loga b)  = c^(1/loga b) = c^(logb a)

where, 1/loga b = 1/(logx b / logx a) = logx a / logx b = logb a
 
P209:
3. Find f(2), f(3), f(4), and f(5) if f is defined recursively by f(0) = -1, f(1) = 2 and for n = 1, 2, ...
a) f(n+1) = f(n) + 3 * f(n-1)
Answer: b)  f(n+1) = f(n)2 * f(n-1)
Answer:
  • f(0) = -1
  • f(1) = 2
  • f(2) = f(1)2 * f(0) = 22 * (-1) = -4
  • f(3) = f(2)2 * f(1) = (-4)2 * 2 = 32
  • f(4) = f(3)2 * f(2) = 322 * (-4) = -4096
  • f(5) = f(4)2 * f(3) = (-4096)2 * 32 = 536870912
  • c) f(n+1) = 3 * f(n)2 - 4 * f(n-1)2
    Answer:
  • f(0) = -1
  • f(1) = 2
  • f(2) = 3 * f(1)2 - 4 * f(0)2 = 3 * 22 - 4 * (-1)2 = 8
  • f(3) = 3 * f(2)2 - 4 * f(1)2 = 3 * 82 - 4 * 22 = 176
  • f(4) = 3 * f(3)2 - 4 * f(2)2 = 3 * 1762 - 4 * 82 = 92672
  • f(5) = 3 * f(4)2 - 4 * f(3)2 = 3 * 926722 - 4 * 1762 = 25764174848
  • d)  f(n+1) = f(n-1) / f(n)
    Answer:
  • f(0) = -1
  • f(1) = 2
  • f(2) = f(0) / f(1) = (-1) / 2 = -1/2
  • f(3) = f(1) / f(2) = 2 / (-1/2) = -4
  • f(4) = f(2) / f(3) = (-1/2) / (-4) = 1/8
  • f(5) = f(3) / f(4) = (-4) / (1/8) = -32
  • 6. Give a recursive definition of the sequence {an}, n = 1, 2, 3, ... if
    (Note:  There are many possible correct answers.)
     a)  an = 4n-2
    Answer:
    an-1 = 4(n-1) - 2 = 4n - 6
    an = 4n - 2 = ( 4n - 6 ) + 4 = an-1 + 4, for n>=1 and a1 = 2

    b) an = 1 + (-1)n
    Answer:
    an-1 = 1 + (-1)n-1
    an = 1 + (-1)n = 1 + (-1)(n-1)+1 = 1 + (-1)n-1 * (-1) = 1 - (-1)n-1 = 1 - [ 1 + (-1)n-1 - 1 ]
         = 1 - ( an-1 - 1 ) = 2- an-1, for n>=1 and a1 = 0

    c) an =  n(n+1)
    Answer:
    an-1 = (n-1)n = n2 - n
    an = n(n+1) = n2 + n = (n2 - n) + 2n = an-1 + 2n, for n>=1 and a1 = 2

    d) an =  n2
    Answer:
    an-1 = (n-1)2 = n2 - 2n + 1
    an = n2 = ( n2 - 2n + 1 ) + 2n - 1 = an-1 + 2n - 1, for n>=1 and a1 = 1
     
     

    11. Prove that f1 + f3 + ... + f2n-1 = f2n whenever n is a positive integer. ( fn is the nth Fibonacci number.)
    Proof: Prove by induction. Let P(n) be " f1 + f3 + ... + f2n-1 = f2n ", where n = 1, 2, 3, ...

    20. Show that the set S defined by "1 belongs to S" and "s+t belongs to S" whenever "s is an element of S" and "t is an element of S" is the set of positive integers.
    Proof: Let A be the set of all positive integers. To prove that A = S, we must show that A is a subset of S and that S is a subset of A.  
    25. Define well-formed fomulae of sets, variables representing sets, and operators from {-, U, ^, -}, where "-" means "complement", "U" means "Union", "^" means "intersection".
    Answer: If x is a set or a variable representiing a set, then x is a well-formed formula. If x and y are well-formed formulae, then so are x-, (x U y), (x ^ y), and (x - y), where "x-"means "complement of x".