Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Re: An informal introduction to O(N) notation

by dakkar (Hermit)
on Mar 25, 2003 at 14:26 UTC ( #245691=note: print w/replies, xml ) Need Help??

in reply to Re: An informal introduction to O(N) notation
in thread An informal introduction to O(N) notation


'Ο' is used for an estimate in excess (it's supposed to be a capital omicron, not an 'oh')

'Ω' is used for an estimate in defect (o-mega "is bigger" than o-micron)

'Θ' is used for the actual growth.

For example: mergesort is Ω(1), Ο(n2), Θ(n log n)

This is important since it's quite common to know boundaries on the complexity, but not the exact complexity. For example, matrix multiplication is Ω(n2) (you have to generate all the elements), and surely Ο(n3) (there is a naif algorithm with that complexity), but we don't know the exact function.

        dakkar - Mobilis in mobile
  • Comment on Re: Re: An informal introduction to O(N) notation

Replies are listed 'Best First'.
Re^3: An informal introduction to O(N) notation
by Anonymous Monk on Aug 29, 2007 at 14:14 UTC
    While we're nitpicking: O() defines an upper bound (typically, but not exclusively, on worst case behaviour) Ω() defines a lower bound (again typically, but not exclusively, on best-case behaviour) An algorithm is said to run in Θ(f(n)) if it runs in O(f(n)) and in Ω(f(n)), i.e. the upper and lower bounds are no more than a constant multiple of each other. It is a tighter definition than average-case execution complexity which depends on first defining the properties of an "average" input. I think what you're trying to define above is average-case execution complexity - by definition of the Θ() notation your statement above cannot be true. BTW mergesort is O(n lg n). - Menahem

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://245691]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2017-06-25 11:23 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (567 votes). Check out past polls.