understand how to describe computing cost to answer Problem 5 and Problem 10 well, but do after class today, you can submit an “addendum” to your Project 4 by 6:59pm tomorrow (Thursday), and still be eligible for Blue Best Test on Monday.
depends on lots of “details” For a given program, we want to describe the cost function: costf (input size) ∼ number of steps to execute Since we don’t know the absolute cost of a “step”, and it is a huge pain to count steps exactly, we use the asymptotic operators to hide these details.
and Comparison Operators on Bounded Values Conditional and Looping Constructs (not their bodies!) Function calls and returns (not the cost of executing function) List indexing and slicing These are not necessarily true – depend on Python implementation!
10n is Ω(n) and 10n is in O(n) • Doesn’t matter that you choose different c values for each part; they are independent • Is n2 in Θ(n)? – No, since n2 is not in O(n) • Is n in Θ(n2)? – No, since n2 is not in Ω(n) 13
Asymptotic Cost Notation (N is size of input) No increase in cost Constant O(1) Increases by fixed amount Linear ϴ(N) Increases by size of input Quadratic ϴ(N2) Doubles cost Exponential ϴ(2N)
didn’t understand how to describe computing cost to answer Problem 5 and Problem 10 well, but do now, you can submit an “addendum” to your Project 4 by 6:59pm tomorrow (Thursday), and still be eligible for Blue Best Test