Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Class 19: Asymptotic Operators

Class 19: Asymptotic Operators

Published March 6, 2016 in Programming

cs1120: Introduction to Computing
Explorations in Language, Logic, and Machine
University of Virginia, Spring 2016

http://xplorecs.org/class19

Class 19:
Asymptotic Notation
Proving O, Omega, and Theta bounds

David Evans

March 15, 2016
Tweet

More Decks by David Evans

Other Decks in Programming

Transcript

  1. Class 19: Asymptotic Notation and the Cost of Computing Introduction

    to Computing: Explorations in Language, Logic, and Machines cs1120 Spring 2016 David Evans University of Virginia
  2. Plan Today Asymptotic Operators big-O, , Cost of Computing (notes

    today, class Wednesday) Wednesday Project 4 Due Friday Last chance to become eligible for Blue Belt test Next Monday Blue Belt test (in class)
  3. In computing, the function inside the operator is (usually) a

    mapping from the size of the input to the number of steps required. Asymptotic operators abstract away details about particular computers. 4 Asymptotic Operators These notations define sets of functions
  4. Big O • Intuition: the set of functions that grow

    no faster than f (more formal definition soon) • Asymptotic growth rate: as input to f approaches infinity, how fast does value of f increase – Hence, only the fastest-growing term in f matters. 5
  5. O(n3) O(n2) f(n) = n2.5 f(n) = 12n2 + n

    f(n) = n3.1 – n2 Where is Ω(n2)? Ω(n2) 14
  6. Ω(n3) Ω(n2) f(n) = n2.5 f(n) = 12n2 + n

    f(n) = n3.1 – n2 O(n2) Inside-Out 15
  7. Recap Big-O: functions that grow no faster than f Omega

    (Ω): functions that grow no slower than f 16
  8. The Sets O(f ) and Ω(f ) f O(f) Functions

    that grow no faster than f Ω(f) Functions that grow no slower than f 17
  9. Theta (“Order of”) Intuition: set of functions that grow as

    fast as f Definition: Slang: When people say, “f is order g” that means 18
  10. Charge • Project 4 due Wednesday • To take Blue

    Belt test, must be eligible by Friday • Next class: analyzing cost of functions