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

Operator O?

  1. Sep 24, 2006 #1
    This operator, captial O is used in physics such as electrodynamics and can be placed in front of functions (i.e. Of(x)). Could somone explain it clearly with a definition. In what situations is it used?
     
  2. jcsd
  3. Sep 24, 2006 #2

    CRGreathouse

    User Avatar
    Science Advisor
    Homework Helper

  4. Sep 25, 2006 #3
    It seems the order (O) of f(x), which is g(x) (or f(x)=O(g(x))) provides the largest order of magnitude of growth for f(x).

    Whereas the little order (o) provides f(x) with a function which is one order of magnitude larger than the largest order of growth for f(x). Although I haven't regiorously explained order of magnitude, I had the limit definitions of these functions in mind. Why would they use o to describe a larger function than O?
     
    Last edited: Sep 25, 2006
  5. Sep 25, 2006 #4

    CRGreathouse

    User Avatar
    Science Advisor
    Homework Helper

    I don't know the history behind the notation, but I'm sure you could find it if you're really interested.

    A function f is O(g(x)) if g(x) is no larger asymptotically. It is o(g(x)) if g(x) is smaller asymptotically.

    Small o is useful when you have a function (or algorithm) that grows (runs) faster than one function but slower than another. The best factoring algorithms, for example, are o(2^n) but Ω(n^c). (Ω is just the opposite of o; f is Ω(g(x)) if g(x) is greater asymptotically.)
     
  6. Sep 25, 2006 #5
    I also realised that
    if f(x)=o(g(x)) then f(x)=O(g(x))
     
  7. Sep 25, 2006 #6

    CRGreathouse

    User Avatar
    Science Advisor
    Homework Helper

    Yeah. O is like <=, o like <, Ω like >=. There is also little-omega (>), but that's rare.
     
  8. Sep 25, 2006 #7

    0rthodontist

    User Avatar
    Science Advisor

    Asymptotic notation has to do with "within a constant multiple" rather than just strictly greater than or less than. You write
    f(n) = O(g(n)) iff there is some N and some k > 0, where for any n >= N, you have 0 <= k * f(n) <= g(n)

    One book I have uses f(n) [tex]\in[/tex] O(g(n)) instead of f(n) = O(g(n)) to emphasize that O(g(n)) actually is a set of functions that are asymptotically within a constant multiple of each other.
     
  9. Sep 25, 2006 #8

    CRGreathouse

    User Avatar
    Science Advisor
    Homework Helper

    Yes, of course. That's what I mean when I say "asymptotically less than" and such.

    The operator comparisons are good for people just getting used to the notation, as long as they understand the underlying definition. It helps keep people from flipping them by accident (hopefully!).

    I rather prefer that notation. I can't stand to see the = sign abused. In my posts above I only used "f is O(g(x))" rather than "f = O(g(x))" for that reason. Set notation isn't that common, so I didn't want to cause confusion, but I also don't like extreme notation abuse. (I can live with little stuff, but = is fundamental and should be used properly.)
     
  10. Sep 25, 2006 #9

    shmoe

    User Avatar
    Science Advisor
    Homework Helper

    It's not the largest order of magnitude of growth, rather an upper bound for the order of the growth. It doesn't need to be optimal in any way, x^2=O(x^34), this is as x->infinity. You will also see this big-O notation with other limit points, like 0 with taylor polynomials, e^x=1+x+O(x^2) just means there is a constant A>0 that in some small enough neighbourhood of x=0 we have |e^x-1-x|<=A|x^2|


    About the "=", I don't tend to think of O(f(x)) as meaning a set of functions, rather as a specific function that's bounded by a constant times f(x), and all we really care about is this functions growth is bounded in this way. For example, writing x+cos(x)=x+O(1), the O(1) to me is really standing for the function cos(x) but all that's going to matter later on is that this term is bounded in absolute value by a constant. The convenience is not having to keep exact track of what function is being hidden by the big-O at each step when all you care about are bounds.

    there's also the Vinogradov notations of the double arrows [tex]f\ll g[/tex] which means the same thing as the landau big-O, f=O(g).
     
  11. Sep 25, 2006 #10
    With your example, there is no doubt it is correct but o can be used as well and is a better alternative. Because all o can be replaced by O (but not vice versa) so it means it is always best to use o if possible (otherwise what is the point of having o).

    There is no doubt O is used more often than o and that could be why Wiki only has one entry called big O, not small o.
     
  12. Sep 25, 2006 #11

    CRGreathouse

    User Avatar
    Science Advisor
    Homework Helper

    Θ is best, if you can use it. f(x) is Θ(g(x)) iff f(x) is O(g(x)) and g(x) is O(f(x)). To extend the above analogy, it's like =.
     
  13. Sep 26, 2006 #12

    0rthodontist

    User Avatar
    Science Advisor

    Big-O comes from examining the worst case behavior of an algorithm, but little o doesn't seem to have such an intuitive origin. I guess you could use it to say that one algorithm runs asymptotically better than another, but I haven't seen that used. When you say an algorithm is big-O of a function there's usually the understanding that there are some inputs for which the algorithm is exactly theta of the function--you want to find the smallest possible function that the algorithm is big-O of. If you say an algorithm is little-o of a function then you just want to ask what's the closer bound.
     
    Last edited: Sep 26, 2006
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Operator O?
  1. X-O game and chess! (Replies: 5)

  2. BIG O, BIG Omega, (Replies: 4)

  3. Big-O notation (Replies: 3)

Loading...