Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

O notation

  1. May 22, 2010 #1
    I'm not sure if there is another more appropriate place to ask this question but here it is:
    Prove that O(1) is the same as O(2)

    O(1) would be the same as O(2) in the sense that for all n, given the constant functions
    f(n) = c_1, and g(n) = c_2 we have f(n) <= g(n), yes? Or should "same" be taken more
    literally here? If so, then in what way would we prove this?
     
  2. jcsd
  3. May 22, 2010 #2

    diazona

    User Avatar
    Homework Helper

    The Wikipedia article on big O notation may be useful here. I think you could use the formal definition to prove that any function which is O(1) is also O(2), and vice-versa, which seems like a reasonable "sameness condition" to me.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: O notation
  1. Big O Notation Question (Replies: 15)

  2. FILE I/O in an IDE (Replies: 1)

  3. C++ file i/o (Replies: 7)

Loading...