Nathan Sprague
8/30/21
I need to write Python code to find the largest gap between any pair of numbers in a list:
Goal: develop a function that maps from input size to the number of steps
\(\log_2 1 = 0\)
\(\log_2 2 = 1\)
\(\log_2 4 = 2\)
\(\log_2 8 = 3\)
…
\(\log_2 4,000,000,000 = ??\)
Consider the following (very) informal definitions:
A reasonably fast computer can perform 1,000,000,000 operations per second
A reasonably short period of time is one second
A program is good enough if it can process 1,000,000 items in a reasonably short period of time on a reasonably fast computer.
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.
Consider the following (very) informal definitions:
A reasonably fast computer can perform 1,000,000,000 operations per second
A reasonably short period of time is one second
A program is not totally useless if it can process 100 items in a reasonably short period of time on a reasonably fast computer.
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.