Fundamental Algorithms, Spring 1998
Assignment 1. Review of mathematical foundations.
Given January 21, due February 4.
- 1.
- For which of the following functions is it true that f(2n)
= O(f(n)) as
?
- a.
- f(n) = n.
- b.
-
.
- c.
-
.
- d.
-
.
- e.
-
.
- 2.
- A certain algorithm works collections triangles. After n passes
of the algorithm, the are T ``active'' triangles and P ``passive''
ones. In a pass of the algorithm, each active triangle is turned into 3
active triangles and 7 new passive ones. All the old passive triangles
remain unchanged. Starting with a single active triangle, how many triangles
will there be after n passes? Show that this is
.
- 3.
- Use the fact that
to show that
- 4.
- A data compression algorithm takes time proportional to
to compress a block of n bytes of data. The program compresses a
large data set by breaking it into blocks of n bytes and compressing
these blocks one after another. The program takes 30 minutes to compress
a gigabyte (GB) of data in 512 byte blocks. Assuming that all the time
is spent in the compression algorithm, how long would it take to compress
the same data if the block size were increases to 1 KB?