Evaluating Algorithms

Nathan Sprague

8/30/21

Evaluating Algorithms

A Story…

Take-Home Messages (1/2)

Take-Home Messages (2/2)

If not time, then what?

Basic Operations

Socrative Quiz…

\(\log_2 1 = 0\)

\(\log_2 2 = 1\)

\(\log_2 4 = 2\)

\(\log_2 8 = 3\)

\(\log_2 4,000,000,000 = ??\)

  1. about 6
  2. about 32
  3. about 1,024
  4. about 10,000
  5. about 1,000,000

Let’s Review Growth Functions…

Socrative Quiz…

Consider the following (very) informal definitions:

Assume that \(T(n)\) is a function that describes the number of operations required for program A. Select the first true statement from the following list.

  1. Program A is good enough as long as \(T(n) \leq n!\)
  2. Program A is good enough as long as \(T(n) \leq 2^n\)
  3. Program A is good enough as long as \(T(n) \leq n^3\)
  4. Program A is good enough as long as \(T(n) \leq n^2\)
  5. Program A is good enough as long as \(T(n) \leq n \log n\)
  6. Program A is good enough as long as \(T(n) \leq n\)
  7. Program A is good enough as long as \(T(n) \leq 1\)

Socrative Quiz…

Consider the following (very) informal definitions:

Assume that \(T(n)\) is a function that describes the number of operations required for program A. Select the first true statement from the following list.

  1. Program A is not totally useless as long as \(T(n) \leq n!\)
  2. Program A is not totally useless as long as \(T(n) \leq 2^n\)
  3. Program A is not totally useless as long as \(T(n) \leq n^3\)
  4. Program A is not totally useless as long as \(T(n) \leq n^2\)
  5. Program A is not totally useless as long as \(T(n) \leq n \log n\)
  6. Program A is not totally useless as long as \(T(n) \leq n\)
  7. Program A is not totally useless as long as \(T(n) \leq 1\)